Wednesday 15 May 2013

GUI pop-up menu in MATLAB -


I have a pop-up menu with content of 5,10,15,20 in that menu using the switch I have made it

  val = get (hobject, 'value'); Switch case case '5' n = 5; Case '10' n = 10; Case '15' n = 15; Case '20' n = 20; End guide (HObject, handle);   

Where this output represents the number of pictures it presses the search button in the same GUI window, it calls another function where I need to use this 'N' .

  for i = 1: n% store top n matches ... tempstr = char (resultNames (index (i))); Fprintf (fid, '% s \ r', tempstr); Disp (resultNames (index (i))); Disp (sortedValues ​​(i)); Disp ('') end   

How do I pass that code or function to 'n'? Any correct answer is commendable.

Good, it is wrong and unnecessary to start with your switch statement The value property of a dropdown is not present in the current selection, it is the index in the current list. To get the string value of the currently selected list item, you will:

  content = cellstr (get (hObject, 'string'))% returns content as cell contents   

This is definitely a handle assuming hObject The dropdown indicates the box - which will be only if you are in a callback that is called by land dropdown. Security had been raised. Also, note that there is no need to change string value through unconnected switch statement; You can only use str2num or str2double functions.

Finally, if you need access to the value of the dropdown from outside your own callback, you will need to use the handle structure, which will be used in every callback (or in your sample , Has been passed from guidata ). There will be an area with the same name in the name of your dropdown - it will be handled by which you can access your properties.

asp.net mvc - Make Html.TextBoxFor show non-initialized integer property as empty string in MVC 4 -


मैंने एचटीएमएल को जोड़ा है। टेक्स्टबॉक्स मेरे विचार के लिए:

  @ html। Textbox (x = & Gt; x.zip, स्ट्रिंग.एप्टी, नया {@class = "gsTextBox", प्लेसहोल्डर = "अपना ज़िप दर्ज करें"});   

और यह खाली स्ट्रिंग के बजाय इनपुट में 0 दिखाता है।

मुझे भी समाधान मिल गया है, लेकिन ऐसा लगता है कि यह भयानक है। या यह अच्छा तरीका है? या शायद मुझे जावास्क्रिप्ट का उपयोग करके रिक्त स्ट्रिंग के द्वारा 0 की जगह लेनी चाहिए?

इसे आज़माएं - इंट नल योग्य बनाएं <प्री> सार्वजनिक इंट? ज़िप {सेट; सेट; }

jpa 2.0 - Using JPA2 to put data asynchronously to google datastore -


I am using JPA2 @entity to represent my model I am datastore Need to insert asynchronous data. How do I do this? If a JPA Dao can not do this, can I use the Asyncdathore service at JPA institutions instead of JPPL? Is anyone an example?

(I know in python this will be fun because I can expand ndb.model to create the model and then call them at put_async. But in Java There is no ndb.model to expand, so I am using JPA.)

I highly anticipate the following thread manager. Do not use content backgroundread . But so far I've got it all. Does anyone else have something very simple (like put_async of Python?)?

  Import com.google.appengine.api.ThreadManager; Import java.util.concurrent.AtomicLong; Atom long counter = new atom (); Thread thread = ThreadManager.Cutut BackgroundTrader (New Runnabal) (Public Wired Run) {try {while true} {counter.incrementAndGet ()); Thread Slip (10);}} Catch (before interreated expression) {new runtime exposure "interrupted in loop:", prior);}}}); Thread.start ();    

sql server 2008 - What is a good strategy, other than NULLs, for dealing with unknown datetime values? -


मेरे डेटाबेस में 3 टेबल हैं: संगठन, उपयोगकर्ता & amp; OrganizationUserJunction। संगठन यूजरज्यूंस टेबल एक उपयोगकर्ता के संगठन से संबंधित संगठन को ट्रैक करता है, जब वे संगठन का सदस्य बन गए और जब संगठन छोड़ दिया गया सदस्य फ़ील्ड एक ज्ञात तिथि से आबादी है लेकिन सदस्य तिथि को पहले ही अज्ञात है। मुझे अपने तालिकाओं में शून्य मान होने पसंद नहीं है।

जब मैं एक स्ट्रिंग फ़ील्ड के साथ काम कर रहा हूं, तब मैं उन्हें 'अनकेन' के बजाय 'न्यूल' से भर सकता हूं। मैं डेट्राइम कॉलम के समान कुछ करना चाहता हूं। एक अज्ञात मूल्य के साथ SQL सर्वर datetime स्तंभों से निपटने के लिए, nulls के अलावा एक अच्छी रणनीति क्या है?

सदस्य समीक्षा के लिए एक डिफ़ॉल्ट तिथि का उपयोग करने के बारे में शामिल होने के 5 साल बाद कहें

या अगर हम एक व्यापार संगठन के साथ काम कर रहे हैं और आप DOB और लिंग पर कब्जा कर रहे हैं तो आप सेवानिवृत्ति की आयु की गणना कर सकते हैं। व्यक्तिगत रूप से मुझे नल के साथ कोई समस्या नहीं दिखाई देती है। सदस्य तिथि के संदर्भ में, आईएस नाल = अभी भी एक सदस्य है। यह एक डिफ़ॉल्ट मान के रूप में बिल्कुल एक ही प्रयोजन के रूप में कार्य करता है और एक डिफाल्ट तिथि मान की तुलना में बहुत कम जटिल है।

jquery - Tell an element to show itself based on the status of others on the page? -


There are 3 hidden divisions on my page, and a general general "Welcome" message. On the left side of these divs there are some items that are clicked, toggle their corresponding divs (as well as other divs). It has to work with all purpose.

  var $ jq = jQuery.noConflict (true); $ Jq (function () {$ jq ("# fade1"). Click (function () {$ jq ("# div1"). FeedToggle (750); $ jq ("# div2"). FadeOut (1) ; $ Jq ("# div3") .FadeOut (1); $ jq ("# welcomediv"). Feedout (1);}); $ jq ("# fade2") Click (function () {$ jq FadeOut (1); $ jq ("# div2"). FadeToggle (750); $ jq ("# welcomediv" ($ 1); $ jq ("# div3"). $ Jq ("# fade3") Click (function () {$ jq ("# div1"). FadeOut (1); $ jq ("# FadeOut (1); $ jq ("# day3") .FedTagle (750); $ jq ("# VelkMidiv"). Fadeaut (1);});});   

Then I tried to add an event statement that welcomes the message He tells you to show himself if someone else does not appear, as if the user has clicked one to click it, then clicked it again to fade it out of the user's behavior Spaces can be omitted for.

  if ($ jq ("# div1: hidden") and $ jq ("# div2: hidden") & amp; & Amp; $ Jq ("# day3: hidden")) {(function () {$ jq ("# velkmidiv"). FadeIn (500);}); };   

I have also tried to check the CSS directly, like

  if ($ jq ("# div1"). CSS ("Display" , "CSS" ("Display", "None") & amp; $ jq ("# div3") CSS ("Display", "None") {$ Jq ("# welcomediv"). Fidine (500); } ($ '(' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' 

}

None of these work. Divisions are still faded and out when their related links are clicked, but if my statements do nothing The idea is:

Use an element to see if something is invisible:

  if ($ jq (selector) .is (': hidden') and ...)   

You should also be able to check that All three are visible using:

  if ($ jq ('# div1: hidden, # div2: hidden, # div3: hidden'). Length === 3) {...}    

plsql - How do you convert a varchar2 into a number with two decimal places? -


Sorry, I'm new to Oracle and I'm having some problems, which are in a table, which are varchar2 .

I need to be number with 2 decimal places.

For example:

  00008600 00202033 00094123   

should be

  86.00 2020.33 941.23   

How can I do this? You can use something like this:

  
To_char (to_number (yourcol) / 100.0, 9999999d99 ') Your code is formatted with your table

View

NSnumber in to NSstring -


  स्टॉक * स्टॉकऑब्जेक्ट; स्टॉकऑब्जेक्ट = [[स्टॉक आलोक] इनिटविथ इसाउज़िंग कंपनी: एडिमंपनी स्टॉकनाम: @ "एक" स्टॉकपीस: [एनएसएनंबर नंबर विस्फोटः 150.3]]; [उपलब्ध स्टॉक्स जोड़ेंऑब्जेक्ट: स्टॉकऑब्जेक्ट]; फ़्लोट माइफ्लोट = [एस.स्टॉक प्रीमियम फ्लोट वैल्यू];   

एनएसएलॉग (@ "सिंगलटन @% एफ", माइलाफ्लॉट);

इस कोड को आज़माएं, लेकिन इसे चालू होगा:

  फ़्लोट माइफ्लोट = [एस.स्टॉक प्रीमियम फ्लोट वैल्यू];   

कोई त्रुटि नहीं।

क्या कोई मुझे मदद कर सकता है?

नहीं होना चाहिए [stockObject.stockPric floatValue] ?

javascript - Disable then re-enable button after AJAX Response -


So I'm trying to disable a button while processing JavaScript, when javascript is done, then re-enable it Please. In the code below, except for IE7, I have tried to work in every browser. It ignores only disable and re-enable in IE 7 and it seems that it is still full-time enabled, so in IE 7 How do I get the right behavior?

  & lt; Script & gt; Function doSomething () {document.getElementById ("myButton"). Disabled = true; ... xmlhttp = new XMLHttpRequest (); Xmlhttp.open ("GET", url, false); Xmlhttp.send (zero); Feedback = xmlhttp.responseText (); If (response! = "Wrong") {document.getElementById ("myButton"). Disabled = false; } ...} & lt; / Script & gt; & Lt; Form onsubmit = "doSomething (); return back;" & Gt; & Lt; Input type = "submit" id = "myButton" value = "Do Stuff" /> & Lt; / Form & gt; & Lt; Div id = "result" & gt; & Lt; / Div & gt;    

disabled does not have toggled right / wrong if you do not have it If you want to enable anything after it has been deactivated, you can delete the disabled attribute completely.

To set: document.getElementById ("myButton"). SetAttribute ("disabled", "disabled");

To clear: document.getElementById ("myButton"). Remove Products ("Disabled");

java - How to list only non hidden and non system file in jtree -


  फ़ाइल f = नया फ़ाइल ("सी: /"); फाइल फेल [] = f.listFiles ();   

जब मैं इसका उपयोग करता हूं तो यह सभी सिस्टम फाइल और छिपी हुई फ़ाइलों को सूचीबद्ध करता है।

और इस कारण नल सूचक अपवाद जब मैं इसका इस्तेमाल करता हूं इस तरह से jTree में दिखाने के लिए:

  सार्वजनिक शून्य getList (DefaultMutableTreeNode नोड, फ़ाइल एफ) {if (f.isDirectory ()) {DefaultMutableTreeNode child = new DefaultMutableTreeNode (f); node.add (बच्चे); फाइल फेल [] = f.listFiles (); के लिए (इंट I = 0; i & lt; fList.length; i ++) मिल सूची (बच्चा, fList [i]); }}   

मुझे क्या करना चाहिए कि यह NullPointerException नहीं देता और jTree में केवल गैर छिपी और गैर सिस्टम फ़ाइलों को दिखाएं?

छिपी हुई फ़ाइलों के लिए ऐसा करें:

  फ़ाइल रूट = नया फ़ाइल (yourDirectory); फ़ाइल [] फ़ाइलें = root.listFiles (नया FileFilter () {@ ओवरराइड पब्लिक बूलियन स्वीकार (फ़ाइल फ़ाइल) {वापसी! File.isHidden ();}});   

यह छिपी हुई फ़ाइलें वापस नहीं करेगा

सिस्टम फ़ाइलों के लिए, मुझे विश्वास है कि यह एक विंडोज अवधारणा है और इसलिए फ़ाइल इंटरफ़ेस द्वारा समर्थित नहीं किया जा सकता जो सिस्टम को स्वतंत्र होने की कोशिश करता है आप कमांड लाइन के आदेशों का उपयोग कर सकते हैं, अगर वे मौजूद हैं

या रीमेसन के जवाब में उसका क्या उपयोग करें।

संभवत:

  फ़ाइल रूट = नया फ़ाइल ("सी: \\"); फ़ाइल [] फ़ाइलें = root.listFiles (नया फ़ाइलफ़िल्टर () {@ ओवरराइड सार्वजनिक बुलियन स्वीकार (फ़ाइल फ़ाइल) {पथ पथ = पथ.जेट (file.getAbsolutePath ()); DosFileAttributes dfa; try {dfa = Files.readAttributes (पथ , डोजफ़ाइल गुण। वर्ग);} पकड़ (IOException ई) {// बुरा अभ्यास वापसी झूठी;} वापसी (! Dfa.isHidden () & amp;; dfa.is सिस्टम ());}});   



Is there a pretty way to yield if in Python 3.3? -


क्या इस कोड को सुंदर बनाने का कोई तरीका है?

 strong = li.find_all ("मजबूत" ) यदि मजबूत: उपज li.find_all ("मजबूत")  

मेरा मतलब कुछ ऐसा है:

 मजबूत = li.find_all ("मजबूत") उपज li.find_all ("मजबूत ") यदि मजबूत   

आप उपयोग करेंगे:

  strong = Li.find_all ("मजबूत") यदि मजबूत:  find_all ()   दोबारा  (जो, BeautifulSoup में) को कॉल करने के बजाय मजबूत   

, एक ही परिणाम देता है लेकिन फिर से काम करता है।)

कोई 'सशर्त उपज' नहीं है आप उपज से चाल से खेल सकते हैं, लेकिन मैं इसके खिलाफ सुझाऊंगा।

WPF MVVM Dependency Properties -


I have the following condition:

  1. I only have user controls with a single grid Is inside
  2. grid's first column is bound to the list of Aitmssors a checkbox as the column, which is connected to IsSelected property customer model
  3. Grid & lt; CustomerModel & gt;
  4. When the user checks any of the corresponding IsSelected property of CustomerModel is being updated

    question:

    1. < P> I've added a dependency property to UserControl called "SelectCustomerItems", and I want to return it to a list & lt; CustomerModel & gt;
    2. This UserControl is placed on a window

    3. dependency property "SelectedCustomerItems" is to "SelectedCustomers (only IsSelected to = For true) "Property inside WindowViewModel

      But I am not getting the selected client item through this dependency property. Apply your DP to:

        #region SomeProperty /// & lt; Summary & gt; ///; & Lt; See cref = "DependencyProperty" /> & Lt; Cref = "SomeProperty" /> See. /// & lt; / Summary & gt; Public static only DependencyProperty SomePropertyProperty = DependencyProperty.Register (SomePropertyPropertyName, typeof (object), typeof (SomeType), // other kinds of reading may be appropriate (minus its situ new FrameworkPropertyMetadata, OnSomePropertyPropertyChanged)); /// & lt; Summary & gt; The value of /// when & lt; Cref = "SomePropertyProperty" /> & Lt ;; Cref = "SomeType" /> Changes on given example /// & lt; / Summary & gt; /// & lt; Param name = "d" & gt; Example on which property changed & Lt; / Param & gt; /// & lt; Ultimate name = "E" & gt; & Lt; See cref = "System.Windows.DependencyPropertyChangedEventArgs" /> Example with event data & Lt; / Param & gt; Private static void OnSomePropertyPropertyChanged (DependencyObject d, DependencyPropertyChangedEventArgs e) {(as SomeType d) KOnSomePropertyChanged (in kind e.OldValue, in e.NewValue kind); } /// & lt; Summary & gt; When the & lt; See cref = "SomeProperty" /> Change. /// & lt; / Summary & gt; /// & lt; Param name = "oldValue" & gt; Old value & lt; / Param & gt; /// & lt; Param name = "newValue" & gt; New value & lt; / Param & gt; Private Zero onsomeproperty-chinged (Object Olderview, Object New Value) {} /// & lt; Summary & gt; Name of /// & lt; See cref = "SomeProperty" /> & Lt; Cref = "DependencyProperty" /> See. /// & lt; / Summary & gt; Public const string SomePropertyPropertyName = "SomeProperty"; /// & lt; Summary & gt; ////// & lt; / Summary & gt; Public Object SomeProperty {Return (Object) GetValue (SomePropertyProperty); } Set {set value (some property properties, values); }} #endregion   

      You should understand that added a DependencyProperty just WPF binding system with a bunch of junk / strong>, its not a hook. It is a huge, complex system that lives under the sea level on which your DP beauty floats. . These are the ways that you will not expect to know it until you actually know it.

      You are facing the revelation we had with all the draft para: Binding property accessors (via medium) Does not have access to DependencyProperty values ​​i.e., get and set methods). These property accessories are the convenience methods for you to use with the only code, you can share and use them, which are the actual hooks in the system (in my example given above, the gates / sets See implementation).

      If you want to listen for change information, then you should do what I have done in my example You can add a change notification listener while registering your dependency registration. You add the changes reported ( using DependencyPropertyDescriptor DataContext ) < Em> override / code> for this, but I've missed them).

      But, whatever you do, do not get and set for your code, do not add code for your dependencies! They can not be executed by winning binding operations.

      For more information about how DependencyProperties works,

Android: Google Play Store fake refund -


My App 4 refund was published on the Play Store, but in the Google Play Developer Console, I think the "Installation Active / Total" section My app is 71/71 in It looks like the people who asked for a refund have now installed the app in their device. Is this possible?

OK, this is possible if the app was installed, and then the user lost the internet connection The device has not been aware of it and it has not been uninstalled yet.

It is also possible that statistics have not yet been updated to display Uninstall (once every 24 hours)

It is also possible that 4 uninstalled , But other users have installed it on more than one device (a single Google account can install the app purchased on the unlimited devices, and they will all be shown individually)

mysql - How to Filter INNER JOIN SQL Command Results -


I have a table that forms the form submissions, the following variables are for each submission of the form: < Pre> userid record accountant account number

When a user submits the form, the table is populated by one record values ​​on each line item In, these values ​​are generally associated with the record value I userid , accountName And displaying accountNumber and username for trying to filter the results on a table by user INNER JOIN As I am very close to this command:

  SELECT t1.value as number, t2.value as name, t3.value as userid from mytable AS t1 INNER mytable Insert t3 INNER mytable As t2 ON t1.record = t2.record WHERE t1.name = 'addAccountNumber' and t2.name = 'addAccountName' and t3.name = 'userid'   

The only problem is that The result is not limited to one copy per entry There are only It appears that many examples are being shown in the table.

I believe that some edits should be done around the WHERE part of the statement. It seems that the results are not being named on the names and the results are filtering. Any suggestions about how to solve this?


Updated:

I should add that I get the proper filtering results when I include only two lines in the call as seen here:

  Select t1.value as accountNumber, t2.value as mytable AS t1 Join INNER as mytable on T2 on T1. TCR = t2.record WHERE t1.name = 'addAccountNumber' and t2 .name = 'addAccountName'   

I think it is possible to show who I am coming from. Therefore, in general this userid variable which is causing me trouble

I have a hard time understanding what you want, but it may happen.

  SELECT t1.value as number, t2.value as name, t3.value AS USIDEd from iTable to T1 inner INEER MENTABLE AS T3 ON T1 ON T1. TCR = T3. RECN inner MANTABLE ATT2 ON T 1.RCRDC = T2 Records WHEE T1 Name = 'adacquin number' and t2 Name = 'ad account nm' and 't3 .name =' userid '   

syntax - What is the underscore actually doing in this Java code? -


I just started learning Java.

My friends who are helping me to study have sent me this only, said 'this figure.'

Unfortunately I am unable to read it. It looks like Perl to me

  class _ {_ _; _}} {_ = This;}}   

What does this mean?

_ is the name of the class, it is a lot confusing, but this work Does it!

With the name of the class:

  class something {something}; Some () {some = this;}}   

more cleaned:

  class something {something}; Some () {some = this; }}   

And you can become mad with this weird naming code :)

  class _ {_ __; _ ____; In fact, Unicode is also supported, so it is valid: <(=) {__ = this; ____ = __;} _ (_ ___) {__ = ___;}}  
  class one "????" ?? É¡ ?? One ¥ one ???? ¨ ¨ ± {single ???? Line Line É¡ ???? ¥ one? Ç ± () {}}    

scheme - How to map a function over a list in parallel in racket? -


The title of the question is called to everyone, in fact: what is the best way of a function in the parallel list in the racket? Thank you.

If you mean more than multiple processor cores, then the most common approach is to use.

The location enables the development of parallel programs that take advantage of machines with many processor, core or hardware threads.

A place is a parallel task that is effectively a different example. Racket virtual machine is the communication between place-and-place channels, which are end-points for two-way buffered communication.

You probably may be able to use other parallel technologies, but the conditions


edit : In response to comment

P> Is there any implementation of parallel map using places?

First of all, I should back up myself. You may not need a place You can get concurrency by using racket threads. For example, here is a map / thread :

  #lang racket (define (map / thread f xs);; one channel for each element of xs Create a thread for every elemnet of each thread call (Fx) and its results to the channel (for the ([(x [x]) (for the ([x xs] Xx] [c cs]) (thank (channel-put c (fx)) ;; get results from each channel ;;; NOTE: This will be block on each channel if ready yet No. / List ([C-CS]) (Channel-Mill C)) ;; Use: (define xs' (1 2 3 4 5)) (map add1 xs) (map / thread add1 xs)   

If work is being done then blocked Includes doing, e.g. I / O requests, this will give you context of "Equality" in relation to not being connected to I / O. Although racket threads are "green" threads, so only one CPU will be used at a time.

If you really need parallel access to several CPU cores, you will need futures or space.

In the manner of implementation of the place - effectively as many examples of the racket --- I do not see immediately to write a normal map / location "Bespoke" For examples of using places on the go, see:



css - how to "chain" selector together and apply the same function in jQuery -


The title may not really tell what my question is.

  & lt; Ul & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; Li & gt; B & lt; / Li & gt; & Lt; Li class = "test" & gt; C & lt; / Li & gt; & Lt; Li & gt; D & lt; / Li & gt; & Lt; / Ul & gt;   

What I am trying to do is apply the background color to the adjacent brothers with an element "exam", and with itself, three of them Background color will be why I have to do the following.

  $ ('ul li.test'). Css ('background', 'red'); $ (this). Css ('background', 'red'); $ (this) .next () CSS ('background', 'red');});   

Which is a way of doing something like this, what I think is a pretty ugly coding $ (back, next, next). Some functions () Thanks

To add an element to the set of matched elements, Add () :

  $ (this) .add ($ (this) .prev ()) .add ($ (this) .next () ) CSS ('background', 'red').   

or .addback () (for jQuery versions prior to 1.8 with .andSelf () ): >

  $ (this) .prev () addBack () next () addBack () CSS ('background', 'red') ....    

.net - SQL Query To Linq or Lambda Expression -


I am surprised to create an equivalent linq or lambda expression for the following SQL query statement:

 < Select a code (zodiac (a.credit) - zodiac (a.debit)) as an enclosure table_a from the total table_a a.accountid = b.id where a. [Date] & gt; = '2013-01-01' and one. [Date] & lt; '2013-03-27' and 'b' name = 'mkbank'   

Any help is appreciated.

This should work:

  var qr = in a LA By joining, B.Id equals at a.Id in l, where a.Date & gt; = New Date Time (2013, 1, 1) & amp; Amp; A.Date & lt; New date time (2013, 3, 7) & amp; Amp; Select B.Name == "MkBank" new {cr = a.credit, db = a.debit}; Var res = qr.Sum ((x) => x.cr - x.db);    

java - 'popping' off an element in an arraylist. what am I missing? -


OK is a string of input numbers and operators like + 2 3 * 4. I want to split a string In ArrayList object, with each character in its string being indexed. Here I have;

  string turned on; String s = "+ 2 3 * 4"; List & lt; String & gt; Splitter = new array list & lt; String & gt; (Arrays.asList (s.split ("\\ s +"))); Current = splitter. Rev. (0); If (current == "+") {// do stuff} and if (current = "-") {// do stuff} .... if the statements aren 'not evaluated as correct for any reason Going, is there something subtle missing or am I completely wrong here?  

Thanks for the help. ==

In , you < Code> == to compare the wire; Use instead In

else , you are using the assignment operator = to compare the string; Instead use string # likeness .

== The operator compares the comparison of two string references to see if you see the same object, which is not what you want.

php - MySQL - Search Query between DATE_SUB() AND DATE_SUB() Error -


I tried between using a search query (PDO php and mysql) date range (7days-7days) I'm using) and (date 1day) for example using: DATE_SUB ():

  end_date 2013-03-26 2013-03-19 and 2013-03-25 '  

If you are using the first question below Dinank_sub (7 day period), but 2013-03-19 ignoring the other (date_sub (1 day interval) and Its search between 2013-03-26

  $ sevd_query = "booking_id, DATE_FO RMAT (start_date, '% e /% c') s_d, DATE_FORMAT (end_date, as selected as '% e /% c') as e_d bb Join bsi_reservation as interiors br from bsi_bookings bb .booking_id = br.bookings_id where Bckc_id =: C_id and: among DATE_SUB (bb.end_date, interval 7 days) and DATE_SUB (bb.end_date, interval 1 day) "day;  

section:

 : DATE_SUB (bb.end_date, interval 7 days) and Day between DATE_SUB (bb.end_date, interval 1 day)   

can be expressed as: day> = (End_date - 7) and day & lt; = (End_date - 1)

which can be rewritten:

  (day + 7)> = End_date and (day + 1) & lt; = End_date   

is the same as:

  end_date & lt; = (Day +7) and end_date & gt; = (Day + 1)   

Whatever:

  end_date> = (Day + 1) and END_DATE & lt; = (Day + 7)   

can also be written as:

  between end_date (day + 1) and (day + 7 )   

Which I do not think you want.

Instead, try this:

  Select Buking_aidi, DATE_FORMAT (start_date, '% e /% c') s_d, DATE_FORMAT (end_date, '% e /% C' aS) as well as bsi_reservation as inner br from e_d bsi_bookings looking on as bb bb.booking_id = br.bookings_id where bc.c_id =: between c_id and Bibi.and_det days - interval 7 days Day: - INTERV AL 1 day;   

If the end_date field is indexed, it will allow the index to be used.

If a field field is in a function to be searched for.

sql - Find start and end dates when one field changes -


मेरे पास यह डेटा तालिका में है

  FIELD_A FIELD_B FIELD_D 249052903 10/15/2011 एन 24 9 0 9 52 9 03 11/15/2011 पी ------------- मूल्य बदले 24 9 52 9 02 9 12/15/2011 पी 24 9 0 9 52 9 3 1/15/2012 एन ------------- VALUE बदले गए 249052903 2/15/2012 एन 249052903 3/15/2012 एन 249052903 4/15/2012 एन 249052903 5/15/2012 एन 249052903 6/15/2012 एन 249052903 7/15/2012 एन 249052903 8/15/2012 एन 24 9 0 9 52 9 3 9/15/15 एन   

जब भी फ़ील्ड FIELD_D में परिवर्तन होता है तो यह एक समूह बनाता है और मुझे उस समूह में न्यूनतम और अधिकतम तिथियां चाहिए क्वेरी शोड रिटर्न

  FIELD_A GROUP_START GROUP_END 24 9 0 9 0903 10/15/2011 10/15/2011 249052903 11/15/2011 12/15/2011 249052903 1/15/2012 9/15/2012   

मैंने जो उदाहरणों को देखा है, फ़ील्ड में डेटा अद्वितीय है I

किसी भी मदद की सराहना की जाएगी

धन्यवाद << p>

/ P>

आप विश्लेषणात्मक कार्यों का उपयोग कर सकते हैं - लैग, लीड, और COUNT () अपने लाभ के लिए, यदि वे हैं आपके एसक्यूएल कार्यान्वयन द्वारा समर्थित एसईसीएल बेलाल।

  साथ एंड्स मार्कड एएस (SELECT FIELD_A, FIELD_B, CASE WHEN FIELD_D = LAG (FIELD_D, 1) ओवर (ORDER BY FIELD_B) THEN 0 ELSE 1 END AS IS_START, केस जब FIELD_D = LEAD (FIELD_D, 1) पर (FIELD_B द्वारा आदेश) तब से 0 से 1 ईएसडी के रूप में टी), समूह संख्या के रूप में (SELECT FIELD_A, FIELD_B, IS_START, IS_END, COUNT (केस में WHEN IS_START = 1 THEN 1 END)) FIELD_B) एएस समूह समूह से अंत तक मार्क की गई WHERE IS_START = 1 या IS_END = 1) SELECT FIELD_A, MIN (FIELD_B) AS GROUP_START, MAX (FIELD_B) के रूप में GROUP_END GROUP_END समूहों से समूह संख्याबद्ध समूह द्वारा FIELD_A, GroupNum;    

php - Select articles with different catid on joomla 2.5 -


I have Joomla 2.5, where the article includes parents and sub categories I like the following:

  • Article 1 categories are News - & gt; Complex - & gt; Institute
  • Article 2 categories are News - & gt; Complex - & gt; Universities
  • Article 3 categories are News - & gt; Complex - & gt; Institute
  • Article 4 categories are News - & gt; Complex - & gt; Universities

    Here, the parents of the categories of news campus, and so on. I know that there is a unique catidade in each category but, in the database, Joomla only records every article based on the previous category. Therefore, if I want to get articles based on the News ID, the result is empty. So, I have to choose Institute or University ID but, what I want, how to get an article together with the institute and university categories.

    Can anyone help me solve the problem with Joomla 2.5 PHP?

    are stored as categories if you retrieve the 'News' category from the database The columns 'LFT' and 'RGT' have range values ​​for all sub-categories. Query

      Seo # as categories from SELECT * #__categories as parent category. Parent.lft as parent and parent.rgt WHERE parent.id = 3   

    will give you all the sub-categories of category along with id 3. Use the 'News' category ID instead.

    Please keep in mind that the query has not been optimized and is intended to clarify the approach only

Existential conditional assignment operators in Coffeescript -


While reading the coffee script document, I was confused by the documentation states

? = ) can also be used for secure conditional assignments compared to = = , in cases where you may have to handle numbers or stars.

? What is the difference between operator and ?

and = completely different (but overlapping) conditions

|| Operator works the same way as it does in JavaScript, such as 0 and '' are false as far as || Regarding ; || Checks for validity in javascript sense.

What ? The operator is converted to javascript in == zero A? B is only b when a is null or undefined ; Coffee code means ? Definition of check.

Consider these: for [wrong, 0, '', blank, undefined, 6] do (V) - & gt; A = VA || = 'Pancakes' console.log ("# {v}} = 'pancakes':", a for v [false, 0, '', null, undefined, 6] do (v) - & gt; A = VA? = 'Pancakes' console.log ("# {v}? = 'Pancakes':", a)

The first loop will give you five pancakes and one 6 , The second loop gives you a false , 0 , '' , two pancakes and a 6 .

DEMO:

So if you only want JavaScript style behavior (i.e. 0 , false , and '' is to be ignored), then you probably want = = . If you want to leave only null and undefined , you want ? = .

django - No files in home on Heroku -


I have problem in implementing a Django application on everybody, I do not think there is nothing in the house after pushing the git The problem is git because I can push the repository on github.

  (23:43:01 (venv) user @ host ~ / path $ git heroku 4heroku everything up-to-date (23:43:31) (user) @ host ~ / path $ Heroku run bash is connected to the 'bash` terminal running ... up, run .3486 ~ $ ls ~ $ ls -la total 8 drwx ------ 2 u12545 12545 4096 March 26 23:44. Drwxr -xr-x15 Route root 4096 October 31 2011 .. ~ $ Exhaust (23:44:16 (venv) user @ host ~ / path $ heroku log ...... ...... 2013-03- 26 T 23: 34: 04 + 00: 00 Horoku [API]: The process to start with the command `bish` email@yahoo.co.uk 2013-03-26 T23: 34: 05+ 00:00 Horoku [Run 8328]: Client's wait 2013-03-26 T23: 34: 05 + 00: 00 Heroko [Run 8328]: A Maan `bish` 2013-03-26 T 23: 34: 06 + 00: 00 Horoku [Run 8 8 8 8]: State 2013-03-26 T23: 34: 39 + 00: 00 Heroko [Run 8328 ]: Client connection closed. SIGHUP sending for all processes 2013-03-26 T 23: 34: 40 + 00: 00 Horoku [8 8 8 8]: State 2013-03-26 T 23: 34: 40 + 00: 00 Heroko [Run 8328] has been changed to complete: Process 2013-03-26 T 23: 44: 00 + 00: 00 Horoku [API]: Command started with 0 Process to start with `Beash` email@yahoo.co.uk 2013-03-26 T23: 44: 02 + 00: 00 Horoku [Run .3486]: A Maan `Bish` 2013-03-26 T 23: 44: 02 + 00: 00 Process started with Heroko [Run .3486]: Waiting for Customer 2013-03-26 T 23:44: 02 + 00: 00 Hanoku [ Run.3486]: changed from starting the state 2013-03-26 T23: 44: 16 + 00: 00 Heroko [Run .3486]: Process # 0 out of position   < / Div> 

If you want to employ a branch which is not a master branch, Should be pushed separately. According to:

The Heracock, except the owners, will be ignored by this order. If you are working locally outside of another branch, you can either merge the master before pushing, or you can specify that you want to push your local branch to a remote master. To push a branch apart from the master, use this syntax:

  $ git press your branch: Master    

In ruby, how might I find all Files between two dates -


I am surprised that I did not find the answer to this question, but I have to choose between all the modified files between time. 1.day.ago Clearly I'm not expecting an 'first' operator, when ruby ​​files or files deal with the utility classes, but I would not be surprised if someone shows me. :)

The second way would be an array function that I think ... probably '& lt; = & Gt; Operator that I have never used

Maybe something like this? (Untested):

  selected_files = Dir.glob ("* .pdf"). Select | File | Mtime = file.mtime (file) # If in a Rail Environment: # (1.day.ago .. time.Now) .cover? (MEAT) # If the rail is not in the environment, but want to use that code before the line: # should math 'active_support / all' #: # mtime & gt; (Time.No, 86400) and Meet & LT; time. Now end    

android - How can I create a pause for rotating animation -


I need to know how to stop my rotation animation:

  public Zero onClick (see v) {ImageView Animation Target = (ImageView) this.findViewById (R.id.imgWheel); Switch (v.getId ()) {case R.id.playButton: playBtn.setVisibility (button. INVISIBLE); PauseBtn.setVisibility (Button.VISIBLE); Animation animation = animationuulti Load animation (this, R. anime.artite_around_center_point); AnimationTarget.startAnimation (animation); break; Case R.id.pauseButton: pauseBtn.setVisibility (button. INVISIBLE); PlayBtn.setVisibility (Button.VISIBLE); // here is the place where I can put the break button code // break; }}    

use animationTarget.clearAnimation () if try

google app engine - Datastore why use key and id? -


I had a question about why Google App Engine's Datastore uses a key and the ID comes from the relational database background I am comparing entities with rows, so while storing an entity, it has a key (which is a string automatically generated for a long time) and an ID (manually or automatically Can be entered)? It seems like a big waste of space to identify a record. Again I'm new to this type of database, so I'm missing out on something.

In fact, the key is made up of two pieces of information:

    < Li> The unit type (in the object, is the square of the object)
  • Name of the ID / entity

    Therefore, for a given entity type, Are the same.

    If you do not specify ID itself, a random id is generated and the key is created based on that random ID.

npm - Node.js Forever Monitor Install Warning -


I always install the monitors with NPM only. It was installed successfully .. I think

  npm Forever Monitor NPM Warne Package. Josan admin@0.0.1 No README.md file was not found! . . . NMP Warne Engine Forever - Monitor 1.1.0: Wanted: {"node": "0.8.x"} (current: {"node": "v0.10.0", "npm": "1.2.14"} ) / Code>  

What happened with warning lines?

Publishing NPM package requires adding a README file to help people understand the package . But many small packages used in large packages do not contain these readme files, I do not worry too much about it, if you are working the main package properly and can be trusted.

python - While is not working with 'and' and 'or' -


  while (bulbsacar [0]> gt;) or (magician [0]> 0): # I get an EOF error here (bulbsure [0]> 0) or (magician [0]> 0) # and here is a syntax error   

Does anyone know that work How to do it while doing or with

In the first example, . If you need an empty loop, then there can be anything, when you can use pass :

  (Bulbsure [0]> ; 0) or (Magician [0]> 0): Pass   

In the second example, you are missing : to start a new block .

For reference:

) Or (x == 'b'):

While running it in Python 2.7, I get an "estimate of an indent block".

Android ActionBarSherlock style selected action item -


मेरे पास एक ViewPager है और प्रत्येक पृष्ठ एक फोटो प्रदर्शित करता है मैं एक विभाजित एक्शनबार को पसंद / नापसंद एक्शन के साथ दिखाता हूं, ताकि उपयोगकर्ता 'फोटो' या 'नापसंद' को वोट कर सके।

मैंने सफलतापूर्वक प्रत्येक के लिए वोट सुविधा को लागू किया फोटो।

समस्या :

मैं प्रत्येक तस्वीर के लिए चुने गए वोट को किस प्रकार शैली देता हूं? दूसरे शब्दों में, मैं तस्वीर की वर्तमान स्थिति के आधार पर MenuItem आइकन कैसे बना सकता हूँ?

आपको एक तस्वीर बनाते समय पता लगाने के लिए बूलीयन बनाना चाहिए, फिर setIcon को अपने मेनूइटम पर कॉल करें। > <पूर्व> अंतिम MenuItem = YOUR_MENU.findItem (THE_LIKED_ACTION_ID) पसंद आया; यदि (पसंद किया गया है) () पसंद है .सेट आईकॉन (YOUR_LIKED_DRAWABLE); } अन्य {पसंद है .सेट आईकॉन (YOUR_DEFAULT_LIKED_DRAWABLE); } MViewPager.setOnPageChangeListener (नया ViewPager.SimpleOnPageChangeListener () {@OverridePage पर सार्वजनिक शून्य से चयनित (int स्थिति) {invalidateOptionsMenu ();}});

google chrome - .deb installer (linux) dependencies. What if it's not in the repository? -


I would like to install my application with Google Chrome itself, I just use google- Chrome-stable added a dependency name and it works.

However, this only works when the Chrome storage in the target machine (which is not, for example, setting a clean Ubuntu)

is there any way to resolve it? is? Can I somehow specify the URL or any other data that enables Linux to solve the dependency? The problem with google-chrome chromium-browser

which is in the repository.

I do not think it is possible to automatically add another repository to fulfill your package dependencies. You can add the requested dependency in your package (if it slides) or to tell the user to fail to install the installation, to add the stock and how to add it. For example, a good how to install it guide on your package web-site.

Cannot remove temp directory after VS 2010 installation -


मैं एक सफल वीएस 2010 स्थापना के बाद अधिष्ठापन तार्किक निर्देशिका "19 ए 5e95b7185dd381eea" और उसकी सभी उप निर्देशिका नहीं निकाल सकता। ओएस विन 7 एसपी 1 है मेरे पास व्यवस्थापक विशेषाधिकार हैं I मैंने इसे बिना किसी लाभ के सुरक्षित मोड में निकालने का प्रयास किया। मैं इन निर्देशिकाओं को हटाने के लिए विशेषाधिकारों को नहीं बदल सकता। यह केवल निर्देशिका को पढ़ता है यह अनदेखी करने के लिए काफी बड़ा है मैं इसे कैसे हटा सकता हूं?

समाधान:

डेरेक के सुझाव के आधार पर, मुझे खुद को सब उप-निर्देशिकाओं के स्वामी के रूप में अलग-अलग जोड़ना पड़ा। यदि रूट पर करने का कोई तरीका है, तो क्या आसान होगा स्वामित्व दिए जाने के बाद, सभी निर्देशिकाओं को हटाना संभव था।

माइक्रोसॉफ्ट को VS2010 के लिए एक उचित तैनाती का निर्माण करना चाहिए जो बाद में खुद को साफ करता है!

आप अपने आप को निर्देशिका का स्वामित्व बदलने की कोशिश कर सकते हैं यह संभव है कि निर्देशिका किसी अन्य व्यक्ति (जैसे सिस्टम) के स्वामित्व में है और क्योंकि आप इसे स्वयं नहीं रखते हैं, आप इसे हटा नहीं सकते। यह कम से कम एक प्रयास के लायक है।

डेरेक

java - Saving JTextPane's contents into ordinary text file fails -


मेरे पास कोड का एक हिस्सा है:

  निजी शून्य बचाने के लिए () {CDocument currentDocument = ।। this.panelMain () openedDocuments () मिल (this.panelMain () openedDocuments () आकार () - 1।।); स्टाइल डॉक्यूमेंट सामग्री = वर्तमान डॉक्यूमेंट। गेट स्टाइल डॉक्यूमेंट (); DefaultEditorKit किट = नया DefaultEditorKit (); JFileChooser chooserSaveAs = नया JFileChooser (); ChooserSaveAs.setDialogTitle ("इस रूप में सहेजें ..."); अगर (chooserSaveAs.showSaveDialog (this) == JFileChooser.APPROVE_OPTION) {स्ट्रिंग strNewFilename = chooserSaveAs.get चयन करेंफ़ाइल ()। GetName (); BufferedOutputStream आउट; कोशिश {बाहर = नया BufferedOutputStream (नया FileOutputStream (strNewFilename)); Kit.write (बाहर, सामग्री, सामग्री। GetStartPosition ()। GetOffset (), contents.getLength ()); out.close (); } पकड़ (IOException | BadLocationException पूर्व) {Logger.getLogger (CFrameMain.class.getName ())। लॉग (Level.SEVERE, null, ex); एक बार निष्पादित करने के बाद, यह कोड किसी भी अपवाद उत्पन्न नहीं करता है, लेकिन मैं कहीं भी डिस्क पर सहेजी गई फ़ाइल नहीं ढूँढ सकता (मैं कुल कमांडर के साथ स्थानीय डिस्क के माध्यम से खोज की है)। कोई फ़ाइल उत्पन्न क्यों नहीं है? मैं वर्तमान में विंडोज 7 अल्टीमेट पर काम कर रहा हूं और मैंने लॉग इन उपयोगकर्ता के डेस्कटॉप में सहेजने की कोशिश की है (संभव पहुंच उल्लंघन समस्याओं के कारण) ...   

फ़ाइल को नाम न प्राप्त करें और इसे सही स्थान पर सहेजा जाना चाहिए।

इसके अलावा आप यह देखने के लिए फ़ाइल का पूर्ण पथ लॉग आउट कर सकते हैं कि यह कहां है। <पूर्व> फ़ाइल फ़ाइल = चुनेदार सेवएस्जसेटसेलेक्टेडफ़ाइल (); Println (file.getAbsolutePath ()); FileOutputStream fos = नया FileOutputStream (फ़ाइल);

javascript - jQuery issue with removing lines from block of strings -


मुझे स्ट्रिंग की निम्न पंक्ति मिल गई है:

  aaaaaaaa1 bbbbbbb2 cccccccc3 dddddddd4   

और यह मेरा फ़ील्ड है:

  & lt; textarea id = "myLinesField" & gt; & lt; / textarea & gt; JQuery का उपयोग करने के बाद, मैंने कहा है कि मैं किसी भी लाइन को चुनने और हटाने (किसी भी क्रम में) कर रहा हूं, मैं अपनी लाइनों से विशिष्ट लाइनों को हटाने की कोशिश कर रहा हूं, दूसरी पंक्ति का सही परिणाम है जैसा कि निम्न है:  
  aaaaaaa11 cccccccc3 dddddddd4   

यह मेरा कोड है:

  var मान = $ ('# myLinesField ') वैल ()।; Var newVal = recipientValue.replace (stringLineToBeRemoved, ''); Var अंतिम परिणाम = newVal.replace ("\ n", ""); $ ( '# MyLinesField') वैल (finalResults)।   

लेकिन कुछ मामलों में मुझे ऐसा कुछ मिलता है (हमेशा नहीं):

  aaaaaaaa1cccccccc3 dddddddd4   

क्या कोई भी मुझे बताओ मुझे यहाँ क्या याद आ रही है?

धन्यवाद,

इसे आज़माएं:

जे एस:
  jQuery (समारोह ($) {$ ( "# btnSubmit") पर (। "क्लिक", समारोह () {var मूल्य = $ ( '# myLinesField') वैल ();। (। $ ( "# strToRemove") वैल (), '') वर newVal = value.replace; वर finalResults = newVal .replace ("\ n", ""); $ ('# myLinesField')। Val (अंतिम परिणाम);});});   

एचटीएमएल:
 <कोड> & lt; पाठ क्षेत्र आईडी = "myLinesField" शैली = "ऊंचाई: 100px; चौड़ाई: 100px;" & gt; aaaaaaaa1 bbbbbbbb2 cccccccc3 dddddddd4 & LT; / पाठ क्षेत्र & gt; & Lt; br / & gt; & Lt; br / & gt; दूर करने के लिए स्ट्रिंग दर्ज करें: & lt; इनपुट type = "text" id = "strToRemove" & gt; & lt; / इनपुट & gt; & Lt; इनपुट प्रकार = "बटन" id = "btn सबमिट करें" मान = "सबमिट करें" & gt; & lt; / input & gt;    

certificate - Remove iOS App that is Ready For Sale -


My question is simple: Is it possible to remove my app from iTunesConnect, which is ready for sale?

I've submitted a buggy app and want to update it using various mac. By mistake I did not back up my certificate and other important stuff from my old Mac. So I think the only workaround is to present a new app using different bundle names and SKUs. The problem is whether to remove my existing app from iTunesConnect, which is ready for sale?

In iTunes Connect,

  • Manage your apps
  • (the app you want to delete)
  • Right & amp;
  • Unselect all countries
  • Save

    This will remove it from sale.

model - How to embedd a 3D cloth on human body using Kinect and XNA -


मैं किनेक्ट और एक्सएनए के साथ वर्चुअल ड्रेसिंग रूम टाइप प्रोजेक्ट कर रहा हूं लेकिन मुझे नहीं पता कि शरीर के शरीर को कवर करने के लिए एक 3D मॉडल को कैसे मैप करना है। मैंने Avataaring-XNA नमूना की कोशिश की है और पृष्ठभूमि को Kinect से आने वाले वीडियो के रूप में जोड़ा जा सकता है। लेकिन बात यह है कि 3 डी मॉडल (ड्यूड.एफबीएक्स) मानवीय वास्तविक शरीर से नहीं बढ़ रहा है और पूरे शरीर को कवर नहीं कर रहा है।

हो सकता है कि यह कोई भी मदद की बहुत सराहना की जाएगी।

इससे मदद मिलेगी आप जिस मॉडल को पसंद कर रहे हैं, उस मॉडल को बदल सकते हैं, मैंने कोशिश की है और यह पूरी तरह से काम करती है। आप का उल्लेख करते हैं कि आपने किनेक्ट से आने वाले वीडियो के रूप में पृष्ठभूमि को जोड़ दिया है, मैं अग्रभूमि में 3 डी मॉडल और पृष्ठभूमि में वीडियो डेटा जोड़ना चाहता हूं, क्या आप उस पर मेरी सहायता कर सकते हैं?

android - Intermittent click when stopping AudioTrack playback -


I am using AudioTrack in the streaming mode to stop the playback of a small section of a WAV file 5-10 About one of the bars, I hear a click noise. This is driving me crazy because I can not continually reproduce it. I have tried various combinations of calls in AudioTrack.flush (), AudioTrack.pause (), and AudioTrack.stop () before calling AudioTrack.release (). I have also tried to call AudioTrack.setStereoVolume () and pass the result of AudioTrack.getMinVolume (). Nothing has worked.

Some comments:

  • It seems that when I run a small section of a wav file when I play audio more than 3 seconds then I can re- Can not produce
  • Occasionally, AudioTrack.write () Returns-22 When I'm writing the end of audio data I did not find any specific details for Javadock-22. In addition, this case does not always match with the click.
  • The click is not continually reproducible, even if I resume the same part of the waive file.
  • The click volume may come out of the right or left, but not both.

    I'm looking at Android 4.0.3 running on Acer Iconia A500. I appreciate any suggestions. POP probably because this song has ended at a very high specimen, and then suddenly becomes 0. . This causes a 'pop' noise. Get the song disappeared even during a second 0.01.

    Going from 0 to the high spec, the pop seems like this:

JQuery Mobile css doesn't work after ajax call even with (.listview("refresh")) -


Even after making Ajax calls, the page Jqumobile css was lost, even when I added:

  $ ("# idlist") list view ("refresh").;   

In my code:

  $ (document) .ready (function () {var display = $ ("# displaydata"); function displaydata () {$ .ajax ({krossdaman: true, type: "GET", data: "liahat == suku", url: "server.php", success: function (data) {display.html (data);}}) ;} Show info ();}); I have called PHP data, here is my PHP code:  
  if (isset ($ _gET ["lihat"]) == "suku ") {$ Tampil = mysql_query (" Choose from desktop "); Echo "
    $ r [suku] "; Echo "& lt; / ul & gt;"; Here is a suggestion:

    You

    ($ _GET ["leahat"]) == "suku") {$ tampil = mysql_query ("Select 'from descriptus''); $ String =" & lt ; Ul id = 'ul' data-role = 'list view' data-inset = 'true' data-filter = 'right' data-filter-placeholder = 'Cari suku besar ...' & gt; ; While ($ r = mysql_fetch_array ($ tampil)) {$ string = "& Lt; li & gt; $ r [suku] "; } $ String = "& Lt; / ul & gt;"; Echo $ string; }

    After adding the response data, add the code below to your AJAX success function:

      $ ("# idlist"). Listview () .trigger ("create");   

    Enjoy ...

sqlite3 - SQLite Query to group continuous range of numbers into different grouping sets -


I want to get the islands of this table below:

  Group members no 100 A 101 a 200 A101A202A203X100X101A204X301X302A500A600   

I want to use this result on the SQL (islands):

  GroupMeelNewsNumberA 100 101A 200 204X100 101X301 302A 500 500A600 600   

I have seen many code / forums for this, but not Working with SQLite because SQLit There is no CTE in e.

100-101 is constant so that the group is in one.

Does anyone have to do this in SQLite?

The fastest way to do this is to move the serial record of this table into a loop and collect Do the islands manually

Pure SQL (as a set-oriented language), it's not that easy.

First of all, we find out which records are the first in any island. The first record does not have a previous record, i.e., a record with the same group but not a member a small:

  SELECT "Group", MemberNo AS FromMemberN T1 where this table does not exist (Select from this table 1 T2 WHERE T 2. "Group" = T. "Group" and T2 .mail No = T 1. No member - 1)   

To find the last record of an island, we need to find the record with the largest not a member which is still the same island It is related, that is, the same group, and where there are all not members in the island, we can not consistently compute the difference between their values ​​in the first and last records; Code> find out. The last no member of the island can be calculated in this way with the group g and first MemberNo M

  select MAX (not member) is not the last meeting as T3 WHERE T3 as the TAL "Group" = G and T3 .mailo - M + 1 = (SELECT COUNT (*) TLL to T4 WHE T4. "Group" = G & T 4. Not with MMN and T3.MMNL) < / Code>  

Finally, plug it into the first query:

  SELECT "Group", MemberNo AS FromMemberNo, ( In this number select Max (member no) AS T3 WHERE T3. "Group" = T. "Group" and T3 .Mailo - T1.MemberNo + 1 = (SELECT COUNT (*) T4 WHERE t4 from this table Last Month as "Group" = T1 "Group" and t4.MemberNo t1.MemberNo and t3.MemberNo) This Table AS t1 WHERE NOT "Even From this table, select 1 to TT2 WHERE T2.

openssl - rsa encryption decryption using c -


I am trying to write c code for encryption and decryption by using open SSL. But I am not able to do this. I went to it, but whatever code received from the internet was out of my head. The main function goes here that I got from the stack overflow. I tried to use it ?? But | I could be bad

  Encrypt (FILE * rsa_Pkey_fole, FILE * in_file, FILE * out_file) {} int main (int argc, char * argv []) {FILE * rsa_pkey_file, * infile; Int rv; If (argc & lt; 2) {fprintf (stderr, "Usage:% s & lt; PEM RSA public file & gt; \ n", argv [0]); Exit (1); } Rsa_pkey_file = fopen (argv [1], "rb"); Infile = fopen (argv [2], "w"); If (! Rsa_pkey_file) {perror (argv [1]); Fprintf (stderr, "PEM RSA Public Error loading file. \ N"); Exit (2); } RV = Encrypt (RSA_PP_FILE, INF.TXT, standout); Fclose (rsa_pkey_file); Return RV .; }   

and similarly decryption.

How can I make the RSA encryption and decryption of the file using CRM open SSL library in an easy way? The steps for RSA encryption are as follows:

  1. Read the public key in the RSA * structure. It depends on your main nature. If the key is in the format PEM , then use the PEM_read_RSA_PUBKEY function. If it's in the DER form, then use d2i_RSA .
  2. Encrypt your data using the RSA public key. RSA_public_encrypt function.
  3. Write a file or type what you want to do.

    RSA decryption steps are as follows:

    1. Read the private key in the RSA * structure . This is similar to Stage 1 in RSA encryption with some minor differences.
    2. Decrypt the data using RSA_private_decrypt . Use RSA_private_decrypt .

      You can see the OpenSSL documentation which is quite useful and its knowledge is intuitive. I just give you a broad level of consideration if you need more help, then I posted the code example I can do

javascript - Recommendations for dropdown menu items that are too wide? -


What kinds of options do I encounter while facing a dropdown menu, which is so wide that the menu width adjusts Is not possible for? That means the page breaks the layout, or looks just ugly if the dropdown is adjusted to fit for a long time.

Hooks? Cut plus full hover text?

Thank you. I agree with Gordonby in relation to reducing options can be difficult to read. Extremely long alternatives,

And as you said it looks awful.

If your dropdown is populated by user input, however, I can restrict length. What can be said with 15 words should be said with 5 ... If this can not happen, then maybe a dropdown is not your best choice. For example, if your option is the title of research papers and their authors, you can probably summarize them in some key words ("String Theory and You [Brown 2008]") On the other hand, if the option itself is different from some words And that is, if they become smaller (like "peanut butter and grapefruit sauce and jelly sandwich of grapes with soy milk" and "peanut butter and boy Saberi jelly carrot rods and sandwiches with 2% milk) "You may be able to display all the options alternately, display it properly with a checkbox or radio button.

(If you are using ASP.NET, basically I'm using a criminal instead of a dropdown list)

This second approach gives you other elements You can also allow to include that you will not be able to dropdown. Take a look for ideas.

dependency management - How does composer deal with shared dependencies by multiple packages within one project? -


According to the questions, if Project A is X, Y & amp; Z packages they, in return, are D1, D2, D3, D4 and O. D5 package is the composer D1, D2, D3, D4 & amp; D5 x, y and z packages for three times?

It looks logical but is not particularly practical if D1, D2, D3, D4 and AP The D4 package requires another set of shared dependencies .... It will have a lot of duplicate code inside a project code base.

Thanks in advance

short answer is not loading from PHP The time is impossible, because it does not make sense to download dependencies independently per package. Therefore, the composer will solve all the dependencies for all of your packages, and then install them once without duplication.

c# - Hiding default gray column in datagridview winform -


What data is not available when there is a way to remove or hide the gray area of ​​winform's datagrid?

The second is how to delete / hide the default gray column?

  dataGridView1.DataSource = oresult; DataGridView1.Column ["Id"]. Visible = false; DataGridView1.Column [[AddBy]]. Visible = false; DataGridView1.Column ["AddInInClass"]. Visible = false; DataGridView1.Column ["IsDeleted"]. Visible = false; DataGridView1.Enabled = false;   

I'm hiding such unnecessary columns, but I'm unable to find a way to hide them.

Enter image details here

You can hide the first column of your datagrid to set

.net - Regular expression to allow alphanumeric, max one space etc -


I am opening this thread which is exactly like any other but I can not understand any problem: I have a The input field that allows the alphanumeric string to be substituted with optional split space as a separator, then an alternate other alphanumeric string etc .... I am getting this regex:

  ^ ([0- 9a-zA-z] +?) * $   

This works! But the performance is very bad as soon as I have 2 hundred empty spaces and those 2 spaces are very far in the sentence. In the example given below, the result is fine in the second half if I put 2 places at the beginning of the sentence. But it lasts for 10 seconds or longer, then is located away.

Dzdff5464zdiophjazdioj ttttttttt zoddzdffdziophjazdioj ttttttttt zoddzdffdzdff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zoddzdfff Ttttt zo999 ddzdfff Ttttt zoddzdfff Ttttt zoddzdff

2 The spaces are after 999 . Do you have any ideas or suggestions for improving this reggae?

Thanks and relation

pf

ps: As soon as you enter, invalid characters in the string are not yet, especially 2 spaces.

Edit: Another example: 12345678901234567890 '==> 20 characters + 1 invalid character = & gt; The result is 5 valid four pairs of instant and it lasts 5 seconds to regex! I suggest changing the expression like this: (? I) ^ [0-9a-z] + (?: \ S [0- 9a-z] +) * $

 Enter the image details here

This is functionally similar, because it will match all alphanumeric characters, which Are only demarcated from the place. One major difference is that I took the initial word check to the expression, then the non-capture group (?: ... ) for the remaining space

non-capture group (?: ... ) are rapidly capturing group ( ... ) because the regex engine does not need to maintain the matched values. And on repeating words, the engine does not need to validate that by transferring the space \ s to the word group, the first character in the group is included in the square class.

You must have a typo in your character class [0- 9a-zA-z] last z , perhaps the upper case should be < There will be some strange unexpected results in the code> e-z format. In my expression, I initially compelled to add a code <(code) (? I) , in which case the case of insensitive mode was changed, and I changed the square class to [0 -9a-z] .

In my trial, I think your expression ^ ([0- 9a-z] +?) * $ takes about 0.03 seconds to process your sample text My recommended expression completes the same examination in approximately 0.000022 seconds with 2 extra locations towards the end. Wow, this is a wonderful delta.

c# - how to implement while loop for processing when clicking -


I hope you can help me with this problem. When I click on an email button, before successfully sending it, it takes a few seconds to process. I need to insert the process image but how to implement it with the "while" loop for processing.
Here is the code: I think I should apply with the customer. Send (msg); for processing. how does it work? I appreciate your example code thanks! (I am using C # and WPF)

  Private Zero BtnSendEmailClick (Object Sender, RoutedEventArgs e) {SmtpClient Client = Zero; Mail message msg = null; {Msg = new mailmessage {{try new mailorder ("me@hotmail.com", "Me Hotmail")}; Msg.To.Add (txtEmailAddress.Text); message. Priority = Mail Preference High; Msg.subject = "Blow Blah"; Msg.Body = "& lt ;; DOCTYPE html> gt; html lang = 'n' xmlns = 'http: //www.w3.org/1999/xhtml'>" + "& Lt; head> gt; & lt; / head & gt;" + "& Lt; body & gt;" + "& Lt; h3> messages & lt; / h3 & gt;" + "& Lt; p & gt;" + LblEmailMessage.Content + "& lt; / p & gt;" + "& Lt; / body & gt;" + "& Lt; / html & gt;"; Msg.IsBodyHtml = True; Client = New SmtpClient {host = "smtp.live.com", port = 25, EnableSsl = true, UseDefaultCredentials = false, credentials = new network credentials ("me@hotmail.com", "password"), DeliveryMethod = SmtpDeliveryMethod. Network}; // How to implement when looping for the processing client Send (msg); LblMessage.Content = "Your mail has been successfully sent!"; } Hold (Exception pre) {lblMessage.Content = ex.Message; }}    

You will need to return immediately, and BackgroundWorker Once it's finished to send an email, you can use the Dispatcher to notify the GUI. For more information, see.

Also see.

Python "in memory DB style" data types -


I am creating a weather station using a raspberry P I have various sensors (temp, humidity, pressure, rain, etc.) ) And now I'm getting the process of wind sensor for me.

I have a dragon program which looks at the GPII pin, calculates the pulse to calculate the anomometer and the speed of the wind, to get this direction, through the anchorage of air through the ADC Also reads. For other sensors, I only process every few minutes and dump data directly to DB. Because I have to calculate a lot of things from wind sensor data, I do not necessarily want to write DB in every 5 seconds and then to read the data of the last 5 minutes to calculate the current speed and direction. I want to gather data in memory, processing it, then writing the last data in DB is something like sensor reading:

day-time, speed, direction = 2013-6-20 09 : 33: 45, 4.5, W 2013-6-20 09:33:50, 4.0, SW
2013-6-20 09:33:55, 4.3, W.

The program is calculating every 5 second data from the air sensor, I would like to write the data to DB every 5 minutes because the DB is on an SD card, I do not want to explicitly write DB 60 times, Then read it back to process it, then write it in permanent archival db every 5 minutes.

Am I better using the list of lists? Or a dictionary of Tuples made by datetime?
{datetime.datetime (2013, 6, 20, 9, 33, 45, 631816): ('4.5', 'W')}
{datetime.datetime (2013 (6, 20, 9, 33) , 55, 3872 9 4): ('4.3', 'W')}

For the latter, what is the best way to update a dictionary? Do I have it in a DB Leave it and read it back? It seems that one reads a lot for such a small number of data a day.

Multiple cache Layers Between Python Programs and Databases Specifically, Linux Disk Block Cache Usage Depending on the pattern of, you can keep your database in the core. Therefore, you should not believe that writing in a database and reading back is necessary to slow down some home-made cash in your application. And the code that you write to optimize your DB prematurely is going to be infinitely more buggy than the code.

For the workload you specify, MySQL M Zhe little Heavyweight relative SQLite, but you may be unsure of the reason for it.

multithreading - WinAPI text output in C -


I am quite new to WINAPI, and I need some help in text output. I have an array of pixels that I type in with the function and then from time to time I bluetooth on the screen using the following functions:

  DWORD WINAPI tickThreadProc (handle handle) {ShowWindow ( Hwnd, SW_SHOW); HDC HDC = GETDESSY (HWD); HDCMM = Content compatible DC (HDC); HBITMAP HBMeld = (HBITMAP) Selection Object (HDCMM, HBMP); Int delay = 1000 / fps; InitPhys (); LoadIMGs (); For (;;) {onFrame (pixel); Bitblatt (HDC, GLIFT, GTOP, width, height, HDCM, 0, 0, SRCCOPI); // Wait slept (delay); // Physics Symphies (); } Select Object (HDCMM, HBMold); DeleteDC (hdc); Return 0; } Vs. MacSaPhase (HWNH HWD) {bitmapinfo BMI; Bmi.bmiHeader.biSize = sizeof (BITMAPINFO); Bmi.bmiHeader.biWidth = width; Bmi.bmiHeader.biHeight = HEIGHT; // Top pixels from top to bottom bmi.bmiHeader.biPlanes = 1; Bmi.bmiHeader.biBitCount = 32; // Not using previous bytes, 32 bit bmi.bmiHeader.biCompression = BI_RGB for alignment; Bmi.bmiHeader.biSizeImage = 0; Bmi.bmiHeader.biXPelsPerMeter = 0; Bmi.bmiHeader.biYPelsPerMeter = 0; Bmi.bmiHeader.biClrUsed = 0; Bmi.bmiHeader.biClrImportant = 0; BMI.BM color [0]. RGb 0 = 0; Bmi.bmiColors [0] .rgbGreen = 0; BMI B.B.Colver [0]. RGBRED = 0; BMI.BMI collar [0]. RGB reserved = 0; HDC HDC = GETDESSY (HWD); // Always create a box compartment to dial. Direct access to pixels HBMP = playback (HDC, BMI, DIB_RGGOLAS, (zero **) and pixels, faucet, 0); DeleteDC (hdc); // Create a new thread to use as a timer hTickThread = CreateThread (NULL, 0, and TickThreadProc, NULL, 0, NULL); }   

Some codes found on the Internet have been modified. I have 4 ints for R, G, B, and A in pixel structure.

It is impractical to output text and load images for text. Any help?

First of all, if you use GetDC to handle the device reference, you should Use ReleaseDC when you will do it with DeleteDC for only for device references created by you.

To draw text in this window, you can use the function before using that DC or using it.

Painting is meant to handle WM_PAINT messages (which is a more common way to attract in a window) It seems that you are trying to draw directly from another thread on a regular basis instead Are there. GDI is not very good in dealing with multiple threads, so you may have some problems with this approach, but if your bitsbets are working then one textot should also work.

c# - why begintime in alarm should not be DateTime.Now? -


I was an exception when making an app using an alarm but unfortunately I did not know the answer. Alarm = New Alarms (Title Box. Text); //alarm.BeginTime = DateTime.Now; Alarm.BeginTime = DateTime.Now.AddSeconds (5); Alarm. Resource = "Alarm set for note. Please check it now."; Alarm. End time = end time; Alarm. Repetition type = recurrence interval.No; IsAlaramOn = True; ScheduledActionService.Add (alarm);

An exception occurs when the start time is datetime. Now? Why do I need to add a few seconds?

Although I'm not familiar with Windows Phone 7 development, I think, logically, Alarms will not accept the current time because the code running at the time starts from the alarm time, even some milliseconds.

If you think about it, then the computer thinks in an era, not in hour / minute / second. Therefore, even if a millisecond pass, because the alarm was set to "now", then the alarm is past.

Microsoft developers have set up an alarm class for this alarm, the alarm is set to "now", due to that discrepancy, possibly because the alarm will not fire retro (if this fire If a fire has been set in the past, then it is necessary to provide them for determining if this happens, for very little profit.)

Again, though, I'm not familiar with Windows Phone 7 Platforms If one has the contrary, please contribute!

shell - Calling "grep" and "head" from PHP -


I am trying to filter the contents of a set of files in the directory and before using this kind of command only Output N line:

  gzip -dc $ (% path-find folder% s) | Grep 27990 | Head-n 50   

In the terminal, this command takes you to complete a few seconds to run. But when I run it from PHP it takes about an hour, because the total size of the files seems to be larger, like php is waiting until the gzip command is over. But if I run simple:

  gzip -dc $ (find / opt / data / bi / ets / 20130616). Head-N50   

This results in immediate results. I tried backquotes, exec, system.

Here is the php code:

  $ cmd = 'gzip -dc $ (' find '$ path.' | Grep -E "'.' $ Regexp. ' "). Grep -E "'. $ This- & gt; _buildRegExp ().' $ '[' Border ']; $ Res = `$ cmd`;   

How to fix it?

Instead of using passthru to get all the output, not only the last string

  ($ CMD , $ Output); $ output echo;    

html - Why does the general-sibling combinator allow toggling pseudo-element's content, but not the adjacent-sibling? -


In this question, "I am using a input , Type = "checkbox" to toggle the display of an element.

This is the HTML of the demo posted in that reply:

 < Code> & lt; Input type = "checkbox" id = "switch" /> gt; & gt; & lt; h2 & gt; This will be the 'navigation' element. & Lt; / h2 & gt; For Lt; / ne & gt; label = "switch" & gt; toggle navigation & lt; / label & gt;   

and CSS (sort for short With transition):

  #switch {display: none;} #switch + nav {height: 0; hidden collapse; / * modified * /} # swiss: checked + NAV (height: 4 AM; color: # 000; background color: # FAA; / * after the change * label} {cursor: indicator}}   

.

Once I had posted the answer, I did that also after modifying the text of the label for the following selectors ('Navigation' ) To trigger the state-change of that checkbox The labels to use :

  label {display: inline-block; Cursor: indicator; } #switch + nav + label: before {content: 'show'; } # Swiss: checked + ava + label :: first {content: 'Hide'; }   

.

It was not working, at that time when the selector matched, while Input was in its arbitrary state (and label shown Show Navigation ), when the status of Input has changed to the selector failed match, note that the change is still on the nav element Were impressed, and the original matching selector indicates that the next-season co-ordinator basically matches. The above link shows a simplified demo of selectors in non-working (Chrome 27 / Windows XP).

To minimize the selector-chain, it happens to me to try the common-brother coordinator. As a result, the following CSS (with a reflection for short):

  #switch: checked + nav {background-color: #ffa; } Labels {Display: Inline-Block; Cursor: indicator; } #switch ~ label :: before {content: 'show'; } #Soft: Checked ~ label :: first {content: 'Hide'; }   

.

To my extent, this work changed ( content to label in response) changed to input In stage)

So, the question: Why do common-brothers allow associate to update later brother-in-law, while the next-child mating (who matches the elements and structure of the DOM) does not?

Next, it does work in Firefox (21, on Windows XP); So I think the question has changed slightly to include: Is this a bug in Chrome / WebKit, or expected behavior?

And, even Forward , it seems that this is a bug in Chrome (thanks @ ballclock), to some extent a ridiculous non-working Fixes the demo (though other, perhaps better, options exist as Scott's response):

  body {- WebKit-Animation: Bugfix Infinity 1S; } @ -webkit-keyframes bugfix {to {padding: 0; } To {padding: 0; }} # Swiss {} # Swiss + NAV {-Mozy-Transition: All 1S Linear; -MMS transition: all 1s linear; -O-Infection: All 1s linear; Webkit-Infection: all 1s linear; Transition: All 1s linear; } # Swiss: check + avu (background-color: #fa-moz-transition: all 1s linear; -mms transition: all 1s linear; -o-transition: all 1s linear; -webkit-infection: all 1s linear; infections : All 1s linear;} label {display: inline-block; cursor: indicator;} before #switch + nav + label: {content: 'show';} # swiss: checked + ava + label :: first {Content: 'Hide';}   

. Note: The reason for this is that I am updating it with 'fix', reply to it Instead of posting in the form, only because the question was not "how can I fix it?" But (basically) "Why does not this work?"

This is a long time running bug webkit browsing is related to the use of some dynamic pseudo-squares, with the next-generation couples It happens, is it that you are implementing the styles of brother-sister elements or the proxy element of that brother element.

I do not know that no one has filed a bug report yet, but it has been seen instead of on the site:

  • It was also surprisingly even that Chrome was on the issue with common brother associator, but you note that it works in your scenario:

    • So either it was fixed, or something else went / triggered.

ios - Can't back out of ABUnknownPersonViewController when adding person -


I'm having a problem ABUnknownPersonViewController is embedded in a navigation controller at the top, however, I use the navigation bar in my app:

  ABUnknownPersonViewController * Unknown PersonViewController = [[ABUnknownPersonViewController alloc] init]; Unknown PersonViewController.displayedPerson = (ABRecordRef) [Build Build Contact Contact]; UnknownPersonViewController.allowsAddingToAddressBook = Yes; UnknownPersonViewController.unknownPersonViewDelegate = self; UINavigationBar * navBar = [[UINavigationBar alloc] initWithFrame: CGRectMake (0, 0, [UIScreen main screen] .bounds.size.width, 41)]; NavBar.delegate = self; UINavigationItem * backItem = [[UINavigationItem alloc] initWithTitle: @ "back"]; [Navbar Push Navigation Item: Animated Backlight Animated: No]; UINavigationItem * topItem = [[UINavigationItem alloc] initWithTitle: @ "Your Title"]; [Navbar Push Navigation Insom: Top Ietam Animated: No]; TopItem.leftBarButtonItem = Zero; [Unknown PersonViewController.view adsview: navBar]; [Self. Navigation controller Push ViewController: Unknown PersonViewController Animated: Yes];   

Then it adds to a navigation bar, but the back button does nothing by changing the heading 'Title' ... very helpful additionally, no border of my navigation bar at the top Not so, I'm having some difficulty ... Images below ...

The navigation bar programmatically Added

 to return a minor problem while trying ... lol

You can try to present it in such a way. I'm not using a navigation bar in the main view. This will add a cancel button to the top left.

  ABUnknownPersonViewController * view = [[ABUnknownPersonViewController alloc] init]; See.View unknownView = self; // See the person's recorded data view.DisplayedPerson = person; See. AddingAdvertiserbook = Yes; UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController: view]; View.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemCancel Target: Auto Actions: @selector (Disarktactactiview) ;; [Self present ViewController: animated nav: yes complete: zero];    

javascript - Creating a timeline with a bar chart in Google Charts? -


I want to create a timeline with Google charts to show the duration, repetition, and overlap to show the event. Each line should be a new event and the column time should increase.

I see, though, and do not think what I want - not only is the length of a horizontal strip, but there are many ranks in the same line (non-overlapping) .

Is it possible with Chrome or any other free chart library?

Edit: I want to produce a chart similar to the one below Enter image details here I was 100% convinced that I can rebuild it in Google Visualization, But I do not know I have fallen for a while because of a strange behavior (red line marking date) If you can solve that problem, then the rest is very good. And looks like this: </ p> <p> <img src =

code here Is:

  function drawVisualization () {// Create and generate data table Var data = new google.visualization.DataTable (); Data.addColumn ('string', 'assignment'); Data.addColumn ('Date', 'Dummy'); Data.addColumn ('Date', 'Current Assignment'); Data.addColumn ('Date', 'Dummy'); Data.addColumn ('Date', 'Next Assignment'); Data.addRows ([['Uranus', New Date (1298-2464000), {v: New Date (26082800000), f: '2 / 21-12 / 20'}, New Date (0) {V: New date (0), F: '1 / 0-1 / 0'}], ['Thomas Lamontzi', new date (1297036800000), {v: new date (6393600000), f: '2 / 7-4 / 22 '}, New Date (0), {v: New Date (0), F:' 1 / 0-1 / 0 '}], [' Shu Li ', New Date (0) {V: New Date (0), F: '1 / 0-1 / 0'}, New Date (1303689600000), {v: New Date (2937600000), f: '4 / 25-5 / 29'}] , [V] New date (4579200000), f: '2 / 21-4 / 15'}, new date (0), {v: new date (0), ['satin', new date (1298246400000) , F: '4 / 4-4 / 22'}, New York: Date (259200000), {v: New Date (2160000000), F: '4 / 25-5 / 20'}], ['Ric Maverick', New Date (1302652800000), {v: New Date (2592000000), F: '4 / 13-5 / 13 '}, new date (0), {v: new date (0), f:' 1 / 0-1 / 0 '}],]); // chart for date date date var dateMin = new date (2010,11,1); Var dateMax = new date (2012,0,1); Var date = new date (2012315); // Create and draw visualization. New google.visualization.BarChart (document.getElementById ('visualization')). Drag (data, {width: 600, height: 400, true: true, series} [[color: 'transparent'}, {}, {color: 'transparent'}, {}], hxis: {view: {max. : Date Max, Min: Date, Minute, Baseline: Date Today, Baseline Color: 'Red',},}); Basically, you create 4 series:  
  1. Dummy series (time till first assignment)
  2. The duration of the first assignment
  3. Dummy series (
  4. The second assignment period

    Then you can set series 1 and 3 invisible.

    For data, you have to calculate some dates (I did excel in Excel), but basically you get the duration by decreasing the start / end date for each assignment, and set it Dummy as the date of introduction of the second workgroup with the first assignment as well as the period of the first assignment.

    I do the {value: x, format: y} move the mouseover to work properly, you can automate it (again, because I used to store the data in Excel My javascript used to take much longer).

    Then the settings set the minimum date, the maximum date, the range is considered appropriate color, and the base line is set in red. Unfortunately, for reasons beyond my understanding, baseline does not matter That date set wants to be on the left side of the chart. If you can find a way around it, then your chart is there.

Zend-Framework 2 pagination join tables -


मुझे इस कोड में एक अंक लगाना चाहिए:

  $ select = new \ zend \ Db \ Sql \ Select; $ Select- & gt; ( 'स्कूल') से; $ का चयन करें- & gt; जुड़ें ('school_parent', 'school.school_parent_id = school_parent.school_parent_id'); $ परिणामसेट = $ this- & gt; तालिकागेटवे- & gt; चयन करें ($ चयन करें); वापसी परिणाम $ सेट;   

मैंने कोशिश की, लेकिन मैं इसमें शामिल होने की मेज से नहीं कर सकता।

कोई भी मेरी सहायता कर सकता है?

< ($ $ पृष्ठांकित) {// तालिका एल्बम $ के लिए एक नया चयन ऑब्जेक्ट बनाओ = चुनें = div = "post-text" itemprop = "text">

  सार्वजनिक फ़ंक्शन fetchAll ($ paginated = false) {if ($ paginated) $ इस- & gt; getallAlbum (); // एल्बम इकाई $ परिणाम के आधार पर एक नया परिणाम सेट बनाओटेटप्रोटोटाइप = नया परिणामसेट (); $ परिणामस्वरूप प्रोटोटाइप- & gt; सेटअरेऑब्जेक्टप्रोटोटाइप (नया एल्बम ()); // एक नया पेजिंग एडाप्टर ऑब्जेक्ट $ paginatorAdapter = new DbSelect (// हमारे कॉन्फ़िगर चयनित ऑब्जेक्ट $ का चयन करें, // एडैप्टर को $ $- के बीच चलाने के लिए-> गेटवे- & gt; getAdapter (), // परिणाम पर सेट करें हाइड्रेट $ परिणामसैटप्रोटोटाइप); $ Paginator = नया पेजिनेटर ($ paginator एडेप्टर); $ Paginator वापसी; } $ परिणामसेट = $ this- & gt; तालिकागेटवे- & gt; चयन करें (); वापसी परिणाम $ सेट; } समारोह getallAlbum () {$ sql = नया चयन (); $ Sql- & gt; से ('एल्बम') - & gt; स्तंभ (सरणी ('आईडी', 'कलाकार', 'शीर्षक')) - & gt; जुड़ें ('एल्बम खंड', 'album.catId = albumcategory.catId' सरणी ('catName' = & gt; 'कैटनाम'), चुनें :: JOIN_LEFT); वापसी $ sql; }    

java - Getting a object reference in interface that was not passed -


At present, the code below gives compile annotations, because the audience does not know what SMS task is for the SMS Task in the listener Should be an example. Is it possible to do this without passing in it? If this happens, then it seems like a redundant:

  .createTask (SMS Tasks, New Functional Listener {SMS}} {...}   

The current code :

  Public Zero Dustof () {Smartphone Task SMSTesk = Create SMSTyc (); SuperGetsSystem (). CreateTask (SMT Task, New Task Complex Listener) {@ Override Public Wide On Tesk Complaint () {Release Resource (SMSTask); // Error}}}}}} Private Smartphone Tasks vs. SMSTask () {Return new Smartphone Task}}   

createTask:

  Zero create otask (Smartphone Tasks, Functional Listener Listener) << Code   

You can specify the variable last :

  Last Smartphone Task smsTask = createSMSTask ();    

Suggested text is not displayed in autoCompleteTextBox in android -


As the color suggetsed text text background color and AutoCompleteTextBox Android does not show the same suggetsed text so My XML file is:

  & lt; AutoCompleteTextView android: id = "@ + id / autoCompleteTextView1" Android: layout_width = "0dp" Android: layout_height = "wrap_content" Android: layout_weight = "2.4" Android: Background = "# ffffff" Android: ems = "10" Android: Text collar = "# 000000" & gt; & Lt; / AutoCompleteTextView & gt;   

and my manifest file is:

   & Lt; Application Android: allowBackup = "true" android: icon = "@ drawable / ic_launcher" android: label = "@ string / app_name" android: theme = "@ android: style / Theme.NoTitleBar.Fullscreen" & gt;   

And my Java file was protected saved Crete (bundled zero Instansstet) {super.onCreate (savedInstanceState); SetContentView (R.layout.patient_registration);

  // layout to get a reference to AutoCompleteTextView in AutoCompleteTextView TextView = (AutoCompleteTextView) findViewById (R.id.autoCompleteTextView1); // string arrow string [] Countries = {"Jane", "FB", "Mar", "Jun", "Kokok", "Oppo"}; // Create the adapter and set it to autocomplete the full array for ArrayAdapter & lt; String & gt; Adapter = new array adapter & lt; String & gt; (This, Android .R.Let.CompL_L_Lightime, Country); TextView.setThreshold (1); TextView.setAdapter (adapter); }    

For android.R use instead android.R.layout.simple_dropdown_item_1line try. Layout.simple_list_item_1 - This works for me

core data - Rest Kit load to CoreData by ID -


Did the ruskit load relation object be created automatically by id and put them into core data?

Here is my JSONs

Waypoint:

  {"Date": "23/09/2012", "places_ids": [1182, 1065, 1140, 1126]} <   {"id": 1182, "name": "new-york", "temperature": 32}   / Pre> 

I want to map the option not only on loading and option to load the resetkit, but all related place objects such as: "Restrict, please, load this point with the URL

  ... / api / waypoints /: id "  

and this pathway loads all the place objects from the URL

 . . / Api / Places /: id   

Now there are 'places_ids' variable attributes and 'places' connections in the route point and it does not match those locations to load locations.

Wow is correct that the restaurant will not automatically go to the web and will get a place for you. At least it was in RestKit 0.1, you need to change your Jason the way you have to do something like this:

  {"date": "23/09/2012 "," Places_ids ": [{" id ": 1182}, {" id ": 1065}, {" id ": 1140}, {" id ": 1126}]}   

To understand that place_ids represent any other object in your graph.

android - Using Comparable to sort twice -


मेरे पास एक ऐसी गतिविधि है जिसमें ArrayList & lt; KNDrawingTOOL & gt; नामक allTools

KndrawingTool नीचे है .. यह तुलनात्मक तुलना करता है और तुलना विधि ह्यू द्वारा मूल रूप से क्रमबद्ध रंग है। यह बहुत अच्छा काम करता है .. लेकिन मैं उस सॉर्टेड सरणी को लेना चाहूंगा और फिर उसे मूल्य से फिर से सॉर्ट करना चाहूंगा, हू ऑर्डरिंग को बनाए रखना है। क्या ऐसा करने का एक तरीका है?

कंड्राइंगटॉल <पूर्व> सार्वजनिक वर्ग केंड्रिंगिंग टूल का उपयोग करने योग्य & lt; KNDrawingTool & gt; {सार्वजनिक इंक आईडी; सार्वजनिक स्ट्रिंग का नाम; सार्वजनिक पूर्ण आकार; सार्वजनिक इंट रंग; जन इंट लागत; सार्वजनिक पूर्णता क्षमता; सार्वजनिक एंट राशि; सार्वजनिक स्ट्रिंग प्रकार; सार्वजनिक पेंट mPaint; सार्वजनिक कंड्राइंगटूल (स्ट्रिंग टूलटाइप, बूलियन फ्लैटटिप, इंट पेंटआईडी, स्ट्रिंग पेंटएनाम, इंट पेंट साइज़, इंट पेंट कॉॉलर, इंट पेंट कॉस्ट, इंट कैनकैपेसिटी, इंट बचे अमर)) {type = toolType; आईडी = पेंटआईडी; नाम = पेंटनाम; आकार = पेंट साइज़; रंग = रंगरंग; लागत = पेंट कॉस्ट; क्षमता = क्षमता राशिफल = शेष राशि; MPaint = नया पेंट (); यदि (प्रकार == "पेंट") {mPaint.setMaskFilter (नया ब्लरमास्कफ़िल्टर (15, ब्लरमास्कफ़िल्टर.ब्लूर। नॉर्मल)); } MPaint.setAntiAlias ​​(सच); mPaint.setDither (सही); mPaint.setStrokeCap ​​(Paint.Cap.ROUND); mPaint.setColor (रंग); mPaint.setStyle (Paint.Style.STROKE); mPaint.setStrokeWidth (आकार); } / * (गैर-जवाडोक) * @see java.lang.Comparable # compareTo (java.lang.Object) * / @ ओवरराइड पब्लिक इंट की तुलना करें (KNDrawingTool अन्य) {लॉग। V ("टूल", "सॉर्टिंग ह्यू" ); // वापसी (रंग- अन्य। रंग); फ्लोट [] एचएसवी 1 = नया फ्लोट [3]; फ्लोट [] एचएसवी 2 = नया फ्लोट [3]; Color.colorToHSV (रंग, एचएसवी -1); Color.colorToHSV (other.color, HSV2); वापसी ((इंट) एचएसवी 1 [0] - (इंट) एचएसवी 2 [0]); }}

मेरे मुख्य वर्ग को बस कॉल संग्रह। स्रोत (सभी उपकरण);

जैसे मैंने कहा कि ये सभी प्रकार की ह्यू द्वारा ... मैं एक दूसरा पास बनाना चाहता हूं, फिर उन्हें रंग के आकार को बनाए रखने के द्वारा मूल्यों को बदल दिया जाता है ..

आप अपना सॉर्टिंग 1 पास में कर सकते हैं

  float [] hsv1 = new float [3]; फ्लोट [] एचएसवी 2 = नया फ्लोट [3]; Color.colorToHSV (रंग, एचएसवी 1); Color.colorToHSV (अन्य। कोलोर, एचएसवी 2); यदि ((इंट) एचएसवी 1 [0] == (इंट) एचएसवी 2 [0]) {रिटर्न (इंट) एचएसवी 1 [2] - (इंट) एचएसवी 2 [2]; } वापसी (इंट) एचएसवी 1 [0] - (इंट) एचएसवी 2 [0];    

Getting mongoengine and django rest framework to play nice -


I am wondering how I can work together with each other and djangoRESTframework to work with each other Can get it. Currently, my model

  from Melboksing import * imported periodically class blog (document): post_id = IntField (unique = true) title = Stringfild (max_length = 144, required = true) date_created = DateTimeField (Default = datetime.datetime.now) body = StringField (required = true)   

and I have defined the serializer

  rest_framework Lists all blog posts from the .views import, or creates a new post "def" (self, request, format = none): post = blog   

But I error'm getting takes

  typeError at / blog / __init __ () that one has been argued (2) Request Method: GET Request URL : Http://127.0.0.1:8000/blog/ Django Version: 1.5.1 Exception Type: Type Exception Value: __init __ () takes exactly 1 argument (2 given)   

which gives the following Tresebak

  response = callback (request, * callback_args, ** callback_kwargs)    

The purpose of the Django REST framework is Dja To work well with the ngo model, there is no replacement for the MongoEngine Django model, as you will need to define some more functions to play well with the Django Rest Framework.

If you need to create a framework for MongoEngine, then take a look at this instead.

If you prefer to use the DJJAA Rest Framework, it is entirely possible, although your blog list class is actually a view, not a serializer, first of all Define the serial category:

Since the MongoEngine document is not a Django model example, you can call yourself serializers.ModelSerializer . This is the reason that restore_object is here from: Looking at a dictionary of deserialized field values, [this] will update the existing model example, or create a new model example.

Then you can define your idea, eg.

 From  Rest_framework Import From Generics Models import blog category bloglist (generics.ListCreateAPIView): serializer_class = blogservalizer def get_queryset (self): return blog. Objs   

Again, Django REST framework expects some of the standard Django models that are not verified by the mongo-engine documents, so redefine the get_queryset method need to.

then add to your urls.py:

  url (r '^ blog /', bloglist.as_view (), name = 'blog-list'), < / Code>   

search - What's wrong with this Solr range filter query? -


The following filter query returns zero results (*: * as a query):

  - Start date: [* to *] or start: [* So far / day + 1 day]   

But if I only filter them: < Pre> -startDate: <* * * *

I get 3 results.

If I only filter by:

  start date: [* to now / day + 1 day]   

I get 161 results.

Why is the Joint FQ returning zero results? I want the filter to return any doctor whose starting date is zero or the start date is earlier than today.

Edit:

I'm using Solar 4.2.1.2013.03.26.08.26.55

Edit:

Well, the strange thing is that a colleague advised to put brackets on two parts:

  (- Start date: [* From *]) or (Start: [* So far / day + 1 day])   

And somehow it worked. I am still curious why he made a difference? Hope someone can put some light.

Thank you!

Solar supports pure negative queries. They do this, essentially, by expanding the pure negative to something like:

  *: * -startDate: [* TO *]   < P> However, if you add it to boolean, I do not believe it applies more on this kind of argument, a negative query does not bring anything in Lucin, but rather other, positive, query words. Filters that have been matched. This is different from SQL queries, which in a sense starts with a complete table of  *: * , or the result, and allows it to hold it down.  

I believe your or is being effectively ignored, because it is not strictly speaking, it is understandable in context. Generally, or is syntactic sugar, I believe ( field: this or region: that which is equivalent to the field: this field: he ).

Therefore, your query in effect is: start date: [* so far / day + 1 day] -startdata: [* to *] , which results in you being more clearly visible gives . When you wrap it in brackets, then each word query is treated separately, and you gain access to the support of solr of single negative queries.


A better idea is to store a default value, if you need to search for the unset / null values ​​ *: * and thus the pure negative queries like this To scan the entire index in detail, and therefore to perform very poorly. Providing a default value will improve performance, and prevent such a misleading situation.