Saturday 15 June 2013

sql server - Help with SQL to get Hits per day for today and 1 month prior -


मुझे अब यह एसक्यूएल है:

  क्रय प्रक्रिया Dbo.sel_Track_HitsLast30Days (@projectID int) के रूप में शुरुआत की घोषणा @FirstDay smalldatetime, @NumberOfMonths पूर्णांक, @priorMonth smalldatetime सेट @priorMonth = (कास्ट ((एसटीआर (YEAR (DATEADD (एम, -1 का चयन करें, getDate ()))) + '/' + एसटीआर (MONTH (DATEADD (एम, -1, getDate ()))) + '/' + एसटीआर (DAY (DATEADD (एम, -1, getDate ())))) दिनांक समय के रूप में)) का चयन करें @FirstDay = @priorMonth, @NumberOfMonths = 1 ; का चयन करें; साथ दिन के रूप में (DATEADD (एम, @NumberOfMonths, @ FirstDay +1) CalendarDay यूनिअन सभी का चयन करें DATEADD (घ, 1, CalendarDay) CalendarDay के रूप में दिन जहां DATEADD (घ, 1, CalendarDay) के & lt से के रूप में @FirstDay का चयन करें) calendarday, foundDate.TotalbyDate, foundDate.date दिनों से वाम बाहरी JOIN (COUNT (वाम (visitDateTime, 11)) का चयन TotalbyDate, सबस्ट्रिंग (परिवर्तित (चार (10 के रूप में) परिवर्तित (चार (10), visitDateTime, 121)), 1, 11) दिनांक से दिनांक dbo.TrackingData जहाँ visitDateTime & gt; = dateadd (d, datediff (d, 0, getdate ()), -30) और projectID = @projectID सबस्ट्रिंग द्वारा समूह (परिवर्तित (चार (10), चार (10 CONVERT (), visitDateTime, 121)), 1, 11)) foundDate foundDate.date = CalendarDay आदेश CalendarDay वर्णन अंत <द्वारा पर / कोड>  

यह ठीक काम करता है, लेकिन यह 31 दिनों के साथ खाते के महीनों में नहीं ले रहा है और मैं किसी कारण से आज की तारीख वापस नहीं पा रहा हूं।

प्रयास करें इस (AdventureWorks नमूना डेटाबेस के रूप में उपयोग करते हुए)

  घोषणा @today datetime, @NumberOfMonths पूर्णांक, @FirstDay smalldatetime @today का चयन करें = '2004-03-09', - getdate (), केवल @NumberOfMonths = 1, @FirstDay = CAST (फ़्लोअर (CAST (DATEADD (एम -1), @today) एएस फ्लोट के रूप में)) एएस datetime; दिन के रूप में (चयन करें @ पहले दिन कैलेंडर के रूप में यूनिअन सभी का चयन करें DATEADD (डी, 1, कैलेंडर डे) दिन के दिन के दिन दिन जहां डीडीडी (डी, 1, कैलेंडर डे) और एलटीटीडीडीडी (एम, @NumberOfMonths, @ फर्स्टडे + 1)) कन्वर्ट कन्वर्ट (बारबार (10), कैलेंडर दिवस, 111) के रूप में [दिनांक], [लेन-देन दिनांक] के रूप में [गणना] से दिन बकाया शामिल हैं। लेन-देन इतिहास पर लेन-देन इतिहास = दिन। कैलेंडर के माध्यम से कैलेंडर कैलेंडर द्वारा आदेश दिनांक  

क्या आउटपुट होगा

 दिनांक गणना ---------- ----------- 2004/02/09 272 2004/02/10 308 2004/02 / 11 264 2004/02/12 265 2004/02/13 250 ... 

संपादित करें : सभी अंतराल तिथियों को शामिल करने के लिए अपडेट किया गया


merge - Using git, how to do a 'use theirs' during a conflict? -


With GIT, how do I command "their" type branch merge? This order should only be overwritten with your native version as well as the original version.

To change your master with the master of origin:

  $ Git checkout master $ git branch - m master old-master $ git checkout --track -b master origin / master  

Our resolves any of the many prominent ones, but the result of the merge is always the current branch Is prominent. It is used to eliminate past development history of party branches.

If you want a remote branch to win, then create a tracking branch, check it, and git merge-s our ... from there .


python - Overload a method with a function at runtime -


OK, I'll already accept that this is a big villain and I can definitely apply it better I am It's just a hysterical curiosity that has come to me to find out how I can do it.

  class some class (object): def __init __ (self): def __ (self, agre): self. (String): Print string SomeClass (). Overloaded ("test string")  

This returns a parameter error because I'm only supplying overloaded (with two arguments instead of two) to tell the interpreter something The magic is that it is now a class method (I tried to decorate it with classmate, I have always considered it as its purpose ??)

Do not worry about self-parameters, the function is already available Is from the local area.

  class Some object (object): def __int_ (self): def __ (arg): self.bar (arg) self.foo = __ def foo (self, arg): print "Foo", arg def bar (self, arg): print "bar", arg some class () Foo ("Cheese") # Print "Bar Object"  

When creating an example ( __ new __ , IIRC, but before that __ init__ ) Python automatically binds all the methods to supply the example as the first argument. If you are adding a method later, then you have to manually supply the example manually. As you define work with self , you do not need to pass it again.

Python's new module is not a solution, it has been downgraded since 2.6. If you want to create a "real" example method, then partial decorator has to do it like this:

  import, some square (object): def __init __ (self): def __ ( Self, Arg): Self. Bar (Arg) itself Fu = "False" (self, AGR): print "AFU", AGR DRF Bar (self, AGR): print "bar", arg some class) .Fu ("cheese") # print " Bar object " 

c++ - How is memory allocated for a static multi-dimensional array? -


All,

This has been going to annoy me for a while. In C \ C ++ (I also think Java and .NET) we do not need to specify line index in multi-dimensional array. Therefore, for example, I can declare an array of ints like this:

int Array [] [100];

I think the static arrays in general are shown as the nearest memory on the stack. Therefore, taking a column-key representation, how does the compiler know how much memory is to allocate in the above case because it is one of the dimensions?

You can not do this in C ++ language

  Int Array [] [100]; / * Error: Incomplete type * /  

Because it will define an incomplete type of object, which is clearly illegal in C ++, you can use it in a non-defined declaration

  extern int Array [] [100];  

(or as a stable member of a class), but when it comes to the actual definition of the same array object, then both sizes will be clearly specified (or explicitly Initially received).

The situation in C is not very different, except that there are such things in C such as temporary definitions which let you write

  int array [ ] [100];  

However, a temporary definition in this regard is similar to a non-defined declaration, which is why it is allowed, finally you define the same object with the specified object explicitly (Some compilers do not need a non-standard extension). If you try to do something like this in a non-temporal definition, you will get an error

  Fixed int array [] [100]; / * Error: incomplete type * /  

So, if you think about it, with different definitions, the situation of C and C ++ is not very different: It is illegal to define an array of incomplete types and unspecified sizes in these languages ​​is an incomplete type.


POP3 connection string for livemail or gmail? -


I have third-party applications for which 'POP3 connection string' is required, I never got such a thing, But apparently something looks like this:

  line 314; Connection string: {pop3.live.com:995/pop3/ssl}INBOX  

or

  {outlook.XXXXXXXX.net:993/imap/ Ssl / novalidate-cert} INBOX  

The problem is that I can not seem to create a connection string for some mail or Gmail.

The application - (which is trying to connect to a POP3 account to process email bounces) - just gives an error.

I can not find any documents anywhere about the POP3 connection strings. I think it should be some kind of standard

The technical support for the product in question asked, "Ask Microsoft for a connection string for Windows Live Mail". I do not think the cost of trying to ask about it - but hopefully someone can give some light on this issue.

Perhaps a POP3 connection test tool would also be useful?

A POP URL generic form Is:

pop: // < User & gt ;; Auth = & lt; Auth & gt; @ & Lt; Host & gt ;: & lt; Monkey & gt;


About Gmail for Gmail ... this is not easy; Maybe the code can help in the example; Code is a note that says:

  / * * Access Gmail POP account * / / * $ message_file = 'pop3: //'.$user.': '. $ Password. '@ Pop.gmail.com:995/1?tls=1&debug=1&html_debug=1'; * /  

With some luck, maybe something similar can work in your application too?


c - First thread signal is not caught all others caught -


There is a very specific question, but I was thinking that a consumer is having a problem catching the first consumer {Pthread_cond_init (and condVars [i], NULL), with many consumers, for the manufacturer relationship (HTTP web server)

  (i = 0; i & lt; num_threads; i ++) ; If (SRCMP (policy, "fifo") == 0) pthread_create (& threadArr [i], zero, worker, FIFO, and condVars [i]); Otherwise pthread_create (and threads ARR [i], NULL, worker sff, and condVars [i]); } Listenfd = open_listenfd (port); // Producer while (1) {clientlen = sizeof (clientaddr); Connfd = Accept (listenfd, (SA *) and Client Aid, (Socon_T *) and Client Lion); Pthread_mutex_lock (& ​​amp; mutex); Whereas (numRequests == num_buffers) pthread_cond_wait (& amp; empty, and mutex); If (strcode (policy, "fifo") == 0) putFIFO (connfd); And put SSFF (connfd); NumRequests ++; Pthread_cond_signal (nextWorker);; NextWorker = (Next + 1)% num_threads; Pthread_mutex_unlock (& ​​amp; amp; mutex); Printf ("% s \ n", "Do not Watch Dead !!!"); } // Consumer Time (1) {pthread_mutex_lock (& ​​amp; mutex); Whereas (numRequests == 0) {printf ("% u \ n", condVar); Pthread_cond_wait (condVar, and mutex); Printf ("% s", "caught"); } Printf ("% s,% u \ n", "Its working!!!!!", Kandavi); Int connfd = buffer [nextOutFIFO]; NextOutFIFO = (nextoffiff + 1)% num_buffers; NumRequests--; Pthread_cond_signal (& amp; down); Pthread_mutex_unlock (& ​​amp; amp; mutex); RequestHandle (connfd); Off (connfd); }   

I do not believe the problem is solved in the last reply, because both The operation is being performed inside the important section.

I would recommend using a counting semaphore instead of an integer for numRequests . The manufacturer does a sem_post () and the consumer performs a sem_wait () . The first consumer coming back from the waiting will reduce the sequester and then lock Mute X only when modifying the shared variables, reduce the code within the important section, and put the sense of command Which is not provided by muiting alone.


c# - Detect Browser Close on Asp.net -


I want to do some functionality on logout, if the user closes his or her browser directly, then do the same functionality , We can not unload on the page because my website has more than 100 pages because it will work on redirection from each page

thanks

  & lt; Script type = "text / javascript" & gt; Var closing = true; $ (Function () {$ ("A, input [type = submit]"). Click (function () {close = false;}); $ (window) .unlod (function () {if (closing) {Jquery .jax ({url: "http: // localhost: 49591 / account / log off", async: false});}});}); & Lt; / Script & gt;  

When logging out using javascript + jquery, call logout.aspx. Logout. Do whatever you want to do in the ASPX page load event.

The above snippet should be added to the html of your master page.


how to browse folder or file or directory using php -


I'm new to php, now I'm working on a website that has a problem in the email form

I want to attach more than one file as an attachment (I got the necessary code for this purpose).

I have a browse button, but what I can not find is to type the code to open it in the required file / directory / folder (when I open a window on the browse button Since then, I take a file at a time, like Gmail Mail) .

I think that you understand what I want to tell you (I do not have to communicate well).

Thank you in advance

Amol, this simple process to complete your To provide multiple file upload controls on the form:

  & lt; Input type = "file" name = "file1" & gt; & Lt; Input type = "file" name = "file2" & gt; & Lt; Input type = "file" name = "file3" & gt; . . . & Lt; Input type = "file" name = "file10" & gt;  

On the server side, you can repeat all the $ _ files again, how many files were actually uploaded and accordingly they were processed accordingly .

Advanced methods include asynchronous to upload multiple files using an AJAX or Flash Uploader; Store them in a temporary folder and store the list of files uploaded in the session. When the Send button is clicked, you can do that session variable to determine how many files were attached to the email and processed accordingly.

I'm sure the file attachment script that you use supports attaching more than one file.


String comparison in Ruby on Rails unit-test -


My Ruby On Rail Unit test fails in a simple string comparison and I can not understand why.

In Model TestItem , I have

  doc = REXML :: Document.new (data) @bugtitle = doc.root.get_text ( "/ Bugzilla / Bg / short_desc")  

Where data is returned by an XML string Net :: HTTP :: Post request. The data looks good, and if I have the required string in the output @bugtitle in my unit-test, I have to do

  test "bugle" = ti = testitems (: A) assert_equal ("separate RID folder for X-ray correction images", Ti.bugtitle) end surprisingly (at least for me) the test fails with the following output (shell copy from the wordship): < / P> 
  1) Failure: test_bugtitle (TestTest) [unit / testim_stest. RB: 7]: & lt; "Separate RID folder to get X-ray correction images" & gt; Expected "separate RID folders to get X-ray correction images" & gt;  

I am at a disadvantage from where this error occurs because the string looks similar to me. What is the price, it is with Windows 2.3.4 and with Ruby 1.8.6 (I did not initially get it).

These two look identical, but only after you #inspect See representation. You should check the encoding and binary presentations (if Ruby is 1.9), this is probably the problem.


wpf - Set ItemsSource of a ComboBox to an Array of Integers? -


Set the items in an array of array for a combo box?

  & lt; Window xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http: // Schemas.microsoft.com/winfx/2006/xaml" xmlns: sys = "clr- Namespace: system; assembly = mscorlib "& gt; & Lt; Window.Resources & gt; & Lt; X: array x: key = "integers" type = "{x: type: sys: int32}" & gt; & Lt; Sys: Int32 & gt; 0 & lt; / Sys: Int32 & gt; & Lt; Sys: Int32 & gt; 1 & lt; / Sys: Int32 & gt; & Lt; Sys: Int32 & gt; 2 & lt; / Sys: Int32 & gt; & Lt; / X: array & gt; & Lt; /Window.Resources> & Lt; Combo box itemSource = "{binding source = {staticRSource inters}}" /> & Lt; / Window & gt;  

oracle - Configure Elmah to use existing stored procedure/tables -


We have a system with a table already and there are some stored procedures used for logging (oracle) . I am currently working on another system which is going to use the same database but there is no system for logging errors so far.

I have read that the Elmaha system was easy to use, and tried to set it up, but it seems that it tries to use tables and processes by default, which The scripts that come with the Elmah download can be made.

So, my question is, is it possible to configure Elmah to use MyStoredProcedure, and if it is, how do I configure it?

To change the call processed Elmah, and the parameter to be sent, Edit the file, and compile it again If you feel comfortable with it, then it should not be very difficult.

Alternatively, you can edit the script to change the built-in Elmho package to point to your own table.

/ div>

java - Websphere - What is the best way to hide wsdl's from end user? -


I think there are several ways to hide wsdl from end users for WebSphere (6.1). We use the axis to publish web services and I currently update the custom serlet class (which extends to Excallet) and overrides the service method to throw a 404 error just like the URL: the other Option filter may be added.

Is there any other alternative methods?

Thank you.

Is it worth pointing to Loots? You should add some authentication mechanism to your SOAP interface if they are potentially harmful Some may do however, if you insist that you look like a wsdl query for example

  • for your app, you can stop access to anything
  • Front-end web server configuration questions at another location, i.e.
  Rewriteignin on new rules ^ (. +)? Wsdl $ /error.html  

Round corners on images using Java and JAI -


We are using JAI for scaling and crop images in Java We want to make rounded corners on our images Are there. How do we do it?

Images are JPG and PNG I think it's easy to do with JPGs?

Image is a PlanarImage with JAI

  PlanarImage src = JAI.create (..., ...);  

which can be converted into java.awt.Graphics object

Has anyone been done before this?

PNG supports a transparent alpha channel, but JPG does not. Therefore, for the JPG you have to choose a color to paint the "invisible" part of the rectangle for the sphericals.

(Graphics2D) g; Goalrectangle 2D RR = new roundrackngal 2d. Float (50, 50, 200, 100, 10, 10); G2d.draw (rr); } Float () method of square RoundRectangle2D takes six arguments:

  • The first two represent the location of the upper left corner.
  • Logic represent the width and height of the round 3 and 4 round rectangle.
  • The last two logic represent the height and height of the arc drawn in the corner.

In this way, draw a rounded rectangle in which only the picture will be included which you want the rounded corners and then either use the mask to get the overlay or desired effect.


java - How to access CSS properties for a DOM node using the Cobra/Lobo HTML renderer -


itemprop = "text">

I figure out how to use CSS properties for a dome node (this example & lt; img> node) I am trying to use Cobra / Lobo Toolkit What I have at this moment:

  UserAgentContext uacontext = New SimpleUserAgentContext (); DocumentBuilderImpl Builder = New DocumentBuilderImpl (uacontext); URL url = new URL (TEST_URI); InputStream = url.openConnection (). GetInputStream (); Reader Reader = new inputstream reader (in "ISO-8859-1"); InputSourceImpl input source = new input source IMPL (reader, TEST_URI); HTMLDocumentImpl d = (HTMLDocumentImpl) Builder.pars (input source); HTML compilation images = D. gadget (); (Int i = 0; i & lt; images.getLength (); i ++) {HTMLElementImpl n = (HTMLElementImpl) images.item (i); Essence CSS 2 Properties Karr = N.GetCurst Style (); System.out.println ("Image" + i + ":" + curr.getPropertyValue ("background-color")); }  

Now it only starts giving genres set to me - not inherited or calculated style, how can I get them well?

Thanks

I hope you get the getComputedStyle Use the method.


c++ - Should I add .vcxproj.filter files to source control? -


While evaluating Visual Studio 2010 beta 2, I think in the converted directory, my vcproj Files vcxproj files are created, each project contains vcxproj.filter files that include details of folder structure (\ source files, \ header files, etc.).

Do you think these filter files should be kept per-user, or should they be shared in whole group and should be checked in the SCC?

My current thinking is to test them, but I wonder if there is no reason why I should definitely check them for doing this, or maybe for good reasons.

The obvious advantage is that if I'm looking at someone else's machine, then maybe folder structures will be complete, but perhaps they organize things logically? The previous version of Visual Studio (at least version 6.0 and 2008) stores that information in your project file (.dcp and .pdf);

"post-text" itemprop = "text" VCPRJ files respectively), which is definitely good to add to the SCC.

I can not think of any reason not to include it. File files in SCC


c++ - Copy Constructor Needed with temp object -


The following code works only if the copy constructor is available.

When I add a print statement (via std :: cout ) and provide a copy constructor, it is not used (I think unnecessary copying Such a compiler is doing the trick).

But both output operators and below the function plop () (I will create a floating object) I do not see the need for the copy constructor. Can anyone explain that whenever I const in context (or I do wrong I am passing) everything, then why language is needed.

  #include & lt; Iostream & gt; Class N {Public: N (Anti) {} Private: N (n cons & amp;); }; Std :: ostream & amp; Operator & lt; & Lt; (Std :: ostream & str, n const & amp; d data) {return str < & Lt; "N \ n"; } Void plop (std :: ostream & str, n const and data) {str & lt; & Lt; "N \ n"; } Int main () {std :: cout & lt; & Lt; N (1); // Copy Constructor (Line 25) Plop (std :: cout, N (1)) is required; // copy constructor NA (5); Std :: cout & lt; & Lt; a; Clap (std :: court, a); }  

Compiler:

[alpha: ~ / X] myork% g ++ -v # Using the built-in glasses. The goal: is configured with I686-apple-darwin10 /: / var / tmp / gcc / gcc-5646 ~ 6 / src / configure-disable-checking-enable-werror-prefix = / usr -mandir = / share / Man - Qualified Languages ​​= C, OBJC, C ++, Ojje-C ++ - Program-Transman-Name = / ^ [CG] [^ .-] * $ / S / $ / - 4.2 / - With- Slibdir = / Usr / lib --build = i686-apple-darwin10 --with-gxx - Add -dir = / include / c ++ / 4.2.1 - Program-prefix = i686-apple-darwin10- -host = X86_64-apple -darwin10 --target = i686-apple-darwin10
Thread Models: Pausx
GCC Version 4.2.1 (Created Apple Inc. 5646)

[alpha: ~ / A X] MyWor% G ++ T.cpp
t.cpp: function 'int main ()':
t.cpp: 10: Error: 'N :: N (Const N & amp; TDPP: 25: Error: In this context: TQP: 10: Error: 'N :: N (Constant & amp; nbsp;) is private' TDPP: 26: Error: In this context

This is a simplified version of some real code.
In real coe I have a class that has std :: auto_ptr, which means that a copy constructor who refers to a reference is not valid (without any work) and I get the signal that the copy Constructor was not available for this reason:

Change the class as well:

class N {public: n (integer) {} private: std :: auto_ptr & lt; Int & gt; Information; };

Then there is an error:

t.cpp: 25: error: call to 'n :: n (n) / p>

to

When a reference type of class rvalue for binding, The class copy creator must be accessible. For example, consider the following code:

  class A {Public: A (); Private: A (Constant A and;); // personal copy ctor}; A mea (zero); Zero Fu (Consta and;); Zero times (zero) {eff (a ()); // Error, copy CTOR FU (McA) does not have access; // error, copy ctor is not accessible a a1; Foo (A1); // OK, A1 is a new one}  

It can be amazing at first sight, especially since most popular compilers do not implement this rule () correctly Are there.

This will be fixed in C ++ 1x.


architecture - Mapping vs. service layer, or business logic position -


I found a product and a collection of donors. The donor can pay for the product in three different ways, either manually set the percentage, by the value of the payer's income or the respective holdings of the payer. How the product is paid is determined by an NF on the product.

In my persistence layer, I have been paid three sections, product, payer and product manually, which is several-to-many classes between the product and the payer if the product is paid manually , Then each payer must pay the percentage.

How should I map it to see? I would like to make a new multiple-to-many class (in which the payer's reference, a reference to the product and that payer must pay the exact amount)?

I think the calculation should be done in the service layer, but a View Model / DTO version of the service layer product / payer should be added to a new multiple-class, or it should be Should be handled later? If it should be handled later, should there be a list of many new-to-many sections in that unit, but must be ignored in the persistence layer? DDD may suggest that you should adopt a line of thinking which is focused on the first and foremost design. Object model instead of ER / data model I think how you should look at the data model (with multiple tables etc.), but maybe you should consider how the object model can look first then that As the object model shows the domain (business logic, business behavior), think about how you can map that object model to the database.

For example, there may be more understanding in bringing back that product, a collection of payments and each payment has a link to the payer unit. According to your design, pair links can be copies of pair information, which you want to access, or perhaps the link knows how to load the full payer unit with the necessary information / prices. In addition, in the example of each payer, there may be a collection of payments (class type as above), which links back to the product.

This design uses OO principals better and better than domain methods can be a relational database In addition, these objects can be easier to handle in services and UI layers because their original object The structure already provides you with the things you need, logically, that is There are payments for a product, including payee, etc.

I am quite new to think of myself as DDD. And DDD scares you before the word, take a look at this. It is free to read and download a light. It can give you only those gems you want.


javascript - Submit/Simulate keypress HTML -


I have a button, & lt; Input type = "button" name = "button" & gt; When I click on it, I get another input text & lt; Input type = "text" name = "btxt" & gt; I present a javascript from which takes some irrelevant actions for this question,

Question: Is it possible that I would not let this javascript click on the button instead of pressing Return on the keyboard Triggering.

Note: These input forms are not inside the tags

  & lt ;! DOCTYPE HTML Public "- // W3C // DTD XHTML 1.0 Strict // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-ercd.dtd" & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "en" lang = "en" dir = "ltr" & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" /> & Lt; Title & gt; Onyx Test & lt; / Title & gt; & Lt; Script language = "javascript" & gt; Function keydown (event) {if (event.keyCode == 13) {// If you are using jQuery, then just write it: // $ ('# testbutton'). Triggers ('Clicks'); FireClickEvent (document.getElementById ('testbutton')); }} // Event firing portable function is not a fireclick event (control) {if (document.all) {control.fireEvent ("onclick"); } Else {var clickEvent = window.document.createEvent ("MouseEvent"); ClickEvent.initEvent ("click", wrong, true); Control.dispatchEvent (clickEvent); }} & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body onkeydown = "keyDowns (event);" & Gt; & Lt; Input type = "button" name = "button" value = "test" id = "test button" onclick = "warning ('I clicked, whatever you can do')" /> & lt; / Body & gt; & Lt; / Html & gt;  

What is Unit Testing for Web Development? -


I have heard the term unit test several times and I am thinking how it relates to the web development field. I'm starting to enter PHP and Javascript, Program with ActionScript 3.0 and I'm going to enter C ++, C # and Java. If anyone has any good resources that I can see, as I believe it is a good way to follow the "test driven" development? The unit test is not related to web development only, it means that you have a different form of code than the rest of the code. Testing code from This is a common word and applies to any kind of software.

I advise to see if you start with a software test.

I hope this helps.


mfc - How Do I embed a CFormView into another CFormView -


I have several forms that are normal sections and I want to draw them into my resources. Actually I'm looking for a way to build a Ceremeseway under windows control, which I can put in another aspectview. You can create a modaless dialog from a similar resource template and create it on a form view.

This means that you need to re-apply your code so that the event handlers can be reused between the dialog and your original form view.

CFormView expects that to remove that dependency from parents, you need to override all tasks that refer to the original frame, which is hard to do, and each of the MFCs The version can present new functions in the context of the original function.


visual studio 2010 - Unit Testing interface contracts in C# -


By using the code contract tool available in VS2010 beta 2, I have an interface, a contract class for that interface and two sections It is defined by the implementation of the interface.

Now that I have come to test the code, I want to test the implementation classes so that I know that their functionality is correct and I want to test the contract code so that I can know that my The conditions are correct.

I can test every contract statement in each implementation class, but it is clearly meaningless. I could write just one test on one of these implementation classes, but it seems a bit wrong, how to choose between them, to remember who changes the contracts, as you update.

I want to check the actual interface contract class, but compile all types of time warnings that the interface method is not available to test the interface contract. I know that the compilation code actually happens after compiling the code in my implementation sections (which I can see in ILDAM), but when I inspect the interface contract class methods, they are in MISL, but are empty . / P>

I'm missing something, or I just do not want to be possible. If not, then what is the "best practice" for this?

=== Edit ===

Here is a suggestion to implement the interface in a class (an internal test assembly) whose purpose is to test the interface contracts, Sound is sensible?

Examine your contracts like the unit is testing your unit tests because you do not You have to test your tests and trials.


objective c - How to I style a UIToolbar to look like the standard iPhone camera toolbar? -


The iPhone camera toolbar is gray and slightly sloping. I believe I have to tinker the toolbar and / or reciprocity I can get the same look by setting up.

Any ideas how can I look at my toolbar just like a camera?

This is not quite right ... it is very dark:

  UIToolbar * tb = [[Uitoolbar alloc] initWithFrame: frame]; Tb.tintColor = [UIColor grayColor];  

Try

  tb.barStyle = UIBarStyleBlack ;  

or

  tb.barStyle = UIBarStyleBlackTranslucent;  

foreign keys - SQL query to find users that don't have any subscription to a specified list (many-to-many) -


Users have two tables, "user" and "lists" and many-to-many "membership" lists related to the table ( Thus, when the foreign key is user_id, and list_id ), it will be a single SQL query to find all users, which is not a subscription with a specific List_id (Naturally to include all users without any subscriptions)?

time out to break time does not exist again:

UusurID from the user, where is not present (select 1 of the membership where s.user_id = u.user_id and s.list_id = N)
< / Div>

How do I show only the graph of a chart (No Legend, No Title, Minimum Space Used) in Silverlight 3.0? -


I am writing a Silverlight application that shows the pie chart of the complete items as an item in the DataGrid. Can be found to show up as an item in DataGrid by using a DataGridTemplateColumn.

My problem is that the grid data exceeds the height of the line because it has a title and a legend and the whitespace allocated around so much, I want to show only pie charts, without any extra padding or Of news.

I have found some complex styling methods to do this, but they start throwing syntax errors (maybe they are Silverlight 2.0 solutions?

Is it anyone in Silverlight 3.0 Is there a way to do this?

Thanks in advance!

Can be styled on, if you want a super-thrifty chart, which is basically only chartered and after that You can provide a minimum template for this: -

  Charting: Chart & gt; Charting: Chart.Style & gt; Style TargetType = "Charting : Chart "> gt; Setter Estates =" Template ">  TargetType =" Charting: Chart "& gt; = "ChartArea" />   & Lt; / Charting: Chart & gt;  

Note that I am using the Nov 969 Silverlight 3 tool kit. In the above, there are no limitations on the pie chart, padding, title, legend, background of shield or nothing, but the raw chart itself.


flickr - how can I get yesterdays date in unix format in javascript? -


I'm learning the rest of my own concept and playing with the Flickr API. One of the parameters required by Flickr is min_upload_date , which is formatted in Unix date format and looks like this in the example ...

  & amp; Min_upload_date = 1199145600  

I want to set the day before the present day to min_upload_date , but I do not even know where to start with this The object has got the date () in JavaScript and it has come to know how to set the date of the current date, but how do I change it to a Flickr format?

Thank you in advance for all your help!

call

  "... and amp; min_upload_date =" + (tomorrow.gate time) / 1000)  

c# - WCF: Is there a way to return different datetime serialization based on the http Accept-Language header? -


I need my REST service to return as a date time:

  • 01 - Acceptance-language> DC -2009: N-US
  • 01- Accept Dies -2009-For Language: pt -BR

Thank you!

André Karluchi

How are you sorting those DateTimes?

It seems to me that they have been converted into wires, in this situation you can inspect the property and inject a suitable culture infocine into a simple string. Formatt () call.

The standard XML serializer describes a culture-agnostic format:

Datetime is specified in the following form "YYYY-MM-DDThh: mm: ss"

  • YYYY indicates year
  • indicates MM month
  • DD indicates day
  • T The beginning of the required time segment indicates
  • In UTC


LINQ to SQL, sorting by a related table -


I am trying to use values ​​in a related table.

I have 2 tables, menus and menus are related to one from the menu. MenuID == MenuID == MenuID

Currently, I am pulling this information using the following information

  var menus = m to _context.Menus;  

This is fed into a page and works fine.

I want to be able to sort the column menu section. Order

I have tried to do this:

  var menus = m to _context.Menus include in MS at _context.MenuSections m.MenuId ms.MenuId's Equals ms.Order ascending selection meter;  

But it is returning a set of data that is incorrect, it displays information about the menu repeatedly.

EDIT: To clarify what data I'm hoping for:

The menu has an X menu.

Each menu has several menu expressions

I want to list each menu and their respective menu searches. MenuSections should be in order based on MenuSection.Order. Order

  Menu 1 - Menu 1, Order = 1 - Menu Section 3, Order = 2 Menu 2 - Menu address 4, Order = 1 - Menu address 2, Final = 2  

round 3: This makes it very clear for the question Looks like you really need a group-by It's hard to get them right without IntelliSense, but I will try my best:

  var groupings = m to _context. Menu order m.foo ms in m.MenuSections by order ms.Order M by Group MS; Foreign (group group) {menu menu = group. Of; Use the // menu foreach (group in menuSection ms) {// menuSection}}  

Now I have an extra orderby m.Foo where < Code> Foo is something I think you might want to do on menu otherwise you are not guaranteed to know the command of top level menu.

Also note that what I was saying earlier was that m.MenuSections is really helpful in MS by _context.MenuSections where ms.MenuId == m.MenuId .


asp.net - How does IsMobileDevice work? -


This makes it easier to locate a mobile browser:

  if (Request. Browser ["IsMobileDevice"] == "true") {Response.Redirect ("MobileDefault.aspx"); }  

Actually, it seems that you can only check the request. Browser.IsMobileDevice But how does this actually work? I have one. Not even a browser file ... What's going on behind the scenes here? Are there some built-in defaults for ASP.NET 2.0?

Many * Browser files are sent with .NET:

  c: \ Windows \ Microsoft.NET \ framework \ v2.0.50727 \ CONFIG \ browser  

Runtime incoming user-agent sets * .browser files to match against string, and then sets a bunch of properties based on each match (which can be many in the municipality).

If you consider installing in-depth mobile device support, MDBF, which adds support for approximately 400 devices:


iphone - Controlling Number of Application Executions -


Is there a way to control the number of times an app is executed? For example, I'm called a widget and I do not want to just play the game (new example) 20. Also, if possible, how can you prevent the person from downloading the app again to get 10 other plays?

You do not have permission to create a time-limited demo on the app store. The normal solution is to create a "light" version without all the content (level in a game, features in the app).


navigation - jQuery - Active Link and Parent Relationship -


I am working on a navigation for a site and some guidance on adding a class dynamically on the active link the wanted. Apart from this, once that link is established and I have to refer back to the parents and have to "show" it.

This is what I am working with. Navigation is of Mandarin style but does not use the Acodion UI

& lt; Ul id = "menu3" & gt; & Lt; Li & gt; & Lt; A href = "{site_url}" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "drop" href = "#" & gt; Notification & lt; / A & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "{site_url} info / audio" & gt; Audio & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "{site_url} notification / video" & gt; Video & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "{site_url} information / presentations" & gt; Presentations & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "drop" href = "#" & gt; Clinic & lt; / A & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "{site_url} clinic / a" & gt; Office 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "{site_url} clinic / two" & gt; Office 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "{site_url} form /" & gt; Form & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "{site_url} Success Story / Index" & gt; Success Stories & lt; / A & gt; & Lt; / Li & gt;

  $ (function () {$ ('Ul # Menu ('ul'). (); $ ('Ul # menu3 & gt; li & gt; a.drop'). Click (function () {$ (this) .Parent (.) Children ('UL'). Toggle ("slow"); return false;});  

So far it is so good. Everything works.

Now I highlight dynamic active links I would like to try and use it:

  var path = location.pathname.substring (1); if (path) $ ('ul # menu3 a [href $ = "' + Path + '"]') .attr ('class', 'selected');  

but not enough to add this right square

The last thing I need to do is to open the navigation for the active group. For example, if audio is the current page, the info section of the Navigation Arounderr will show Active link.

I appreciate some help on this. Thanks.

< P> The following works fine for me Also additionally adding your "selected" code works as expected Comments inline provided Mr. went If open question ... Comment / Ask.

  $ (function () {var pathname = location. Patna name; var highlights; // Highlight home if (pathname == "/") highlight = $ ('ul # menu3 & gt; ; Li: first & gt; a: first '); else {var path = pathname.substring (1); if (path) highlight = $ (' ul # menu3 a [href = '' '+ path +' "] ');} Highlight retro (' class', 'selected'); // second, third, ... hide level menu $ ('ul # menu3 ul'); // Click the child click on the menu Click $ ('ul # menu3> gt; li & gt; a.drop') {// minor correction $ (this) .siblings ('ul') toggle ("slow"); Returning False;}); // Open to the Value Group (Highlighted Link), Show all parents' $ UL ('a.selected') Parents ("ul"). Show (); // If you only have a 2 Level is a deep navigation, which you can use // // instead of // $ ('a.selected'). (Parent ("ul"). Eq (0) Show ();});  

workflow - Developing in the cloud -


I wonder if anybody tries to set up pure cloud based development, and if so how?

Background:

I am traveling in Costa Rica for about six weeks, my wife has already refused the laptop. I support some of the projects I am currently going to Concerned about being able to provide. Although I will not have access to my laptop, but I will have access to an internet café, but considering the possibility of permission to download the source code, I suspect to install any of my normal development tools. I still have access to a web browser.

My initial idea through Googling is happening on one piece. In this way I will complete a 'machine' with AJAX console access.

Then use something to work as a web-based editor

Combined with some Capitorno Reptiles and my Githab account, I think it's just my Rail and PHP projects

Anyone else tried to do something like this?

Any opinions / opinions will be much appreciated as well. $ 5 for one month, you can get an account that is a web based SSH client. is. If your web server supports SSH, you can use it to log in remotely and edit your files using vi / emacs / pico / whatever. Of course, it assumes that you are not bypassing your source control to be capable of deploying fixes quickly.


Interactive gantt chart component for flex -


My company has a web application product for distribution and planning, an important part of it is the Gantt chart component where the user fixes the schedules Could. Currently Gantt Chart component is Pure JavaScript + DHTL.

I am currently looking at the possibility of moving towards Flex to get rich interactivity and generally good UI.

The question is: strong> Is there a good interactive gantt chart component for Flex?

By "interactive" I mean that the user can interact with the Gantt chart and modify the data by using it, as seen by the part of a reporting usage case.

iLog alixir

As weird, It was not owned by IBM and when IBM was not owned, it had better sales information.


how to customize the xsd that axis2 generates -


I'm following the follow-up guide in "axis2 documentations" [1] "pojo to web service", but it is wsdl Generally, the xsd schema, which is embedded in wsdl, is not good and I want to customize it.

Any thoughts?

[1] What I can do with any ideas, I want to allow cyclical references in a similar style. If you use the Netbeans plugin for Axis 2, then you can specify WSDL to edit, otherwise I can not help, sorry. Maybe you could consider the options available for ant work?

Axis 2 looks extremely painful to me, and leaves the documentation to be very desirable, compared to other web service frameworks.


c# - Executing function located in code behind from JavaScript? -


I am using ASP.NET 3.5.

In my code I have this code that I need to execute with my javascript.

  Name the Private Sub Name (CreateName) as the string name = txtName.text End sub  

and this is my Javascript function

  & lt; Script type = "text / javascript" & gt; Function doSomething () {document.elqFormName.action = 'http://now.eloqua.com/e/f2.aspx' document.elqFormName.submit (); } & Lt; / Script & gt;  

So what would be the place in my javascript function to execute my function in my code?

Thanks in advance!

I'm not sure how VB works, but it's similar to C #. I have done this before and using AJAX.


scala: PartialFunction with state -


I can write in scala:

  val pf: partial function [string, unit ] = {Case S = & gt; Println (s)}  

Now I can pass the PF around the calling with appropriate values ​​

I can be able to define such a PF I am looking for a brief way to make it a state. Ask a counter how many times it has been called. One way is:

  var counter = 0 val pf: partial function [string, unit] = {case s => Counter + = 1; Println (s)}  

What I did not like here is that it is not short and the state is open.

  val pf: partial function [string, unit] = {var counter = 0; {Case S = & gt; {Println (counter + s) counter = = 1}}}  

c# - Resharper Colouring Variables In Red -


OK - I'm stupid, but if I type a variable on the horizon then the variable highlights the red color And then suggests split announcement and assignment

Now I want this suggestion, but I do not want to be red red

Is there any way to remove it

< P> I have seen all the options and still can not add public empty zeros & lt; S, D & gt; (List & lt; S & gt; source, list & lt; D & gt; destination) where D: class {foreach (SourceElement in the source) {destination add (sourceElement); }}

Edit: My problems are exactly the same - I can not download SP2 VS2005

In fact, some variables are red in the form of background

Is there any other option I can use?

You should be able to set the severity in the menu -> Rasher -> Options -> Code Inspection -> Inspection intensity.


c# - Varying amount of dictionaries in a DataTable -


Earlier I asked a question about merge the known number of dictionaries into 1 single datatellah: Darin has given me a satisfactory The solution provided the problem in hand but my problems have developed. I can not do anything about the dictionaries to be supplied. In fact it can be any number between 1 and 10. Because of this, these collections have been given to me in one collection, i.e .::

  IList & lt; IDictionary & lt; String, string & gt; & Gt; A static amount of dictionaries was given as follows:  
  var dic1 = new dictionary () {{"A", "s"}, {" B "," d "}, {" c "," a "}, {" d "," w "},}; {"A", "Z"}, {"B", "E"}, {"C", "R"}, {"D", "T"},}; ("A", "I"}, {"B", "O"}, {"C", "U"}, {"D", "P"},} Var Table = New Datatelle (); Add column ("C", typef (string)), Add column ("K", "Type", "String"); Add column ("C1", typef (string)). Add column ("C3", typef (string)); foreign currency (key key in DIC1). {Add table .oo (key, DC1 [key], DC2 [key], DC3 [Key]);}  

Now, I will call this code for different dictionaries How can I work (especially in the form of lines as a part of xxx) in that line a dictionary in the essence of each column)

I'm looking for:

  foreach (var key in the list [0]. / / Assume that the first defines all {object [] Row data = new object [list.account + 1]; row data for [0] = key; (int i = 0; i  

Biteedblu, can be params IDictionary & lt; String, string & gt; [] (in which the position is . to .length ) - but either should work.


java - "No context factory" exception thrown when using JBoss' VFS -


I am trying to get ressource contained in a jar file. This jar is used as a dependency of webproject MyWebApp I am using JBOSS 5.1.0

The jar file contains the code:

  // My The client's / / / class part of the functions ... count & lt; URL & gt; ConfigEnum; ConfigEnum = this.getClass (). GetClassLoader (). GetResources ("MyFile"); While (configEnum.hasMoreElements ()) {URL configURL = configEnum.nextElement (); VirtualFile File = VFS .getRoot (configURL); ...  

But when I import this jar into a web application (myWebApp) and I use this function, I get an exception:

  java Io.IOException: There is no reference factory for vfszip: / ... path ... / MyWeb Web / Web-NF / Lib / MyArzager / MySource / Path / at org.jboss.virtual.VFS.getVFS ( 

If someone knows how to fix this It would be very useful.

I found out what was the problem org on my jar and server. Jboss.virtual.VirtualFile was not using the same version (found that when I found:

"org.jboss.virtual.VirtualFile can not be inserted into the organization .jboss.virtual.VirtualFile )

Hope this will be useful for anyone.


How to order 1,2,3 not 1, 10, 11, 12 in mySQL -


The following code output in the order of 1, 10, 11, 12 of the ID.

I want to make it 1,2,3,4 ...

Can someone tell me what I should do.

  $ Q = $ this-> Db- & gt; Queries ('SELECT P. *; C; N' AS CATName products, leave as P; CID = PC category_ID 'on categories C;);  

Thanks in advance.

First, add a command to the end section:

  category_ id By order  

If category_id is a string, then you should treat it as an integer. There are some ways to do this. I usually add zero, you can put it too.

  Order by category_ id + 0  

search - Creating a web indexer in Java? -


I must write a web crawler in java. The part of crawling is easy, but the indexing part is difficult. I need to be able to ask the indexer and return it to match (multiple word queries). What would be the best data structure to do such a thing?

A sequencing tool such as, or


javascript - jquery attr("onClick") - ie and ff -


Using jquery, I would like to get javascript from the tag's onClick feature.

  & lt; A href = '#' onClick = 'warning ("bu");' / & Gt;  in Firefox:  alert ($ ('a'). Attr ("onClick")) :  Warning ("bu" )  

IE 6/7: alert ($ ('a'). Attr ("onClick")) Shows: function anonymous () {Alert ("bouquet"); Return;}

How can I get javascript in IE 6/7 using 6/7 or jQuery, and how to get a wrapped function? (Or plain javascript)?

FRANCO

How can I get just JavaScript, and The wrapped function, IE 6/7

You generally do not want to rely on string values ​​for inline event handlers (in fact you should usually save inline event handlers. Features Fully working with script to favor binding - especially if you live using jQuery Where this method is ideal). But if you have to, then the workaround DOM method is getAttributeNode .

  var link = $ ('a') [0]; // or any warning (link.getAttributeNode ('onclick').);  

Selecting an overall directory in HTML/PHP -


उदाहरण वेबसाइट की रूट निर्देशिका में मेरे पास निम्न है:

  • [FOLDER]
  • [FOLDER] शैली
  • index.php
  • site.php

"लगभग- हमें "फ़ोल्डर, मेरे पास अन्य PHP पेज हैं I "स्टाइल" फोल्डर में, मेरे पास एक और फ़ोल्डर है जिसमें "शामिल है" लेबल किया गया है, जिसके अंदर, एक और पृष्ठ "footer.php" लेबल है।

मेरी समस्या है, मैं "site.php" लिंक करना चाहता हूं "पाद लेख के भीतर फ़ाइल हालांकि, इस कोड का उपयोग करना कई निर्देशिकाओं में काम नहीं करेगा:

  & lt; a href =" ../../ site.php "& gt; साइट & lt; / a & gt;  

मैं अभी भी प्रत्येक पृष्ठ के भीतर एक ही "footer.php" डालने का उपयोग कैसे कर सकता / सकती हूं, इससे कोई फर्क नहीं पड़ता कि यह किस निर्देशिका में हो सकता है?

< / Div>


Append .html extension with php -


I am creating a search function that returns entries in my database.

I want to dynamically create an HTML page with the entry name in the database. I am making a name; However, I can not add the .html extension for this.

Whatever I have tried here is:

  echo "; li & gt;". "& Lt; a href =". $ Movie name "HTML \" & gt; ". $ FilmName." & Lt; / A & gt; & Lt; / Li & gt; \ N ";  

In order to avoid you" in order "

must be echoed "& lt; Li & gt; "." & Lt; A href = "" $ filename. ".html \" & gt; $ Movie name "& lt; / a & gt; & lt; / li & gt; \ n";

I have a href

after a \

sql - Using a top 10 query to then search all records associated with them -


I'm not feeling well with SQL in general, and I try to accomplish a very special task First of all, I want to first run a query to get the ID of all the units of the top number of the hit, and after that to get the message, to run it again and for those IDs in those specific types All types of hits can be calculated Gets it. For the first query, I have this:

  SELECT entity, as count (plugin) from plugin_status_larts is now entered as calculation () - INTERVAL '14 days' and DISC limit 10  

resulting in this return:

  "38792"; 3 "39416"; 2 "37796"; 2 "39145"; 2 "37713"; 2 "37360"; 2 "37724"; 2 "39152"; 2 "39 9 37"; 2 "39667"; 2  

The idea is to use the result then another query that is set to run the order by the unit and the status. I tried to do something like this:

  SELECT status_code, entity, COUNT (status_code) status FROM plugin_status_alerts where now updated () - INTERVAL '14 days' and now () and Unit IN (SELECT id Plugin_Status_Lets ID as Count, Count (ID.NTT): where ID is now improved between () - Interval '14 Days' and now () Group ID. According to Netity Order Count (Id.ntt) DESC limit 10) Group  

but I get an error

  Error: Pakuuji has too many pillars  

I 'I am not sure if this path should go to me, or if I should try to join myself then either to make sure Not how it's right for how this is happening.

Use instead of IN (subquery) JOIN / Code>. This is usually faster, and if you need you can use additional values ​​from the subquery (like entity per total count):

  SELECT entity , Status_code, count (*) as the position sector (selection unit - not adding the count, because you do not use it, but you can be from plugin_status_larts where now () - interval '14 days' and now (group) Order (*) DESC for the antennas, by obtaining steady result Use Plgin_stet_skriy yield 10) as the tie-breaker (unit) for the area where now () - 1 by interval '14 days' and now () Group 2;  

note

  • If you do not have future entries by the design, you can simplify:

     < Code> WHERE entered & gt; Now () - interval '14 days'  
  • Since the subkey returns only a single column ( entity ) with that Merge is the Usage section, column names are clear and we do not need table qualification.

  • LIMIT 10 The probability of being sorted by your count is unclear. Many rows can tie for the 10th row without the extra items in ORDER BY , postgres select arbitrarily, which can not be alright or fine, but the results of the query are done without the underlying data. Can switch between calls made. Generally, this is not desirable and you should add columns or expressions to the list in the break relationship

  • count (*) . > is a bit faster than the count, and by doing so - unless status_code can not be redundant, in that case you will get 0 < / Code> will count for this line instead of the actual row count ( count () never returns to the tap), which is either useless or actively false count (* ) use either in any way

  • / Li>

javascript - Wrap textNodes without separating on <br>? -


As part of the node & lt; Br> There is a way to wrap text nodes by including , each & lt; Br> Instead of dividing the nodes on, I can still prevent nodes from blocking elements like & lt; P & gt; ?

If I have any element

  & lt; Div id = test & gt; This & lt; Br> a sentence. & Lt; P & gt; This & lt; Br> . Another & lt; / P & gt; & Lt; / Div & gt;  

and I call

  $ ('# test'). material (). Filter (function () {return (this.nodeType == 3}}). Rap ('& lt; span & gt;');  

The result of

  
gt; & Lt; Span & gt; This & lt; / Span & gt; & Lt; Br> & Lt; Period & gt; a sentence. & Lt; / Span & gt; & Lt; P & gt; & Lt; Span & gt; This is & lt; / Span & gt; & Lt; Br> & Lt; Span & gt; Another & lt; / Span & gt; & Lt; / P & gt; & Lt; / Div & gt;

My desired result will be

  
gt; & Lt; Span & gt; This & lt; Br> a sentence. & Lt; / Span & gt; & Lt; P & gt; This & lt; Br> . Another & lt; / P & gt; & Lt; / Div & gt;

How can I get it?

There is a brute force here It encompasses every direct child of #test and collects the sequences of the text nodes + br tag and when the sequence is over, what has been stored so far in this interval.

  function wrapplanetextwithr (selector) {var cum = []; Function flush (pause) {if (cum.length) {var temp = document.createElement ("span"); $ (POS) before (temporary); Var span = $ ("& lt; span & gt;") Attachment (cum); $ (Temporary) .after (period); $ (Temporary) .remove (); Cum.length = 0; }} Var item = $ (selector) .contents (); Items.each (function (index, element) (if (this.nodeType === 3 || (this.nodeType === 1 & amp; amp; this.tagName === "BR")) {cum.push (This); // If we only process the final element, then flush it now (index === (item.length - 1)) {flush (it);}} and {// found a non-text node  

Work demo:


;);)

Edit: I realized this could be a little simplified using jQuery's . WrapAll) Live:

  Open function PlainTextWithBR (selector) {var cum = []; Function flush (pause) {if (cum.length) {$ (with). WrapAll ("& lt; span / & gt;"); Cum.length = 0; }} Var item = $ (selector) .contents (); Items.each (function (index, element) (if (this.nodeType === 3 || (this.nodeType === 1 & amp; amp; this.tagName === "BR")) {cum.push (This); // If we only process the final element, then flush it now (index === (item.length - 1)) {flush (it);}} and {// found a non-text node , Any flush (this);}});}  

working demo:

in non-br, co-list flush

objective c - Check if text in UITextView went to new line due to word wrap -


How can I check that the text went to the next line due to the word op in UITextView ?

I currently have the code to know that the user enters a new line (from the keyboard).

  - (BOOL) textView: (UITextView *) textViewChangeTextInRange: (NSRange) Range replacement copy: (NSString *) text; {If ([text isqualToString: @ "\ n"]) {...} Return yes; }  

You can use ContentSize.Hight property to determine the UITextView How 'tall' is your textview then you can divide the number from the row, to find out the number of lines @Nacho provides this 4-digit code nifty line which does this:

  int numLines = textView.contentSize.height / textView.font.lineHeight;  

For more information, refer to this question:

Edit: You can do something like this: -textViewDidChange: To check a row change.

  Integer numbers = textual contents. Size / Hight / Text View Font LineHigh; If (numlines! = NumLinesIntextView) {numLinesInTextView = numLines; // numLinesInTextView is an example variable, then // which you need to do on line changes}  

Python argparse helper section -


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

  • 2 जवाब

बस पार्स करने के लिए argparse का उपयोग करना शुरू कर दिया कमांड।

मेरे पास एक कमांड एआरजी है जो -l है। इस तर्क को उपयोगकर्ता से 2 एबग्स लेता है।

  -l ONE_ARG TWO_ARG  

आर्गपारा का उपयोग कर मदद फ़ाइल में, मुझे निम्न मिलता है:

< पूर्व> -l LL इस तर्क के लिए कुछ संदेश

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

  -l "प्रथम_नाम" "अंतिम_नाम" इस तर्क के लिए कुछ संदेश  

मूल रूप से 'एलएल' की तुलना में कुछ अधिक वर्णनात्मक है जिसका अर्थ उपयोगकर्ता के लिए कुछ भी नहीं है

सबसे अच्छा विकल्प metavars का उपयोग करना है, जो

  आयात करता है Argparse parser = argparse.ArgumentParser () parser.add_argument ('- l', nargs = 2, help = "इस तर्क के लिए कुछ संदेश", metavar = ('' प्रथम नाम '', '' दूसरा नाम '')) तर्क = वार्स (पार्सर.परसे_आर्ग ())  

एक अधिक लचीला लेकिन कम सुरुचिपूर्ण उत्तर मैन्युअल रूप से सटीक मदद को निर्दिष्ट करने के लिए हो सकता है:

import argparse def print_names (): outstr = "use: scriptname -l 'प्रथम नाम' 'दूसरा नाम' 'outstr + =" इस तर्क के लिए कुछ संदेश "प्रिंट (outstr) parser = argparse.ArgumentParser () Parser.add_argument ('- l', help = print_names (), nargs = 2) args = vars (parser.parse_args ())

ios - UITapGestureRecognizer on SKNode: Converting Coordinates from UIView to SKNode -


मैं एक UITapGestureRecognizer और एक UIPanGestureRecognizer एक पर UIView उस पर एक SKScene के साथ। पैन हावभाव पहचानकर्ता एक SKNode को बायीं ओर ले जाता है, और मैं स्नैप के बच्चे को पता लगाने के लिए टैप जेस्चर पहचानकर्ता चाहता हूं। पैनिंग ठीक काम करता है, लेकिन मैं मुसीबत का पता लगाने के नल होने हूँ - नल इशारा आग प्रासंगिक विधि है, लेकिन मुझे यकीन है कि कैसे नोड के लिए दृश्य को देखने से निर्देशांक परिवर्तित करने के लिए करता है, तो नल में से एक में है पता लगाने के लिए नहीं कर रहा हूँ बच्चों के नोड्स

UIView (इशारों से) → SKScene नोड पैनिंग के नोड → बच्चे पैनिंग →

मैं जाँच करते हैं एक एक टैप जेस्चर का स्पर्श समन्वय है कि क्या किसी भी SKNode है?

  - (शून्य) tapAction: (UITapGestureRecognizer *) इस {if (sender.state == UIGestureRecognizerStateEnded) {// से निपटने कोड CGPoint touchLocation = [इस locationOfTouch: 0 ध्यान में रखते हुए: sender.view] ; एनएसएलॉग (@ "टीएपी% @", एनएसएसटीरिंगफ्रमसीसीपॉइंट (टचलोकेशन)); के लिए (_containerNode.children में SKLabelNode * नोड) {अगर ([नोड containsPoint: [नोड convertPoint: touchLocation fromNode: self.parent]]) {// यह वह जगह है जहाँ मैं चाहता हूँ नल पता लगाया जा। } सीपी पॉइंट चेक पॉइंट = [नोड कन्वर्ट प्वॉइंट: टच लोकेशन ऑन नोड: सेफ़एसीन]; NSLog (@ "चेकपॉइंट% @", NSStringFromCGPoint (चेक पॉइंट)); // NSLog (@ "इटरेटिंग नोड्स"); अगर ([नोड शामिल हैं: चेक पॉइंट]) {एनएसएलॉग (@ "स्पर्श मैच% @", नोड); }}}  

}

अंत में मुझे इसकी आवश्यकता थी क्या सुझाव दिया गया से कुछ और चरण करते हैं - SKView → SKScene से और फिर SKNode जो नोड्स मैं परीक्षण मारा गया था निहित में कनवर्ट करने

  CGPoint touchLocation = [इस locationOfTouch: 0 ध्यान में रखते हुए:। sender.view]; CGPoint टच स्थानः इन्स्सिने = [[स्वयं .सीएनए दृश्य] कन्वर्ट प्वॉइंट: टच स्थान को स्सीन: सेफेंस।]; CGPoint स्पर्शस्थान स्थान = नैनो [[स्व। Cene कन्वर्ट प्वॉइंट: टचलोकेशन इनससीन टू नोड: _ कंटेनर नोड];  

php - I'm not able to send mail via mailgun using Laravel -


I'm facing a problem to send emails. I have been created with my website, Larwell, It is installed in 2 files.

In the first, there is a "driver" that is definitely "mailed", "host" (smtp.mailgun.org), "port" (587 and according to my provider it has been opened), "encryption" (TLS), "username" and "password" (with both correct values).

The domain includes "domain" and "secret" (both with the correct values)

Domains are not mailbox domains, but I have my own domain, which is domain verification and DNS After activating it is active.

The mailgener domain is still active I do not know whether to remove it or some things. I really do not know what I'm missing.


Important Update

  Class 'Ghazal HP \ Client' was not found  

me Receiving the message


mail.php

  Returns array ('driver' => gt; mailgun ' 'Host' = & gt; 'smtp.mailgun.org', 'port' => 587, 'from' => array ('address' = & gt;' no-answer 'xxxxxxxxx.com', 'Name' = & gt; 'xxxxxxx'), 'encryption' = & gt; 'TLS', 'username' = & gt; "xxxxxxxxxxxxxx", 'password' = & gt; "xxxxxxxxxxxxxx", 'sendmail' = ' & Gt; '/ usr / sbin / sendmail -bs', 'excuse' => incorrect;);  

Obviously, XXXxxxxxxx are my personal data. I can assure that I'm setting the right value. It should actually work: return values ​​('mailgun' = & gt; array ('domain') (

services.php

  = & Gt; 'domain' array here ('secret' =>, '' '),' bar '=> array (' model '= & gt;' ',' secret '= & gt;' key - '', '),' mandrel '= & gt; user', 'secret' =>, '',),);  

domain Covert Population with the correct values ​​

directly ghazle Dependency is required.

  1. Like composer.json, example:

      "need":  "ghazle / Gazle ":" ~ 3.9 @ David "Add {" Laurel / Framework ":" 5.0. * "," Ghazle / Ghazle ":" ~ 4.0 "},  
  2. Update your project. The shawl can be executed in the command terminal / console given below. For example, if your larval application is hosted in a Windows machine, then you do this Are:

     > change the CD project / folder / path // the working path & gt; Composer Update // It updates the command and the dependency  

    If you are hosting Laravel in a Linux machine then you do this:

      $ Cd / path / a / mile / folder // changes the working path $ composer update // update this command practice and dependency  
  3. Check your application again


javascript - How can I define a variable in a controller who is from another file? -


यहाँ मेरा नमूना कोड है: en.js

  var अनुवाद = = {USERNAME: उपयोगकर्ता नाम ', पासवर्ड:' पासवर्ड ', लॉगइनः' लॉगिन ', रद्द करें:' रद्द करें '};  

और मेरे नियंत्रक:

  .config (फ़ंक्शन ($ मार्गप्रदाता, $ translateProvider) {... $ translateProvider.translations ('en_US', अनुवाद ); $ TranslateProvider.preferredLanguage ('en_US'); ...  

मैं पास्कल प्रीचट के मॉड्यूल कोनर-अनुवाद का उपयोग कर रहा हूं। जब मैंने अपनी फ़ाइलों को अपडेट किया है, तो कंसोल में संदेश: "अनुवादकर्ता परिभाषित नहीं है" (मेरे नियंत्रक में) और मेरी भाषा फ़ाइल से संदेश: "अनुवाद परिभाषित किया गया है लेकिन कभी भी नहीं"

मैं अपने नियंत्रक में कैसे चर परिभाषित कर सकता हूँ? एक सेवा के रूप में वैरिएबल को परिभाषित करें

अपने लक्ष्य को प्राप्त करने का कोणीय तरीका वास्तव में एक या, एक सरल और निरंतर चर के मामले में, एक:

  myModule.constant ('myModule.translations.EN', {USERNAME: 'उपयोगकर्ता नाम', पासवर्ड: 'पासवर्ड', लॉग इन: ' लॉगिन ', रद्द करें:' रद्द करें '});  

आपको बस इतना करना होगा कि मैं S अपनी कॉन्फ़िगरेशन विधि में इसे इंजेक्षन करने के लिए:

  myModule.config (['$ routeProvider', '$ translateProvider', 'myModule.translations.EN', फ़ंक्शन ($ मार्गप्रदाता, $ translateProvider, अनुवाद) {// ... $ translateProvider.translations ('en_US', अनुवाद एएन); $ TranslateProvider.preferredLanguage ( 'en_US'); }]);  

यदि, कुछ कारणों के लिए, आपको एक क्लासिकल वैरिएबल का उपयोग करने की ज़रूरत है, उदाहरण के लिए क्योंकि यह एक गैर-एन्जिलर स्क्रिप्ट में भी उपयोग किया जाता है, बस इसे अपनी कॉन्फ़िगरेशन विधि से पहले घोषित करना सुनिश्चित करें।


javascript - Recommended Node.js Azure Website setup -


I currently have a small node. I am making JS website and I want to host it on Azure. I would like to ask that I should separate the front and backend parts of the app into two different Ezur websites or just put the whole app in an Azure website slot.

I think that separating it into two parts can mean that I want to use the backend part to not only from this website but from other parts (like mobile app). And I think that this setting updating the frontend part will also mean downtime for the backend API. On the other hand, two websites make it hard to ask backend (hardcoded URLs, sockets) from the frontend. IO simply can not setup anymore simply, etc.)

What would you recommend in my case?

Thank you very much.

ExpressJS Socket.io Server Sidebar (DOM Parsing) Some clients on client / cheerio jquery

There is no experience with Azure .. Switch to Linux !! It is very important to access your app, data and an app about which app is built.


asp.net - c# deleting database entries through list box -


I am trying to delete rows from a table through a list box. Below is the code that I used to display data in the data box from the database. FYI - I'm using a Calendar Search function - By which a user selects a date on the calendar, click 'Search', and the list box displays the appropriate result dates found in DB based on

  Con.Open (): SQL Commands CMD = New SQL Commands ("Member Selection, Clerical, Cell, Time with Events, Date = Date = @ Search", Con); Cmd.Parameters.AddWithValue ("@ searchDate", SearchDate.SelectedDate); Idta reader reader = CMD Spare reader (); While (reader.Read ()) {string member = (string) reader ["member"]; String Clark = (string) reader ["clerk"]; String room = (string) reader ["room"]; String time = (string) reader ["time"]; LstEvents.Items.Add ("Member:" + Member + "-" + "Clerk:" + Clerk + "-" + "Room:" + Room + "-" + "Time:" + Time); // lstEvents list is the ID of the box} reader.Close (); Con.Close ();  

The above code works just fine. What I was hoping was to find a way to remove this line in DB. So a user selects one of the items returned in the list and clicks on 'delete' I found that as far as ...

  SqlCommand cmd = New SqlCommand ("Delete from the event Where member, clerk, room, date, time = @member, @clerk, @room, @date, @time ", cone); Cmd.Parameters.AddWithValue ("Member", lstEvents.SelectedValue); Cmd.Parameters.AddWithValue ("@clerk", lstAppointments.SelectedValue); Cmd.Parameters.AddWithValue ("@ room", lstEventss.selectedValue); Cmd.Parameters.AddWithValue ("@date", Convert.ToDateTime (SearchDate.SelectedDate); cmd.Parameters.AddWithValue ("@time", lstEvents.SelectedValue); cmd.Connection = Thief; cmd.ExecuteNonQuery ();  

This attempt, however, seems to be taking a little away, how can any suggestion be done? I do not particularly understand how I have more than one value in the list box You can choose from members and clerks.

After

When you load the rows from the database, Themic key load (even if you do not display it).

When you delete something selected in your listbox, you can only delete using the primary key.

If your table does not have a primary key, then it is very good that you should add one.


parse.com - Increment Likes in Objective-C / Parse Cloud Code -


I am creating a social app using Objective-C and Pars. I'm trying to write cloud code for choice on the edge of a button click (which is part of the secure user class). It's like me now:

Cloud code < / P>

  pars.cloud.define ("looking for increment", function (request, response) {parse.Cloud.useMasterKey (); var user = new parse.object ("user"); User.userName = request.params.userName; user.increment ("Profile Picture");});   

In-background: with parameter "@ increment choice": @ {@ "userName": self.user.username}]; }

self.user is PFUser whose profile is being viewed.

This code generates the following error, and does not increase the liking:

<(code: 141, version 1.6.2)

OK, the error is because you are not calling the response handler in the cloud code, but you have several other problems:

  1. Not calling answer
  2. Passing user name instead of user's object ID
  3. Do not save the user it's update After T

jquery - How to change/add content inside javascript -


I'm trying to explain how to add some text or adsense to whatever I want to believe. JS

Below is a working lightbox with a description caption, and the caption that I want to change.

Code here:

  captionOn = function (var details = $ CurrEl.attr ('title'); Console.log (description); If (details! = Undefined & details.labby & gt; 0) {$ ('& lt; div id = "imagelightbox-caption"> gt;' + description + '& lt; / div & gt;') . AppendTo ('body'); }}, Captionoff = function () {$ ('# Emailslit box-caption'). Remove (); },  

I have come to know that whatever I need to change is somewhere + details + I try to change the description of the word with plain text and without two + symbols It breaks the lightbox, which means that the + description + is required for the lightbox to work, so I tried to use it instead:

  + "& Lt; div class = "align_left" & gt; + Description + "& lt; / div & gt;" + "Div" div class = "align_right" & gt; + Adsense_code + "& lt; / div & gt;" +  

But this does not work, either with or without the + sign.

So for now I am out of all the ideas and in search of the details, it may be a good thing for the audience to see the image, but then again I would like the text or the code How do I add?

You need to put plain text in quotation marks to work. Description is a variable

  $ ('id id = "imagelightbox-caption" & gt;' + "This is my desired text." + '& Lt; / div & gt;') . AppendTo ('body');  

file upload - Uploading a folder of images with rails 4 -


Can someone tell me in the right direction of uploading an entire folder full of images? What are some useful gems for this or even some existing Gitob repo I can refer to. I cloned the low repo in my local machine and it works great, but you have to choose each image individually. It is unhappy, but it is very complicated for my customers.

Is there a gem that will provide the same functionality as the above app but I have a single folder containing a bunch of images? Then the images will be removed and downloaded in DB.

Any advice is appreciated.

carrier service

There are several file uploads at one go, but are not sure Instead of having to click each file individually, you can upload only one folder.


Download all files matching a mask from a remote FTP directory tree to the same local folder -


I have a * file. I am trying to download with name that ends with Csv .

The problem is complicated by the fact that it is *. Csv is in the directory of the unknown name:

Example sometimes it

  2015 / date 29: 10: 20: 10 / a CSV  

or

  will  anything  (in Linux) that matches the wildcard directory What is the wildcard file matching as well? 

WinSCP will solve your problem on Windows mask in this tool

< / Html> has the ability to download files

nginx - HTTPS + gzip: Is it a security vulnerability if I only gzip non-sensitive files? -


As I understand, if I use it with SSL / HTTPS, a security vulnerability (breach / crime) Open it. / P>

What if I only use it on my CSS and JS files, is it still a security vulnerability if those files are served on my HTTPS server?

What I think is not the answer - it is not security vulnerability. The plain text selected for highlighting the original plain text in the crime / BEAST attack has been selected; In your case it will be CSS and Javascript, which do not take security values. (Possibly, you serve them on HTTPS to avoid compromised content warnings on the browser.)

Attack can not highlight symmetric keys per session, so it does not affect your sensitive content. Assuming that it is gzip / air removal. Of course, if you want to ensure 100%, then you can consider the selected encoding of gzip according to this article:


javascript - How to use Sessions and Templates to show/hide elements? -


I have 7 questions that I personally want to ask once on the page. I have every one of them in the same template and I know that I should use session-set-session.get every time to show / hide them but I do not really know how to do it, Example and how can not get it. In this way I structured the layout template with 7 questions.

  & lt; Template name = "layout" & gt; {{#if before}} {{& gt; SubmitProblem}} {{/ if}} {{#if second}} {{ First of all, when the page opens, it needs to be displayed ...} {} / and then I tried to do this with sessions, but there is no conjecture ...  

 < Code> Meteor.startup (function () {session .set ("first", true);}); Template.layout.events ({'click .btn1': function () {session .set ("first", wrong); session .set ("second", true);}});          

It seems that using jQuery to show / hide the show with the show: Block / nobody is easy ?

If you want to hide items on the page, you should define and .hide or .hidden class These should use CSS. Hide / hide items using JQuery Show / Hide Bad behavior is considered that you should present all hidden templates that are wrapped with a hidden class. The first template you want to show will not be a hidden class.

CSS:

  .hidden {display: none; }  

template:

  & lt; Template name = "layout" & gt; {{& Gt; SubmitProblem}} {{& gt; SubmitWhy}} ... & lt; / Template & gt; & Lt; Template Name = "Submit Problem" & gt; & Lt; Div id = "submit-problem" & gt; ... & lt; / Div & gt; & Lt; / Template & gt; & Lt; Template Name = "Submit" & gt; & Lt; Div id = "submit-why" category = "hidden" & gt; ... & lt; / Div & gt; & Lt; / Template & gt;  

  Template.layout.events ({click '.btn1': function AddClass ('hidden'); $ ('# submit-why'). RemoveClass 'hidden') () {// removeClass () / addClass () $ ('# submit-problem') ;}});  


grails - Inconsistancy betwwen run-app and war execution -


I have a Grails app, which does not require a database (this is a client). When I run it with the grails run-app , then everything is planned, but when I run it as a war in Tomcat, I get the following message:

< Pre> class: java.lang.ArrayIndexOutOfBoundsException Message: 1 Trace: Line | Method - & gt; & Gt; 1142 | Run Worker in Java.util.concurrent.ThreadPoolExecutor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 617 | Go to Java.util.concurrent.ThreadPoolExecutor $ employee ^ 744 | Run . . Exception caused by java.lang.Thread GroovyPages in: Error processing GroovyPageView: 1 - & gt; & Gt; 38 | RunWorker in /index.gsp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reasons reasoned by theArrendexofffolded: 1 - & gt; & Gt; 64 | DoCall in gsp_coreQueriesindex_gsp $ _run_closure2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 88 | Gsp_coreQueriesindex_gsp | Move to 1142 | Run worker in Java.util.concurrent.ThreadPoolExecutor | 617 | Go to Java.util.concurrent.ThreadPoolExecutor $ employee ^ 744 | Run . . In Java.lang.Thread

I do not know where the focus is, I used to use Maven and Ivy without any result.

Many thanks for your support. I replaced the index.gsp page with a simple one and everything is fine.


php - Display folder for replace my domain -


Hello, I have a URL like aaa.com/folder , but it might be directly < Strong> aaa.com ?

I have already tested it in HTACAC

  & lt; VirtualHost *: 80 & gt; ServerAdmin webmaster@siteprincipal.com DocumentRoot / public_html / porn server name www.siteprincipal.com ServerAlways siteprincipal.com Custom Log Log / Principal-Access_log Combined ScriptAllus / CGI-bin / Home / Principal / CGI-bin / AdHandlerX-HPD- PHP5 Php & lt; / VirtualHost & gt; Hi, I have a URL like aaa.com/folder, but it is possible  

< Blockquote>

to display AAA dot com directly?

First of all, what to get rid of in your HTACAC. None of these items is included in the HTX file, they are all in the vhost configurations of your server.

You need to make sure that mod_rewrite is turned on, just add it to your Http:

  RewriteEngine On RewriteCond ^ (? Folder /) / folder% {REQUEST_URI } [L]  

java - Comparator compare() method sorting confusion -


I am self-test questions from Cathy and Serera Book. One question went wrong, so I was trying in the IDE. The main question I can get from this image is that the main question is when I debug it, then I had a debugging point compared to the method. If tooltip can be seen that O1 value is pen I thought that O1 should be map and O2 should be pen. Can anyone explain this illusion to me?

comparative illusion

You can see the source of arrays.sort method on grepcode and it can now understand better:


python - Tkinter Canvas reset ID's -


I am coding a typical GUI for a senior research project at school.

I need to reset the counter used to create the id value for some point in the code, new addition. Does anyone know that it is possible except for the entire canvas? Actually, after adding a bunch of lines and egg, I have to remove them all and the counter will have to restart the new ones for 1. Second, I have taken the path of changing the entire canvas, and later, nothing appears in the winfo_get () method, why can it be so? I know I am trying to do something that is not a commentator, but it should be possible.

It is not possible to reset the ID numbers generated by the canvas.

Your solution to remove canvas and reproduce is a reasonable option, although it may not be necessary. It is possible that in order to solve this by resetting the canvas ID, there are better ways for what you think. For example, you can create your own IDs, and you can add each ID as a canvas item with a tag. You can reset the ID at any time.


php - Using flashvar inside actionscript -


I am working on a live streaming media platform and have a flash interface. I need the string required that they The user is unique on the profile on which he sits. I have the following in my PHP.

  var flashvars = {}; Flashvars.instance = escape ('& lt ;? php $ global $ user; $ drupaluserid = $ user- & gt; uid? & Gt;');  

I have this AS3 where string is required to be set.

  private var INSTANCE: string = "default"; Public Function Set Instant Name (Inst. String): Zero {INSTANCE = inst; }  

It is not certain how to proceed before compiling Flash app to capture Flashvar.

In your case you may want to use the singleton class to be started in your main constructor, Then it is called from anywhere in your code:

  // Start in your Main.as document: FlashVarsHelper.in (loaderInfo.parameters.instance ); // Call it from anywhere: FlashVarsHelper.getValueByName ("Example");  

Note that this library is not sensitive to prevent external typo errors.


android - Receiver capture power button presses -


I am creating a receiver that captures the power button, and now it works, but it's such behavior Does not do as i want It is defined in some definition, if the user presses 5 times less than 5 seconds, but it is no longer responsive and sometimes takes more than 5 presses so that the receiver performs the specified task.

Someone can tell me how I can improve my code Thanksgiving

Here is my receiver. Class:

  Public class receiver extends Broadcast receiver {Public Boolean successful = false; Public boolean test = wrong; Int press; for a long time; Shared Presentations Prefix; Personal reference references; Override public zero at @Receive (Reference Reference, intent to intent) {Audio Manager Manager = (Audio Manager) context.getSystemService (context.AUDIO_SERVICE); If (manager.getMode ()! = AudioManager.MODE_IN_CALL) {this.context = context; If (intent.getAction (.) Equals (Intent.ACTION_SCREEN_OFF) || intent.getAction (.) Equal (Intent.ACTION_SCREEN_ON)) {calculationLogic (); }}} Public Zero Native () {prefs = context.getSharedPreferences (context.getPackageName (), Context.MODE_PRIVATE); Press = prefs.getInt ("repeats", 0); Log D. ("-", "power pressed, #presses:" + press); Log D. ("-", "time" + system timetable ()); // screenoff = true; Time = System.currentTimeMillis (); // Save the initial power BTN if (prefs.getLong ("time", 0) == 0) {log d. ("Receiver", "40"); Prefs.edit (). PutLong ("time", time) .apply (); Press + = 1; } Other {Log D ("Receiver", "44"); // calculate the difference between the first power press and current power press log.d ("-", "time diff =" + time + "-" + prefs.getLong ("time", 0) + "=" + Time - prefs.getLong ("time", 0))); If (time - prefs.getLong ("time", 0)> 5000) {reset (); If (test) {vibration (); (IntroActivity Reference) .onbpressed (); (IntroActivity Reference) .showTestSuccess (Successful); Context.unregisterReceiver (this); } Log D. ("Receiver", "unsuccessful"); } And (if (press == 5) {log D. ("receiver", "success"); reset (); successful = true; log D. ("-", "stare activity"); vibration; // TODO if (test!) {DoAction (reference);} and ((IntroActivity reference) .onbpressed (); (introActivity reference) .showTestSuccess (successful); context.unregisterReceiver (this);} time = 0 ;} And {press + = 1; log D. ("receiver", "press so far", press);}}} prefs.edit (). PutInt ("repeats", press) .apply ();} Private Zero Reset () {Press = 0;. Prefs.edit () ("Time") apply to delete (.);} Private zero vibration () {vibrator V = (vibrator) context.getSystem Service (References.DVBRATOR_SERVICE); v.vibrate (200);} Private Wide DotAction (Reference Reference) {Log D. ("Receiver", "Start Menu"); Intent I = New Intent (); I.setClass (Reference , SplashActivity.class); // i.setClassName ("com.emergencyapp", ".plashActivity"); i.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity (i);}}  

To trigger the state of the state, the trigger is queued on the trigger receipt by the power button and by PowerManagerService Managed In this way, the switch event effectively degrades in such a way that to press the button position to toggle the screen position (or even the actual screen on / off event) between 1: 1 mapping between the press and the system transmission Will not be necessary.

In addition to this, delay between the internal amount and the actual transmission distribution (which is the variable) becomes difficult to press the correct time button for the events you receive.


oauth 2.0 - Integrate with Google button - what happens on redirection? -


I am in charge of migrating a list to the new version from the old Google Enterprise Marketplace, as well as changing the Oath Scheme is .

I get a new OAuth2 authentication scheme, it is implemented.

However, I have a question about the "Integrate with Google" button, what happened when the user was sent to the Universal Navigation Extension URL? My guess is that we should call that URL to sign in with a domain already filled with domains, is this a process? If so, integrate with Google is a process that is usually on Google's side, which allows one to receive a valid email and response later when a user tries to sign in with Google Is that the case?

Can anyone provide an example stream for the "Integrated with Google" button?


html - How to wrap text in table cell without wrapping child elements -


I have a table cell that contains 4 inline elements. First 3 is an icon, and based on cell data May or may not exist. Fourth is a divisor in which there is a text.

Cells are "white-space: ipod" in the CSS because I want to make sure that all the symbols and the text are always present on the same line. However, when the text is too long to fit, this screen stops; Due to "abrap" I want the text to be wrapped when the mouse is next to the icons. Like this:

http://i.stack.imgur.com/xoZYF.png

I have tried every combination of those things which I can think of, due to the wrapping of the contents of the cell, causing the wrapping between the mouse, so that one Icons appearing on different lines, or appearing on different lines.

I've tried floating content left; Set a specific width on the table cell; Even using an internal table in the form of layouts, which I know should be avoided. In fact, I have achieved only 2 results or there is nothing in the cell, which means that the text only goes out of the field, or in the middle of the text, wrap the cell after the icon.

One thing that seems to be working in the form of CSS is setting a specific width on the div in which the text is included, however, this is not really an option because the width of the variable How many marks are being shown on the basis

Here I have a JSfield with basic layout. You can see how the text goes beyond the container

   

I believe you need it:

< P> changed the following:

  .inline {display: table-cell; Vertical-alignment: top; }  

and .Nowrap class

has been deleted.

octobercms - October CMS Single page management -


I am trying to create a single page web site using October CMS. October CMS has the ability to create separate pages with different URLs.

But I want to create a single page web site, which is capable of managing content without knowing HTML and PHP.

There will be 4-5 sections on this page, all the sections will be designed by themselves, title and content will be displayed with each parlax effect.

So, what's the best way to edit single page sections and content?

You can use partially as part of the section, and you can set partial set of original tags only You can set different design sets in each partial and menu url in the id.

There are reusable sections of partial partial HTML markup.

Partially defined in different HTML files, which can be included anywhere. The codes below use to partially load the code in these home pages

  {% partial "partial-name"%}  

and You can make partial as shown below image Enter image details here

reconstruction link :