Monday, 15 April 2013

android - Starting a new Intent from an adapterview is so slow? -


I have a list view that has different items, each item has a comment button, Where he will be able to comment on all the comments and see, but when I click on the comment button, it takes time, about 5 seconds, which is very long and different from the other buttons of the same activity.

My code from the adapter view is here:

  comment.setOnClickListener {@Override Click Public Zero (see V) {intent = new intent (); Intent.setClass (GetContext (), Nouveau Comteiner.class); Intestine Input Extra ("Object", M. GetAbject ()); GetContext (). Initialization (intent);}});  

enter image details here

there

  1. Do not use getContext repeatedly.
  2. Create a reference variable in the class and start in the constructor with getContext (); Or close to the activity
  3. Use this kind of intent.

    intent to intent = new intent (getContext (), Nouveau commitments class); Intent.putExtra ("objectid", m.getObjectid ());

current activity (intent);

  1. Please do as much as you can manage your code, because sometimes we do some code incorrectly, which will affect the performance of the app, please Know the thing. It will affect you and your coding.

I hope this will help you.


html - Assign a bootstrap class to a dynamic javascript table -


I have a form for table and CRUD witch, I've styled a bit with bootstrap, but I also have a good table I want to see it, so I tried.

tbl.className = 'Table Table-Stripe Table-Border-Table-Dense';

and

Tbl.setAttribute ("class", "table-table-striped table-border table-condensate");

The table is getting the class, but there is no style. I can not figure out what the problem is.

  function skapaTabell (productive) {document.getElementById (" Table "). InnerHTML = ""; Var tbl = document.createElement ("table"); Tbl.className = 'Table Table-Stripe Table-Bordered Table-Condensation'; // attribute has so far for //tbl.setAttribute ("border", "1"); Tbl.setAttribute ("id", "table"); Tbl.setAttribute ("class", "table-table-striped table-table-condensate"); Var tblTr = document.createElement ("tr"); Var tblTh = document.createElement ("th"); // Skepar Rubinar Works Live Type = document.createTextNode ("ID"); TblTh.appendChild (thText); Var tblTh1 = document.createElement ("th"); Var thText1 = document.createTextNode ("productive"); TblTh1.appendChild (thText1); Var tblTh2 = document.createElement ("th"); Var thText2 = document.createTextNode ("category"); TblTh2.appendChild (thText2); Var tblTh3 = document.createElement ("th"); Var thText3 = document.createTextNode ("pre"); TblTh3.appendChild (thText3); Var tblTh4 = document.createElement ("and"); Var thText4 = document.createTextNode ("message"); TblTh4.appendChild (thText4); Var tblTh5 = document.createElement ("th"); Var thText5 = document.createTextNode ("Bild"); TblTh5.appendChild (thText5); TblTr.appendChild (tblTh); TblTr.appendChild (tblTh1); TblTr.appendChild (tblTh2); TblTr.appendChild (tblTh3); TblTr.appendChild (tblTh4); TblTr.appendChild (tblTh5); Tbl.appendChild (tblTr); Var i = 0; Do {// Langer Dane Neither Redondhen Seat Eye Tableen New Nun. RO = TBL.Instant RAW (-1); // varje ny rad behoever fyra 6 new new columns for cellar eFetterm product = newRow.insertCell (0); Var newCell2 = newRow.insertCell (1); Var newCell3 = newRow.insertCell (2); Var newCell4 = newRow.insertCell (3); Var newCell5 = newRow.insertCell (4); Var newCell6 = newRow.insertCell (5); NewCell.innerHTML = Manufacturer [i] .id; NewCell2.innerHTML = Manufacturer [i] .namn; NewCell3.innerHTML = Manufacturer [i] .kategori; NewCell4.innerHTML = Manufacturer [i] .pris; NewCell5.innerHTML = Producer [i] .info; NewCell6.innerHTML = '& lt; Img src = "'+ productive [i] .url +' height =" 100 "width =" 50 "& gt; '; i ++;} while (i & lt; produkter.length); // tab ski visa With an element ID table document.getElementById ("tabell") appendChild (tbl).  

}

Thanks in advance.

< P>

jquery - Add class to list item if it's child image width is < 667 -


I have a list of images that are inside a list tag. I want to add a class in the list tag via jquery, if the image (which is in the list tag) width is 667px

  jQuery ('.html-gallery li') smaller than is. Function () {if (jQuery (this). Child (). Attr ('width') & lt; 700) {jQuery (this). Parent (). AddClass ('half');};}); & Lt; Ul class = "basic-gallery text-center" & gt; & Lt; Li & gt; & Lt; Img class = "attachment-large" width = "667" height = "1000" alt = "yan savigning photography" src = "http://yonsavin.com/wp-content/uploads/2015/ 03/ 1-250. Jpg "style =" max-height: 917 pixels; width: auto; height: auto; "& gt; & Lt; / Img & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Img class = "attachment-large" width = "667" height = "1000" alt = "yan savigning photography" src = "http://yonsavin.com/wp-content/uploads/2015/ 03/ 1-250. Jpg "style =" max-height: 917 pixels; width: auto; height: auto; "& gt; & Lt; / Img & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Img class = "attachment-large" width = "667" height = "1000" alt = "yan savigning photography" src = "http://yonsavin.com/wp-content/uploads/2015/ 03/ 1-250. Jpg "style =" max-height: 917 pixels; width: auto; height: auto; "& gt; & Lt; / Img & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Img class = "attachment-large" width = "667" height = "1000" alt = "yan savigning photography" src = "http://yonsavin.com/wp-content/uploads/2015/ 03/ 1-250. Jpg "style =" max-height: 917 pixels; width: auto; height: auto; "& gt; & Lt; / Img & gt; & Lt; / Li & gt;  

How is this possible?

If you want width from the img tag properties:

  $ ('basic gallery'). Each (function () {if ($ (this) at ('width') & lt 667) {$ (this) .clostest ('ul'). AddClass ('half');};}); Otherwise, after the answer to the above @ Arri, you can get the width of the image:  
  $ ('basic gallery'). (Function () (if ($ (this) .find ('img'). Width () & lt; 667) {$ (this) .clostest ('ul'). AddClass ('half');};} );  

Oracle: How can I introspect a view? -


How can I make a scene independent in Oracle? For example, if I have

  create scene v, select foo, bar by baz  

I would like to know that foo And bar first and second columns are selected.

You can also use all_tab_columns for views, then see v The first two columns will be something like this:

  all_tab_columnWhere TABLE_NAME = 'V' and column_id IN (1, 2) from SELECT *;  

Then you can ask for specific columns:

  SELECT COUNT (*) TOTAL_tab_columns to total where TABLE_NAME = 'V' and (table_name, column_id ) IN (('FOO', 1), ('Bar', 2));  

If the total is 2 then it means that the first and second columns selected are foo and bar with the case or decode it Make more readable: Select

  when the total = 2 results from 1 or 1 0 (for all numbers select * (*) from TOTAL_tab_column where total TABLE_NAME = 'V 'And (table_name, column_id) IN ((' FOO ', 1), (' bar ', 2));  

php - Facebook Ad API creating Campaign issue -


After

I tryng to add an advertisement campaign for FB and SDK through the php and

My code is:

$ ACCOUNT_ID = '653669201111111'; $ APP_ID = '67111971 9111111'; $ APP_SECRET = 'FB 9 / 3535486866817f5f7b85111111'; $ CLIENT_TOKEN = '05483f8023bd5885bef5e2f08611111'; $ APP_TOKEN = '6012878111111'; FacebookSession :: Set default application ($ APP_ID, $ APP_SECRET); // If you already have a valid login token: $ session = new FacebookSession ('05483f8023bd5885bef5e2f086111111'); $ Session = Facebook session: new app session ($ APP_ID, $ APP_SECRET); // To validate session: {$ session-> Validate); } Hold (Facebook \ FacebookRequestException $ ex) {echo $ ex-> GetMessage (); } Hold (\ Exceptions $ east) {echo $ ex-> GetMessage (); } $ __ TOKEN__ = $ session- & gt; GetToken (); $ Session = new \ FacebookAds \ session ($ APP_ID, $ APP_SECRET, $ session-> getToken ()); API :: INIT ($ APP_ID, $ APP_SECRET, $ __ TOKEN__); $ Api = Api :: Example (); $ Campaign = new \ FacebookAds \ object \ AdCampaign (empty, "ACT_ $ ACCOUNT_ID"); $ Campaign- & gt; SetData (array (AdCampaignFields :: name = & gt; 'My First Campaign', AdCampaignFields :: Objective = & gt; AdObjectives :: WEBSITE_CLICKS, AdCampaignFields :: Status = & gt; AdCampaign :: STATUS_PAUSED,)); $ Campaign- & gt; Create (); Echo "Campaign ID:" $ campaign-> ID "\ N"; Die;

And this way the feedback is happening.

I have tried this issue for me, but still have not found anything useful

  FacebookAds [http: response object ([request: protected] = & Gt; [Status: Protected] => 400 [Header: Protected] => FacebookAds \ HTML \ header object ([Storage: Array Object: Private] = & gt; Array [HTTP_CODE] = & gt; HTTP / 1.1 400 incorrect request [content type] => application / json; charset = UTF-8 [WWW-certified] => OAuth "Facebook platform" "invalid_request" "unsupported PO St Request. "[Access-Control-Allow-Origin] = & gt; * [X-FB Plan-Rev] => 1643773 [Pragma] => No Cash [Cash-Control] = & gt; No Shop [Facebook-API-version] => v2.2 [Finish] => Saturn, 01 January 2000 00:00:00 GMT [Vary] => Accept-encoding [X- FB-debug] => HQ7MRN 8ZYmolpN + FckJjwPW2c0 iFwZeoPnegV2oavAvzXURrR5MZxiCLRAGOIr7Q1zaWpM9hEajZxlHiZxirg == [Date] = & gt; Mon, 16 Mar 2015 18:05:22 GMT [Connection] = & gt; Keep-alive [content-length] = & Gt; 90)) [body: protected] = & gt; {"Error": {"Message": "Unsupported post request.", "Type": "GraphmaptException", "Code": 100}} [Content: Protected] = & gt; 

I am using PHP 5.4

Any ideas what's wrong there?

Thank you!


vb.net - Error while using math.roundoff function in a textbox -


मैं 2 टेक्स्ट बॉक्स में मानों को गोल करना चाहता हूं, textbox1 और textbox2 < / कोड> अगर राउंडऑफ़ <कोड> मेनसस्ट्रिप को चेक किया गया है और मान छोड़ दें क्योंकि यह चेक नहीं है। textbox1 और textbox2 कुछ गणना का परिणाम है जो हमेशा संख्यात्मक होगा मैं निम्नलिखित कोड का इस्तेमाल करता हूं, लेकिन त्रुटि "" स्ट्रिंग से रूपांतरण "" डबल "टाइप करने के लिए डिबग करने के दौरान त्रुटि हुई।"

NB: ReadOnly टेक्स्टबॉक्स की संपत्ति को ट्रू

  निजी उप mnuRoundOff_CheckedChanged (ByVal प्रेषक के रूप में ऑब्जेक्ट के रूप में, सिस्टम के रूप में ByVal e.AventArgs) पर सेट है mnuRoundOff.CheckedChanged Dim r, s स्ट्रिंग डिम टी के रूप में, दशमलव के रूप में यू = पाठ बॉक्स 2। पाठ s = textbox3.Text t = r * 1 u = s * 1 यदि mnuRoundOff.Checked = true तो टेक्स्टबॉक्स 2। पाठ = गणित.राउंड (टी, 0, मिडपॉइंटराउंडिंग.एवेफ्रमजीरो ) TextBox3.Text = गणित.राउंड (यू, 0, मिडपॉइंट रोइंग। ऐवेफ़ोमजीरो) या तो पाठ बॉक्स 2। टेक्स्ट = आर पाठ बॉक्स 3। टेक्स्ट = एस एंड एंड एंड एंड एंड  


Using PHP/MySQL to automate email campaign, not sure how to structure query -


I have two MySQL tables, one with customer details, the other where I monitor those emails sent to The campaign, the version, etc. (Crawler and sent mail, respectively) I have created a script which can send emails on the basis of the SendGrid API, a web form and some javascript by going from the crawler table. But I am trying to figure out how I can tell the script to pull emails from the crawler table, which does not have the campaign listed in the currently sent_mail table. I know that I have to use joining, but in reality it is not known how to create arguments in the query. idea? My attempt is below:

  foreach ('Selection crawler sends email except crawler, sends out quitting mail, crawler.mail = sent_mail.email where sent_mail.campaigns & Lt; & gt; "$ campaign" ') $ address) as $ address) {$ email = New SendGrid \ email (); $ Email - & gt; Ad-tie ($ address) - & gt; Setfram ($ address) - & gt; Setsmack ($ title) - & gt; Set Text ($ text) - & gt; Set HFML ($ text); $ Sendgrid-> Send ($ email); $ Db- & gt; $ Query = "Include Sent Emails (Email, Campaign, Campaign_Version) values ​​($ address, $ campaign, $ campaign_version)"; Echo 'great success'; }   

I think you're looking for code below .. I think The code below can help a bit. $ get_records = mysql_query (Select 'crawler.' Leave crawler as 'email_val'; Skip the crawler mail sent. ($ Data = mysql_fetch_assoc ($ get_records)); $ $ = $ data ['email_val']; $ subject where sent_mail.campaigns & lt; & gt; $ campaign "'); $ I = 1; = 'Content of your topic'; // Always send content to HTML Type $ headers = "MIME-Version: 1.0" "\ r \ n"; $ header. = "Content-type: text / html; Charset = UTF-8 "" \ r \ n "; // More Header $ header. = 'From: Your name & lt; you@you.com>' $ $ Sendmail = Mail ($ $ $ $ theme, $ message, $ header); if ($ sendmail) {$ insert = mysql_query ("Emails sent to them (email, campaign, campaign_version) ('Your value', 'your value', 'your value');); if ($ insert) {echo $ i.'Value insert & mail '. $ Data [' email '] was sent;} Else {echo $ i.'Value has not been included but '$ data [' email '] has been sent to the mail;}} and {echo $ i.' Failed to send mail '. $ Data [' email ' ];} $ I ++;}

Note: Before running the above code, make sure to come Has established a database connection


delphi - How to show ActionList editor from custom TComponentEditor at design time -


I have a TComponentEditor lineage that I register to provide some alternative options for TActionList.

Back in D2007 I can call the ShowActionListDesigner unit unit ActnEdit and show the default ActionList editor. Required to add designide.dcp to the required packages:

  Process TMyActionListEditor.ExecuteVerb (index: integer); If index 1 = // then do some work, then start ActnEdit.ShowActionListDesigner (designer, component as TCustomActionList); End; Now in XE5 I tried other packages like vcldesigner.dcp, but I think which package does not include ActnEdt.  

Itemprop = "text" >

ShowActionListDesigner method is in the Actnedit unit which is a part of the dclstd package.


mobile devices - Is it possible in android to get data of cellular network stat -


Is it possible to obtain data such as radiation of cellular tower, distance from cellular tower, and basic details of cellular network Android device programmatically.

You can get the power of the device's signal, what kind of connection it is, and the telephony API With:

The basic details of the network from the Connectivity Manager: and

There is a link to the discussion of cell tower information:


android - Does AssertionError ever get thrown by Java outside of using assert* -


I would like to use AssertionError in my code, to alert me when things should not happen For now, I was thinking recently that I can make a mistake in mysterious errors chosen by JVM or Dualwick (or any other Android stock library) in random failure mode.

Anyone knows that (if at all) the Entertainment Error s is thrown in JVM or by stock code in Android (third party) No library)?

Many results are found in the discovery of the project of Android Lollipop 5.0.1r1 (where most Code interacts with a god), which includes AssessorArder throwing.

What is the cost for it, there is not a ton of them, and, of all that I saw, actually seems less likely to trigger them, but hey, this is possible.


Javascript (if var contains a word, change that word colour ONLY) -


In fact, an idea behind this is associated with a variable (a SQL server) from the program code, and the column is a VAARA

This code is trying to implement IM which changes the whole string to Blue, because it has the word 'if':

  If (contentItem.screen.SoftwareLibrary.Code.indexOf (if)! == 1) {element.style.color = "blue"; }  

What I would like to do is scan this variable through the code, and in it the word 'if' is, I want to make that word only blue.

Is this possible? And thankyou for any hint or help

If you highlight. You do not want to go Js route, you can use something like the following:

  contentItem.screen.SoftwareLibrary.Code.replace ("If", " 

I highlight. I highly advise to use JS, although it is very strong and will save a lot of time.


javascript - How select this element? -


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

  & lt; div class = myClass & gt; & Lt; a href = "#" id = "क्लिक करें" & gt; विकल्प के लिए क्लिक करें टाटा & lt; / a & gt; & Lt; / div & gt; & Lt; div वर्ग = "चयनमल्टी कंटेंट" & gt; & Lt; ul class = "चयन करेंमल्टीलिस्ट लाइब्रेरी" & gt; & Lt; li डेटा-मूल्य = "517" वर्ग = "" & gt; टाटा & lt; / li & gt; & Lt; li डेटा-मूल्य = "389" वर्ग = "" & gt; तिटी & lt; / li & gt; & Lt; li डेटा-मान = "387" वर्ग = "" & gt; पूर्ण & lt; / li & lt; / ul & gt; & Lt; / div & gt;  

जब मैं 'ए' लिंक पर क्लिक कर रहा हूं, तो मैं ट्रिगर के साथ fisrt 'li' पर क्लिक करना चाहता हूं।

लेकिन यह कैसे करें ? मैं ट्रिगर का उपयोग करने के लिए देख रहा हूं, लेकिन इस मामले में इसका उपयोग करना मुश्किल लगता है।

क्या आप मेरी मदद कर सकते हैं?

आप एक क्लिक हैंडलर हो सकते हैं जो li उसके डेटा-मूल्य विशेषता के आधार पर

 का चयन कर सकते हैं।  $ ('# click') क्लिक करें (फ़ंक्शन () {$ ('। चयन करेंमल्टीलिस्ट ली [डेटा-मूल्य = "517"]')। क्लिक करें ()})  

When is [Time to be received] property of msmq message evaluated? -


When I send a message and set the TTBR property on the message: QueuedMessage.TimeToBeReceived = TimeSpan.FromSeconds (10);

When has this asset been evaluated and deleted messages have been deleted?

When or how the asset is evaluated, it is possibly deliberate. By doing so, Microsoft will keep its options open. When and how they want to evaluate the property at any time, they are free to change.

For some examples, the description says:

In each hop, message quowing will reduce the amount of time remaining from the value of PROPID_M_TIME_TO_BE_RECEIVED to the applicable computer , When this message sends to the next computer, where a new timer set.

But we probably should not read a lot of it in the phrase "... where a new timer is set." Some other non-timer related codes can be short stories and not signs of becoming a real timer.


iphone - Lock Portrait Orientation in IOS on Application Boot from Landscape -


Then I have participated in a fun bug. I have many subviews containing the UIAdation that will show that we can only view in portrait view Want to be qualified To achieve this goal, we created the sub-section of the UIAVG controller and added the following:

  should overcode fnsAurotate () -> Bull {return false} overcoded fuses supported interface (-) - & gt; Int {Return Int (UIInterfaceOrientationMask.Portrait.rawValue)}  

This works very well, and the app is locked in portrait and if the user changes the device to sideways and If the app loads, then EXCEPT can not be rotated. The expected result from the scenario was for the device to load in the picture, although it loads in the landscape, and will never turn the user back on the portrait.

Once the way I am able to replicate it, it is already loading the app from a device in landscape mode. any idea? There are a lot of posts about device orientation, but no one was able to talk to me about app boots

Remove the autoroteate and it should work properly.


excel - Using copyRange with formatting equaling xlPasteValuesAndNumberFormats -


I am VBA very innovative for the world and mostly taught myself (this is also the result of most of my issues) I 'Autofilter Some codes have been collected to copy the data from the new sheet to the results. The problem I am doing is the format in which this goal is being copied to the sheet - I want it to have the same format without using the actual copy / paste " XlPasteValuesAndNumberFormats "to copy in this format - Is there a way to achieve this goal? I prefer not to use copy / paste because the sample code is repeated several times with filter criteria and goes to give memory error. The sample code is very good and there is no memory problem with the exception of formatting. Any help, suggestion, stroking the ego (j / k) appreciated

PS:. I do not mean the filter criteria, but I had to remove the original criteria due to my confidential nature - sorry

  sub-MWSB_Filter_Macro () the reduced src worksheet as TGT dim Set the worksheet dim filterRange range as the slow copyRange range last Row, set src = ActiveWorkbook.Sheets ("Named Log Sheets") set to TGT = ActiveWorkbook .Sheets ("Named Target Sheet") src.AutoFilterMode = false lastRow = Src.Range ('A' in & amp; src.Rows.Count) .End (xlUp) .Row set filterRange = src.Range ("A5:" as Cop FilterRange.AutoFilter field: = 5, criterion1: = "MWSB" filterRange.AutoFilter field: = 12, criterion1: = "2-set for criteria" 2 ", operator: = xlOr, Criteria2: =" 3-criteria for 3 "filterRange.AutoFilter field: = 28, Criteria1: =" "filterRange.AutoFilter field: = 35, Criteria1: =" "copyRange.SpecialCells ( XlCellTypeVisible) .copy tgt.Range ("A1")  

I'm feeling this It's like you "gathering a pop-up message in between the run-time, telling something full clipboard. "If this is true, you can avoid any pop-up messages that occur during the run-time (and therefore you use the per / paste method mentioned) by putting the following at the top of your process: / P>

  Application. Display Eltar = Incorrect  

Alternatively you can copy to the destination, as it is above, the code to go to that destination Add and change the format for range (mac Cry attempt to record you do not know how to use VBA).

Michael


oauth 2.0 - Gmail API - Scope -


I am using a service account and a broad delegation of domains has been described and I have all the emails Enabled to receive all emails from accounts. What I am using is

Is there any way i can send some email accounts (eg admin email accounts) to the entire domain Can I do it out? Is this a different process to achieve?

To further clarify what I mean, this is an example of what I want to do:

Service account example_a@domain.com, reach example_b@domain.com No admin@domain.com

Thank you! It is not possible to remove access to some accounts while doing domain-wide authorization with service accounts.


java - Arrays.toString() returns [Ljava.lang.String;@2f67d81 -


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

  • 23 उत्तर

जब मैं Arrays.toString () स्ट्रिंग aryLines * पर, यह रिटर्न देता है: [Ljava.lang.String; @ 2f67d81 मैं क्या कर रहा हूं गलत, क्या मैं प्रिंट करता हूँ सटीक स्मृति स्थान और सरणी ही नहीं है? यदि हां, तो मैं सरणी की सामग्रियों को कैसे मुद्रित कर सकता हूं?

* सरणी aryLines & lt; उदाहरण & gt; & lt; XML & gt; & lt; tags & gt;

के बराबर है

आप इसे गलत छपाई कर रहे हैं, किसी भी ऑब्जेक्ट के toString () केवल उस ऑब्जेक्ट के टेक्स्ट प्रस्तुतीकरण को प्रिंट करता है जिसे आप कहते हैं समारोह। तो इसका मतलब है कि अगर आप Array.toString को कॉल करेंगे तो यह [Ljava.lang.String; @ 2f67d81] प्रिंट करेगा, यह ऑब्जेक्ट का पाठत्मक स्मृति प्रतिनिधित्व है इसका समाधान करने का एक बहुत अच्छा तरीका सूची का उपयोग करना है, इसका तरीका सरणियों से अधिक अनुकूल है, और आप उन्हें वास्तव में आसान प्रिंट कर सकते हैं। अगर आपको एरे की ज़रूरत है तो इसका उपयोग करें

  स्ट्रिंग [] aryLines; Println (Arrays.asList (aryLines));  

यह आपको अपनी सरणी में निहित तत्वों का उचित आउटपुट देना चाहिए


php - SQL - Use maths operations in WHERE condition -


मुझे वर्तमान में यह PHP / SQL कोड है:

  $ today = date ("Ymd "); $ SqlQuery = 'SELECT id से प्रेषक WHERE (100 * ((सहमत + असहमत) - ('। NbDays ('date', $ आज)। ') * 10) & gt; = 75);';  

और मेरे nbDays फ़ंक्शन।

  फ़ंक्शन nbDays ($ debut, $ fin) {$ nbSecondes = 60 * 60 * 24; $ Debut_ts = स्ट्रॉटोम ($ पहली); $ Fin_ts = स्ट्रॉटोम ($ पंख); $ Diff = $ fin_ts - $ debut_ts; वापसी दौर ($ diff / $ nbSecondes); }  

मेरी पोस्ट सारणी इस प्रकार है:

  पोस्ट - #id - [int] सहमत - [इंट] असहमत -  

मुझे क्या करना है जो इस शर्त से मेल खाते के लिए आईडी की एक सरणी वापस कर देता है;

(100 * (सहमत / (सहमत + असहमत)) - (पोस्ट की तारीख से आज की तारीख))> 75

मैं एक एसक्यूएल अनुरोध का उपयोग करना चाहता हूं जिससे कि मुझे पहले सभी पदों की सूची न दें उन्हें सॉर्ट करना।

मुझे आशा है कि मैं काफी स्पष्ट हूं, और चाहते हैं कि आप मेरी मदद कर सकें।

बहुत बहुत धन्यवाद!

अपने मामले में आप अपने तर्क को संसाधित करने के लिए डेटाबेस संग्रहीत कार्यप्रणाली लिख सकते हैं। फिर डेटाबेस प्रक्रिया को सीधे php में कॉल करें संक्षेप में यदि आप MYSQL का इस्तेमाल करते हैं तो आप सरल क्वेरी का पालन करने की कोशिश कर सकते हैं।

  SELECT id से डाक से कहां (100 * ((सहमत + असहमत) - (UNIX_TIMESTAMP (अब ()) - UNIX_TIMESTAMP (तिथि )) * 10) & gt; = 75);  

javascript - knockout variable not defined -


I'm relatively new to Knockout.js and I'm having trouble doing this calculable job. In short, I would like to disable a button until the tapetera is input. For Textarea:

  & lt; Textarea class = "form-control" id = "note" name = "note" data-bind = "value: text1, value update: 'keyboard' placeholder =" note ... "& gt; & lt ; / Textarea> For  

button:

    Note Save & lt; / btn & gt;  

And here is my .js:

  var vm = {text1: k.a. ("") ,} Vm.hasInput = ko.computed (function () {return.text1 ();}, vm); ko.applyBindings (VM);  

Run in firebugs Yes, I get an error from the console which reads:

Reference: Error: Lesson 1 is not defined

I should add that I can add my code To make this reference, I am referring to:

Edit: "click: addNote" part of the button was for something else I forgot to delete it in this snippet because "addNote" functionality Just working fine. I am sorry for the illusion and I thank you for seeing it all. Because of this, it seems that T.J. My question has been answered, I was working improperly within the binding view modal and the struggle was being fought due to binding.

I think you see an old error message with your VM as shown in your question The problem is that you do not have addNote defined anywhere, but you are trying to force it to click on .

If you add it and make your BTN element an actual button , then all is well:

< Div class = "snippet" data-lang = "JS" data-hide = "wrong">

  var vm = {text1: to .observable (""),}; Vm.hasInput = ko.computed (function () {return.text1 ();}, vm); Vm.addNote = function () {}; // & lt; === Added ko.applyBindings (vm);  
  & lt; Textarea class = "form-control" id = "note" name = "note" data-bound = "value: text1, value update: 'keep'" placeholder = "Enter note ..." & gt; & Lt; / Textarea & gt; & Lt; Button type = "button" class = "btn-btn-kill" id = "saveNote" href = "javascript: zero (0);" Data-bind = "click: addNote, enable: hasInput" & gt; & Lt; I class = "icon-save" & gt; & Lt; / I & gt; Save note & lt; / Button & gt; & Lt; Script src = "https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"> gt; Side note: Just completely FWIW, I have new syntax for  ko.computed   
I like what is a bit more clear:

  vm.hasInput = ko.computed ({owner: VM, read: function () {this return.text1 ();}}}; < / Code> 

lets you specify pure: true for someone like you:

  vm.hasInput = ko.computed ( {Pure: true, master: VM, read: function () {this return.text1 ();}}};  

How to join multi arrays from Object properties in Javascript? -



I am using AngularJS and I have a problem below:
I created an object whose Properties are arrays. For example:

  $ scope.myObject = {import: [object1, object2, ..., objectN], export: [object1 ', object2', ... , ObjectN '], ...}  

Now I want to create a new array that includes all the arrays from my object properties, so that I can ng-repeat them with HTML view I can show in
This is my plan sample code:
Please help me. Thank you.

with underscore or call:

  _ _.values ​​($ scope.myObject)); I have also added a plain JS (ECIScript 5+) method:  
  $ Scope.myObjectJS = []; Object. Keys ($ scope.myObject). ForEach (function (key) {$ scope.myObjectJS = $ scope.myObjectJS.concat ($ scope.myObject [key]}};  

The fact is that I have the object . . .

>

c++ - How to compare two iterators for unit test on VS2013? -


कोड:

  #include "stdafx.h" #include "CppUnitTest.h" # शामिल करें & lt; vector & gt; नामस्थान माइक्रोसॉफ्ट :: VisualStudio :: CppUnitTestFramework का उपयोग कर; नामस्थान इकाई_टाइट {TEST_CLASS (test_iterator) {सार्वजनिक: TEST_METHOD (vector_with_int) {std :: vector & lt; int & gt; नमूने; आश्वासन :: ईईएवल (नमूने। बीजीआईएन (), नमूने.बीजीन ()); }}; }  

जब संकलन:

त्रुटि 1 त्रुटि C2338: टेस्ट लेखक को अपनी कक्षा वर्ग std :: basic_string, class std :: के लिए ToString के विशेषज्ञ को परिभाषित करना चाहिए आवंटक> __cdecl Microsoft :: VisualStudio :: CppUnitTestFramework :: ToString> >> (कॉन्स्ट क्लास std :: _Vector_iterator>> & amp;) C: \ प्रोग्राम फ़ाइलें (x86) \ microsoft दृश्य स्टूडियो 12.0 \ vc \ unittest \ include \ cppunittestassert.h 66 1 इकाई_स्टेस्ट

इस समस्या को ठीक कैसे करें? क्या मुझे इसके बजाय एक और फ्रेमवर्क का उपयोग करना चाहिए?

आप से शुरू घटा सकते हैं प्रत्येक इटरेटर (यदि वे यादृच्छिक ढंग से चल रहे हैं) तो आप size_type ऑफसेट की तुलना में iterator प्रकार की तुलना कर रहे हैं:

  Assert :: AreEqual (samples.begin () - Samples.begin (), samples.begin () - samples.begin ());  

c - Structure giving me "expression must be modifiable value" -


I think writing a program that keeps track of payroll records for strokes, but I think that It is understood that they understand structs that they will create a datatype and you'll use -> or to define it, but I am getting an error 2 questions,

  1. What's the problem?
  2. The program wants to add the ability to hold 1 million records, I think it is done through an array of employee structure type? Will I only send in the EMPLOYEE array in my Employee Records variable as if I

I know that "jude.name" is a problem area which is not fixed.

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; # Max structure typed 1000000 {int day; Int month; Int year; } Date; Typedef struct employee {four * names [100]; Int * age; Float * Functions; Float * RegPay; Float * Oat Pe; Float * total pay; DATE PAIDAD; }Staff; Record record manager (); Int main () {Today's date; DATE TP; EMPLOYEE jude; EMPLOYEE jp; Jude.name = "jude"; System ("pause"); Return 0; }  

problem with statement ...

  Jade.name = "jude";  

... is that jude.name resolves an array (100 codes of char ). You can arrange start in announcements - and it can look confusing as an assignment - and you can assign element , but you do not specify the whole array. can do.

To keep one million records, if they should all be kept in memory at one time (as opposed to, say, in a file), then structs An array of potential choices is:

  employee employees [1000000]; Unsigned employee_count = 0;  

You can specify struct s as another type of form; The result is that specifying each field of the right-handed struct for the corresponding field of left hand is struct for example:

  EMPLOYEE one_employee; / * ... Start an employee employee ... * / employees [employee_ count ++] = an employee;  

Is there a sensible data structure for using an array, and whether this kind of assignment is conforming to your objectives depends on your program do What is the record with?

Note, you probably do not want to consider the members of your structure as indicators, except for possibly name (in which case you are definitely only an indicator Want, not one of them array):

  type-e structure employee {four names [100]; Old age; Float hours work; Float rappe; Float ot pe; Float total pay; DATE PAIDAD; } Staff;  

user interface - Checkbox in AngularJS -


We have to create a set of mutually exclusive check boxes and want to implement that argument on the client (incl. Users can get immediate, responsive feedback about their selection options. Normally, mutual specialty will be implemented with the radio button, so that the user can be sure to familiarize with the interface selection. However, in this specific case, let's assume that within a specific sub-category, a user can choose multiple options as they want, but can not opt ​​in from more than one subcategory, imagine that neither you nor some type Contact preferences are set as yes. Or maybe an online food order form occurs where some topping options are mutually exclusive among categories.

The -change attribute for the NG check box lets you attach the function call or expression to the change of the check box Allows Using this, you can deselect those options which you are checking, which are unique among themselves, it can not be optimal but it works. You possibly can add some extra code to operate this extra data, but the following should work just fine.

Javascript:

  var app = angular Module ('plunker', []); App.controller ('MainCtrl', function ($ scope) {$ scope.SelectedNumber = function () {$ scope.redIsFavored = false; $ scope.yellowIsFavored = false; $ scope.blueIsFavored = false;} $ scope.selectedEclore = Function () {$ scope.oneIsFavored = false; $ scope.twoIsFavored = false; $ scope.threeIsFavored = false;} $ scope. Selected acloors (); $ scope.SelectedANumber ();});  

html:

  & lt ;! DOCTYPE html & gt; & Lt; Html ng-app = "plunker" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" /> & Lt; Title & gt; Finger Jess Plunker & lt; / Title & gt; & Lt; Script & gt; Document.write ('& lt; base href =' '+ document.location +' "/>); & lt; / script & gt; & lt; link rel =" stylesheet "href =" style.css "/> & Lt; script data - rp =" angular.js@1.3.x "src =" https://code.angularjs.org/1.3.14/angular.js "data-saver =" 1.3 " 14 "& gt; & lt; / script> gt; script src =" app.js "& gt; & lt; / script & gt; & lt; / head & gt; & lt; body ng-controller = "MainCtrl"> gt; & lt; p & gt; Pick your favorite color or your favorite number & lt; / p & gt; & lt; div & gt; & lt; label & gt; Color & lt; / label & Gt; & lt; / br / & gt; Input type = "checkbox" ng-model = "redIsFavored" ng-change = "selected angle ()"> Red 
& Lt; Input type = "checkbox" ng-model = "yellowIsfeward" ng-change = "selected excelor (")
yellow


Labels & gt; Numbers & lt; / Labels & gt; & lt; br / & gt; Lt; Br / & gt; & Lt; Input type = "checkbox" ng-model = "one eyeshadow" ng-change = "selected number ()" & gt; 1 & lt; Br / & gt; & Lt; Input type = "checkbox" ng-model = "two iffrd" ng-change = "selected member ()" & gt; 2 & lt; Br / & gt; & Lt; Input type = "checkbox" ng-model = "three iffrd" ng-change = "selected member ()" & gt; 3 & lt; Br / & gt; & Lt; / Div & gt; Black: {{blueIsFavored}} & lt; & Lt; Br / & gt; Red color: br / & gt; & Lt; Br / & gt; Number selected: & lt; Br / & gt; 1: {{oneIsFavored}} & lt; Br / & gt; 2: {{twoIsFavored}} & lt; Br / & gt; 3: {{threeIsFavored}} & lt; Br / & gt; & Lt; / Body & gt; & Lt; / Html & gt;

A work example can be found


c# - Connection timeout in ADo.NET -


  का उपयोग कर (SqlConnection कनेक्ट = नया SqlConnection (System.Configuration.ConfigurationManager.ConnectionStrings ["templateconnection"]। ConnectionString) ) {String strQuery = "ActionAudits को सेट करें चेकसम वैल्यू = (एक्शन, टाइप, टाइम एट एक्शन, एक्शन टाइप, रिकॉर्ड टाइप, रेफरल नंबर, यूजरफैक, लोकेशन एफक, पैटिएन्टफ़क, आईपी एडडर) से एक्शनऑडियो के साथ (एनओलोक) आईडी =" + आईडी + ") चुनें जहां आईडी = "+ आईडी; SqlCommand cmdChecksumValue = नया SqlCommand (स्ट्रक्चर, कनेक्ट); Connect.Open (); मान = कन्वर्ट.ToInt32 (cmdChecksumValue.ExecuteNonQuery ()); Connect.Close (); }  

Convert.ToInt32 (cmdChecksumValue.ExecuteNonQuery ()) को निष्पादित करते समय यह दिखाता है

त्रुटि: कनेक्शन टाइमआउट त्रुटि < / Strong>

सेट करें cmdChecksumValue। डिफ़ॉल्ट 30 सेकंड है।


ruby on rails - Mongoid, find models which name contains string -


मेरे पास मेरे मोंगॉयड मॉडल हैं जो इस पद्धति की है:

  def self.search_by_name (sub_string ) मेरे मॉडल में  नाम  फ़ील्ड है जो स्ट्रिंग और  उप-स्ट्रिंग   

कोड> मेरे खोजबार से लिया गया है रूटिंग ठीक है, खोजबार उप-स्ट्रिंग लेता है, लेकिन जब मैं यह कोड चलाता हूं:

  @partners = Partner.search_by_name (params [: sub_string])  < / पूर्व> 

यह कुछ भी नहीं है @ पार्टर्स रिक्त है और मेरी तालिका कुछ भी नहीं दिखाती है, भले ही मॉडल हैं जो वास्तव में उनके नामों में उप-स्ट्रिंग है क्या मैं गलत कर रहा हूं?

मुझे केवल से उद्धरणों को हटाने की जरूरत है, जहां बयान और यह काम किया।

पावेल और येवगेनिया के लिए धन्यवाद


html - Selenium WebDriver - How to identify the element from custom drop-down. DIV, UL and LI -


I am trying to automate a custom drop-down field in which DV, UL, and LI I'm unable to use the Select Class or CSSSelector.

  & lt; Div id = "boundlist-1092" class = "x-boundlist x-boundlist-floating x-layer x-boundlist-default x-border-box x-boundlist-above" tabindex = "- 1" style = "true: automatic :; Left: 495px; top: 245px; height: auto; z-index: 29001; width: 150px; "& gt; & Lt; Div id = "boundlist-1092-listEl" class = "x-boundlist-list-ct x-unselectable" style = "overflow: auto; height: auto;" & Gt; & Lt; Ul class = "x-list-plain" & gt; & Lt; Li class = "x-boundlist-item" unselected = "on" role = "option" & gt; Single & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "option" & gt; Married filing jointly & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "options" & gt; Separated from married filing & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" Incredible = "role =" option "& gt; Top of the house & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "options" & gt; Eligibility Widows (er) & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

However, the HTML code looks different when the element is visible

  & lt; Div id = "boundlist-1092" class = "x-boundlist x -bindlist-floating x-layer x-boundlight-default x-border-box x-byte-up-up" tabindex = "- 1" style = "right : Auto; left: 495px; top: 245px; height: auto; z-index: 29001; width: 150px; "& gt; & Lt; Div id = "boundlist-1092-listEl" class = "x-boundlist-list-ct x-unselectable" style = "overflow: auto; height: auto;" & Gt; & Lt; Ul class = "x-list-plain" & gt; & Lt; Li class = "x-boundlist-item x-boundlist-selected" unselectable = "but" role = "option" & gt; Single & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "option" & gt; Married filing jointly & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "options" & gt; Separated from married filing & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" Incredible = "role =" option "& gt; Top of the house & lt; / Li & gt; & Lt; Li class = "x-boundlist-item" unselectable = "on" role = "options" & gt; Eligibility Widows (er) & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

If someone can help me, then it will be very helpful.

To detect the dropdown, you have an partial match Apply expression: // div [with begin (with @id, "boundlist-")]

Here we get a Are saying for the boundlist -

element with id attribute beginning with element .

To find inside dropdown elements, I use a text match:

  // div [initially (@id, "boundlist - ")] / Li [. = "Married filing jointly"]  

where . refers to the text of the current element.


Can we use Solr and Lucene both together in sitecore -


Sitcom 7.5 introduces support for using multiple providers in the search index.

Do both of us solr and lucene in a cyclic app?

Yes you can cater to 7.5 as you configure different search providers to use Having different indexes can be kept. For example, a large index uses solar and some small indexes only to Lucene.

First, you have to choose one and all your indexes ran under that provider, this limit no longer exists.


database - VBA: import joined SAP data to Excel -


I'm currently working on a project and I use the VBA to automate the process to produce data from SAP I am trying to import However, the database I want to import is made up of multiple SAP-data such as mine and MARC. I have found at this point how can I import a table, but how can I join together in many tables together without assembling one table after another and then calculating later?

Regards and Thanks in advance

Sadly, the RFC read table only Can be pulled from one table at a time. ( is the method to handle this method that you are currently using in VB a)

Question 001 will allow you to join more than one table at a time . But then you have to manually export the data, if you can calculate all of your queries.


wordpress - PHP not working on CentOS -


html / html / html>
on my server but it is not visible in my browser later on

Instead, instead it shows an Apache test page which is located in var / www / error .

If I see in the index.html html-folder, it actually appears when I go to my website to test PHP I index Php > has created / var / www / html / test / , now once I mydomainname / test / index.php then it only shows PHP shores code Apache and PHP are installed on my CentOS, even after Apache has been restarted. Can you help


jsf - p:selectOneMenu sends null value to controller -


I am quite new to JSF and am trying to do the following

I have an app : The checkbox menu which is the list of employees and one of them will be made their leader, so I was trying to make a P: selector check menu that will list me. The selected names will be stored in a list and a P: SelectOnmenu will update, which will re-submit those selected names and one of them will be selected (P: SelectionOnmenu) basically p: selectcheckbox Can choose. And P: Select the menu. We will select one of the selected people.

My code:

  & lt; P: outputLabel for = "teamMemb" value = "select team member"; & Lt; / P: outputLabel & gt; & Lt; P: selectCheckboxMenu id = "teamMemb" value = "# {teamMaintainanceController.teamMemb}" & gt; & Lt; P: Ajax update = "Team leader" & gt; & Lt; / P: Ajax & gt; & Lt; F: SelectionEdit Value = "# {Employee Monitoring Controller. PossibleManagerList}" & gt; & Lt; / F: selectItems & gt; & Lt; / P: selectCheckboxMenu & gt; & Lt; P: = "teamLeader" value = "selection team leader"> gt; & Lt; / P: outputLabel & gt; Output label for & lt; P: selectOneMenu id = "teamLeader" value = "# {teamMaintainanceController.teamLeader}" & gt; & Lt; F: select item item label = "select one" itemValue = "" /> & Lt; F: select item item label = "# {teamMaintainanceController.teamMemb}" itemValue = "# {teamMaintainanceController.teamMemb}" value = "# {teamMaintainanceController.teamMemb}" /> & Lt; / P: selectOneMenu & gt; & Lt; P: Command button object = "applicable BTN" value = "add" ajax = "wrong" activist = "# {teammount controller.admin}" />  

Everything is enclosed in one form. The problem now is, when I select values ​​from P: selector checkbox menu: SelectOnmenu updates and displays the list of people who were previously selected, but when I select one of them and the button I click on the verification error and the console shows that the value is essential I checked and it is going to be zero when we click on the button.

Why not really get me please help

PS: I'm using @conversion


selenium - How to get link value inside href -


I have a div tag in which a tag is attached. How do I get the value href ?

For example, <"> and to tags:

  & lt; a href =" https: // www .tweeter com / rkShukl ">  

Depending on the language binding, it is getAttribute () in Java :

  WebElement element = driver.findElement (By.id ('id_of_the_link')) element .getAttribute ('href');  

In Python, this get_attribute () :

  element = driver.find_element_by_id (' Id_of_the_link ') element.get_attribute (' Href ')  

postgresql - Unable to connect Database Postgres(9.2) with error File "base/16384/PG_VERSION" is missing -


कनेक्शन नहीं बना सका; - नेस्टेड फेंकने योग्य: (org.postgresql.util.PSQLException: FATAL: "आधार / 16 384" मान्य डेटा निर्देशिका नहीं है विस्तार: फ़ाइल "आधार / 16384 / PG_VERSION" अनुपलब्ध है।); - नेस्टेड थॉउबल: (org.jboss.resource.JBossRe स्रोत अपवाद: कनेक्शन नहीं बना सका; - नेस्टेड थॉउबल: (org.postgresql.util.PSQLException: FATAL: "बेस / 16384" मान्य डेटा निर्देशिका नहीं है विस्तार: फ़ाइल "आधार / 16384 / PG_VERSION "अनुपलब्ध है।))

आधार / 16384 / इस फ़ोल्डर में कोई भी फाइल नहीं है जैसे

  Pg_filenode.map pg_internal.init PG_VERSION  

मुझे नहीं पता कि वे कैसे हटाए गए हैं।

यहां मैं पीजी_वीआरएसईएसआई फ़ाइल को कॉपी कर सकता हूं। मैं शेष फाइल कैसे प्राप्त कर सकता हूं?

यह भयानक टूटी हुई पोस्टग्रेएसक्यूएल डेटाबेस की तरह दिख रही है यदि आपके पास बैकअप है, तो बैकअप से पुनर्स्थापित करें


asp.net - Convert NEST (Elasticsearch) Search Results to DataSet - C# -


I am using knits to find my resilience search pointer:

  Var result = client Search & lt; My Object & gt; (S => (0). Size (10) // question here);  

This works and returns a Nest.SearchResponse object. Results The format given by hit.ToList () list & lt; Nest. IHit & lt; MyObject & gt; & Gt; () .

How do I change the results returned to the dataset (or datatable)?

Any help is appreciated.

You need a loop on your results

  DataTable dt = New DataTable (); Dt.Columns.Add ("field 1", typef (string)); Dt.Columns.Add ("field2", typef (string)); ... foreach (result in IHit & lt; Jobx; x. Result as. Hit) {dt.Rows.Add (x.Fields.FieldValuesDictionary ["Prop1"] as Xera, x.Fields.FieldValuesDictionary ["Prop2 "] As JArray ...);  
  • as well as

    >

    Document with MapataData

    When you search with Nest 0.12, you will withdraw a query response with two methods of loop on your results. . The document is an IEnumerable and. DocsWithMetaData and IEnumerable> may be easy to use one of them depending on your needs.

    Starting with Nest 1.0. DocsWithMetaData now only Is called.


    ios - How to downcast AnyObject to pid_t -


    I'm trying to get pid_t of using a specific window (CGWindowListCopyWindowInfo). After fighting the casting of the Swift, the end of the window can be obtained Onrpiaidi

      var window Onrpiaidiarf = Siafafeediaget value (Vindoinforaf, unsecured Adedof (Kesijiwaindo Onrpiaidi)) Version window Oinder PID = insecure bit Cast (window Onrpiaidiaraf, Oobakt.af)  AXUIElement = AXUIElementCreateApplication (testPid) .takeRetainedValue ()  

    now I Smar to windowOwnerPID cast variables AnyObject Oh

      var need to pid_t to feed appRef>  

    But it does not know how to do. Anyone have experience with this issue?

    According to, value kCGWindowOwnerPID key CFNumberRef for < / Code> type ( kCFNumberIntType as encoded) that contains the application ID of the application that owns the window.

    CoreFoundation Using toll- free bridging between the foundation types and Foundation and swift way, should do the following:

      letlist = CGWindowListCopyWindowInfo (CGWindowListOption (kCGWindowListOptionScreenOnly ), 0) .takeRetainedValue () as a list of wdict [[string: Onobaj]] {that's as PD = wdict [kCGWindowOwnerPID]? Int {println (pid) // pid is an int here. If necessary, pid = pid_t (pid)}}  

    The Convert pid_t (so with unsecured know () and unprotected bitcast () Swift 1.2 (Xcode 6.3 beta) string CFStringRef requires> with a clear conversion (thanks to Rob for not required ).

    reaction Napier):

      to wlist = CGWindowListCopyWindowInfo (CGWindowListOption (kCGWindowListOptionOnScreenOnly), 0) as (.takeRetainedValue to wdict in wlist to)! [[String: Oibbad]] {if Pwyd = Vadikt [String (KCG windowOnPID)] as? Int {println (pid)}}  

    python - Django: access attributes of queryset using index notation not dot notation? -


    When I try to do this in Dijongo:

      creatures = creatures Bob (Code = c) field = ['name', 'linen_type', 'age'] # In reality, there are more in organisms: in the field F: print o [f]  

    I get this error:

      There is no attribute in the type 'organism' object; '__getitem__'  

    Is there any way that I Each result in the query without using?

    When you use [] notation, internally, The dragon will try to apply the __getitem __ method to that object. Since the living object object does not define that method, it fails with that error.

    Instead, you can use the function, such as

      print getattr (o, f)  

    you use Can also specify a default value if the object is not present in the object, such as << p>

      print (c), ("f", "{}" {} is not present in Format (F, O))  

    Scala Specs2 Matchers with "aka" doesn't work -


    Scala specs 2 matcher which looks like this (for example):

      def Size (Size: IT): Matter [Product element] = {Product element: Product element = & gt; Val sizeOfproductElement = productElement.size sizeOffproduct element alias "Size of product element"} ^ beEqualTo (size)  

    and execution in code:

      UpdatedProductElement SEOOf (1)  

    throws error:

    java.lang.Exception: 'org.specs2.matcher.ThrownExpectations$$onon$1@6a3b7968'

    '1'

    What should I do differently?

    Edit: If is deleted, the exam has passed:

      Def size has come (size: int): matures [product element] = {product element: product element = & gt; ProductElement.size} ^ beEqualTo (size)  

    beEqualTo () < Compare a value (such as size ) with the any value, with the code / a org.specs2.matcher.ThrownExpectation , which you The correct way to create with aka is the sizeOf matcher

      def size off (size: int) : Matter [Producer] = {Product Element: Product Element = & gt;  

    Each Matcher [T] is a > Apply The method that accepts the values ​​ hope [t] (basically a kind of expected value is T plus an optional statement that you create with Aka ).

    : IT): Matter [product element] = {product element: product element = & gt; (ProductElement.size == Size, "Product element $ $ {productElement.size} is not size $ size")}

    c# - webBrowser .Url is not being applied -


    It's a mystery that I am updating my webbrowser1 control with my code like this:

      string hostname = textbox1.Text; WebBrowser1.Url = new Uri (@ "http: //mydomain/comp.php? Compname =" + hostname); WebBrowser1.Refresh ();  

    Every funny number works fine. I also try the number only refreshes the Webbrozer with the final compname therefore:

    1 set text box comp1 http: //mydomain/comp.php? Compname = comp1 goes on 2. Set text box comp2 http: //mydomain/comp.php? Compname = comp1 goes on 3. Set textbox comp3 goes to http: // mydomain /comp.php?compname=comp3 4. Set text box comp956 http: //mydomain/comp.php? Compname = goes to comp3 5. Set Textbox comp111 http: //mydomain/comp.php? Compname = comp111 goes to <6>

    Try:

      webBrowser1.Stop (); WebBrowser1.Url = new Uri (@ "http: //mydomain/comp.php? Compname =" + hostname);  

    instead of the old code


    wpf - How to convert a Windows Phone 8 app to a Windows Runtime XAML app -


    How do I change my Windows Phone 8 app (formerly developed app) into the Windows Runtime XML app? This is necessary because I need to do automation testing using Microsoft Tools (coded UI test) because the app needs to be a Windows Runtime XAM app. Is there a tool to convert or will help VS 2013? ?? I have also sent some MSDN links, but there was nothing much.

    There is no automatic device. You have to manually change it, how difficult it is to depend on the application, how well your UI and data logic are different, and which uses parts of the net framework. Documents linked to you provide options for some classes. You will also need to upgrade the Xaml code to match the use of Windows.UI.Xaml.

    Visual Studio 2013 Update 2 (or later) will be required to create a Windows Phone Runtime app, but this is not a conversion tool provided.


    Error in php mysql connection using xampp -



    Error in php mysql connection using xampp -

    i'm trying connect html page using php form mysql database using xampp. html page working fine press submit button page distinct characters appears, can help problem?![php page][1]

    html code:

    <html> <body> <body bgcolor="black"> <font color="white"> <form action="a.php" method="post"> <center> <h1><font color = "gold"><marquee>welcome online bus booking!!!</h1></marquee> </font color> <h3> first name:<br><input type = "text" name = "fnm"><br> lastly name:<br><input type = "text" name = "lnm"><br> mobile:<br><input type = "text" name = "mob"><br> age:<br><input type = "number" name = "age"><br> source:<input type = "text" name = "src"> destination:<input type = "text" name = "des"><br> <font color="orange">passenger address:<br></font color> street:<br><input type = "text" name = "str"><br> area:<br><input type = "text" name = "area"><br> city:<br><input type = "text" name = "cty"><br> <input type = "submit"> </h3> </center> </form> </body> </html>

    php code:

    <?php $con=mysqli_connect("localhost","root","","testdb"); if(mysqli_connect_error()) { echo "failed" . mysqli_connect_error(); } $sql="insert exp values('$_post[fnm]', '$_post[lnm]', $_post[mob], $_post[age], '$_post[src]', '$_post[des]', '$_post[str]', '$_post[area]', '$_post[cty]')"; if (!mysqli_query($con,$sql)) { die('error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?>

    here, allow me right syntax :

    $sql="insert exp values('".$_post['fnm']."','".$_post['lnm']."','".$_post['mob']."', '".$_post['age']."','".$_post['src']."','".$_post['des']."','".$_post['str']."','".$_post['area']."', '".$_post['cty']."')";

    php mysql database-connection

    scripting - While loop is not working to read file in perl script -



    scripting - While loop is not working to read file in perl script -

    i writing perl script , trying read 2 diff files..

    first file open $data1, "<", "/tmp/csi_to_prod_111111_20141004_225038/att_application.properties" or die "unable open prod file"; while (<$data1>) { chomp(); foreach $line (<$data1>) { next if ( $line =~ /(^\s*#|^$)/ ); chomp($line); foreach $token (@csitokens) { if ( $line =~ /$token=/ ) { ( $tok, @val ) = split( /=/, $line, 2 ); print "@val\n"; } } } } close($data1) or warn "not able close fil: \n"; second file open $data2, "<", "/opt/app/d1ebl1m5/dv02/cingbt02/j2eeserver/config/amss/application/properties/att_application.properties_try" or die "unable open file: $!"; while (<$data2>) { foreach $line1 (<$data2>) { print "$line1"; } } close($data2) or warn "not able close fil: \n";

    the loop first file working fine , displaying output sec loop doesnt display anything..

    there many while , foreach loops. need 1 of them:

    open $data2, "<" , "/opt/app/d1ebl1m5/dv02/cingbt02/j2eeserver/config/amss/application/properties/att_application.properties_try" or die "unable open file: $!"; while( $line1 = <$data2> ) { print "$line1"; } close($data2);

    the same applicable first loop. yo have error on die-check after file open

    perl scripting while-loop

    javascript - How could I keep paragraph format using CKeditor4.4.4 in CodeIgniter? -



    javascript - How could I keep paragraph format using CKeditor4.4.4 in CodeIgniter? -

    i'm using inline ckeditor 4.4.4 in codeiniter. how can maintain paragraph format when utilize ckeditor inserting info database , receive back?

    here javascript code ckeditor plugin , configure:

    <script> ckeditor.inline('skill', { toolbar: [ { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'source', '-', 'save','preview', 'print' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'cut', 'copy', 'paste', 'pastetext', 'pastefromword', '-', 'undo', 'redo','image', 'flash', 'table', 'horizontalrule', 'smiley', 'specialchar', 'pagebreak','styles', 'format', 'font', 'fontsize' ] }, '/', { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: ['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', '-', 'removeformat','numberedlist', 'bulletedlist', '-', 'outdent', 'indent', '-', 'blockquote', 'creatediv', '-', 'justifyleft', 'justifycenter', 'justifyright', 'justifyblock', '-', 'bidiltr', 'bidirtl'] }, ] }); </script>

    and here html form

    <li> <span class="cvspan">description:</span><?php echo form_textarea('we_dis',set_value('skill',$property->skill));?> </li>

    when submit text database , result without format , text show images 2

    now work me when create css self below code if want create ckeditor on view should write own css create html tag

    .cke_textarea_inline { padding:0px; min-height:100px; height: auto; overflow: auto; border: 1px solid gray; -webkit-appearance: textfield; } .cke_textarea_inline ol{ padding-left:2em; list-style-position:inside; list-style:decimal } .cke_textarea_inline ol li{ padding-left:0em; list-style-position:inside; list-style:decimal } .cke_textarea_inline ol li ol{ padding-left:2em; list-style-position:inside; list-style:decimal } .cke_textarea_inline ul{ padding-left:3.2em; list-style-position:inside; list-style:disc; } .cke_textarea_inline ul li{ padding-left:.8em; list-style-position:inside; list-style:disc; } .cke_textarea_inline ul li ul{ padding-left:1em; list-style-position:inside; list-style:disc; } .cke_textarea_inline ul li ul li{ padding-left:.6em; list-style-position:inside; list-style:disc; }

    javascript html codeigniter ckeditor django-ckeditor

    java - how to get the last history token in GWT -



    java - how to get the last history token in GWT -

    i want previous token of navigation.

    for exemple, beingness in page:

    http://www.example.com/com.example.gwt.historyexample/historyexample.html#page1

    i redirected somehow new page :

    http://www.example.com/com.example.gwt.historyexample/historyexample.html#page2

    now if want current token, can way:

    string currentplace = placemanager.getcurrentplacerequest().getnametoken();

    currentplace receive "page2" can't figure how previous token "page1"

    you can add together code illustration in onmoduleload() method or class created @ origin of application , of course of study not destroyed afterward

    private place previousplace; private place currentplace; eventbus.addhandler(placechangeevent.type, new placechangeevent.handler() { public void onplacechange(placechangeevent event) { previousplace = currentplace; currentplace = event.getnewplace(); } });

    java gwt token history

    session - php page atomicity and consistency? -



    session - php page atomicity and consistency? -

    here possible scenario: php page accesses session variables session ssid 1000. on tab, user logs out,which means destroying current session. i'll assume worst case scenario happen: code still running @ page 1. happens in situation? code @ page 1 still uses session vars ssid 1000, doesn't exist now? can utilize "try catch" block handle potential exception raised ? happens session vars session ssid 1000, might using db querying @ page 1?

    i know question might weird, scenario of import me because want handle exception( if situation raises exception) , prevent inconsistent values beingness inserted db.

    thanks in advance

    web pages stateless. not in "logged in" or "logged out" state. if session closed while i'm viewing page, attempts go on utilize session fail. $_session recreated when seek access page - new session. need web programmer handle $_session beingness empty.

    php session atomicity consistency

    Java Arrays: Finding Unique Numbers In A Group of 10 Inputted Numbers RE: -



    Java Arrays: Finding Unique Numbers In A Group of 10 Inputted Numbers RE: -

    java arrays: finding unique numbers in grouping of 10 inputted numbers

    i have problem have looked doestovsky's question question, need know on how create part on finding duplicates function of it's own:

    java.util.scanner input = new java.util.scanner(system.in); int[] numbers = new int[10]; boolean[] usedbefore = new boolean[10]; // insert numbers (int = 0; < numbers.length; i++) { // read number console numbers[i] = input.nextint(); // check if number inserted before usedbefore[i] = false; for(int k = 0; k < i; k++) { if(numbers[k] == numbers[i]) { usedbefore[i] = true; break; } } } // print numbers not inserted before for(int j = 0; j < numbers.length; j++) { if(!usedbefore[i]) { system.out.print(string.valueof(numbers[j])+" "); } }

    i have tried part of code , worked need take part find duplicates function of it's own powered arrays.

    credits thimokl creating code.

    let's seek else, using treeset, , let's rid of for

    import java.util.*; public class duplicate { private static treeset<integer> numbers = new treeset<integer>(); private static treeset<integer> duplicates = new treeset<integer>(); public static void main (string[] args) { scanner input = new scanner(system.in); int n=0; int numberofinttoread=10; (int = 0; < numberofinttoread; i++) { // read number console n=input.nextint(); // check if number inserted before checkifduplicate(n); } // print numbers not inserted more 1 time (integer j : numbers) { system.out.print(j+" "); } } public static void checkifduplicate(int n){ if(!numbers.contains(n) && !duplicates.contains(n)){ numbers.add(n); }else{ numbers.remove(n); duplicates.add(n); } } }

    but if want utilize arrays not collection of sort, need declare arrays class members, way can set "for" checks duplicates in function give i, , way can set "for" printing in function. , give numbers.length. should trick.

    java arrays int

    php - Javascript setinterval() sets variables to null after the first run of the function -



    php - Javascript setinterval() sets variables to null after the first run of the function -

    i trying output of iframe b in page a div in page a. wrote next code:

    function funcexec() { todornamespace = {}; todornamespace.nan = true; todornamespace.i = 0; todornamespace.div = document.getelementbyid("render_frame"); todornamespace.iframe = document.getelementbyid('iframe_exec'); var patharray = window.location.href.split('/'); var protocol = patharray[0]; var host = patharray[2]; var url = 'http://' + host; var src = url + '?q=exec_command'; // div.appendchild(iframe); todornamespace.iframe.setattribute("src", src); var interval = setinterval(function() { myprint() }, 200, this); function myprint() { var text; var body = todornamespace.iframe.contentdocument.body; if (body != null) { text = body.innerhtml; } if (text != null) { var logs = text.split("\n"); } if (logs != undefined) { if (logs[todornamespace.i] != "</pre>nan" && logs[todornamespace.i] != undefined) { todornamespace.div.innerhtml = todornamespace.div.innerhtml + logs[todornamespace.i] + "</br>"; todornamespace.i++; } else if (logs[todornamespace.i] == "</pre>nan") { todornamespace.div.innerhtml = todornamespace.div.innerhtml + "</pre>"; clearinterval(interval); } else { } } } }

    the problem prints first line iframe , dies error :

    uncaught typeerror: cannot read property 'body' of null @ line 19

    i checked debugger, after sec start of function myprint() variables todornamespace.iframe , todornamespace.div becoming null. why happening , can prepare reading problem? iframe b php page, printing output @ rate 2-3 lines per sec php code:

    while ( @ ob_end_flush () ) ; $proc = popen ( "mybashcommand", 'r' ); echo '<pre>'; while ( ! feof ( $proc ) ) { echo fread ( $proc, 4096 ); @ flush (); } echo '</pre>'; @ flush (); echo 'nan';

    which suggests cannot wait until page generated 1 time , print output, need in "real time", hence iteration setinterval text iframe. ideas how implement it?

    javascript php html scope setinterval

    android - Setting up Google Wallet merchant account without business -



    android - Setting up Google Wallet merchant account without business -

    i'm 18 years old , have made app, sell on android market. own developer account, google says need google wallet merchant business relationship sell apps. country supported, registration asks me business information, not have. can sell app ? have own business ? thanks!

    android

    iis 7.5 - WCF more than 50 concurent long running request -



    iis 7.5 - WCF more than 50 concurent long running request -

    hy, have wcf test service, nil thread.sleep(10000) , phone call 200 clients. problem response time greater , greater, after 10 minutes on 40 sec... have tired alter web.config , machine.config too. have windows 2008 r2 , iis 7.5

    in web.config

    <servicethrottling maxconcurrentcalls="100" maxconcurrentsessions="400" maxconcurrentinstances="2000" />

    in macine.config

    <processmodel autoconfig="false" loglevel="none" maxiothreads="1000" maxworkerthreads="1000" miniothreads="100" minworkerthreads="100" />

    in aspnet.config

    <applicationpool maxconcurrentrequestspercpu="5000" maxconcurrentthreadspercpu="0" requestqueuelimit="5000" />

    the wcf service:

    public interface isampleservice { [operationcontractattribute] string samplemethod(string msg); } public class sampleservice : isampleservice { public string samplemethod(string msg) { thread.sleep(10000); homecoming msg; } }

    here solution:

    [servicecontract(namespace = "http://microsoft.wcf.documentation")] public interface isampleservice { [operationcontract] task<string> samplemethod(string msg); } public class sampleservice : isampleservice { async task<string> isampleservice.samplemethod(string msg) { var task = task.factory.startnew((param) => { homecoming "return server : " + msg; }, taskcontinuationoptions.longrunning); await task.delay(10000); homecoming await task.configureawait(false); } }

    and need web.config changes:

    <servicethrottling maxconcurrentcalls="500" maxconcurrentsessions="1000" maxconcurrentinstances="2000" />

    wcf iis-7.5

    javascript - Should I use nested collections to organize my backbone.js app? -



    javascript - Should I use nested collections to organize my backbone.js app? -

    i'm having bit of tough time wrapping head around backbone. want utilize deliver info based on different races in different cities.

    so, ideally, have collection of cities, , each item in collection collection of races in city, composed of candidates (i think). on right path?

    my info feed array of objects, various identifying key: values.

    example: var info = [ { 'name': 'john smith', 'race': 'mayor', 'city': 'york' }, { 'name': 'jack black', 'race': 'mayor', 'city': 'york' }, { 'name': 'billy bob', 'race': 'mayor', 'city': 'trenton' } , { 'name': 'burt reynolds', 'race': 'mayor', 'city': 'trenton' } ]

    backbone not back upwards nested models/collections well, , in utilize case, don't see why necessary.

    one way of doing want accomplish create 1 collection of of data, utilize .where method info want when ready manipulate/display it. instance, create collection of of data, lets refer mycollection, if want deliver info based on mayor race in trenton, var trentonmayorrace = mycollection.where({race: 'mayor', city: 'trenton'}) , homecoming array of models match attributes.

    javascript backbone.js

    python - MLlib and pyspark features -



    python - MLlib and pyspark features -

    i utilize areaunderroc mllib in apache spark. running spark 1.1.0 , function not available in pyspark available in scala.

    is there feature tracker tracks advancement of porting scala apis python apis?

    i have tried search in official jira not find ticket number corresponding this.

    pyspark.mllib.evaluation.binaryclassificationmetrics.areaunderroc has been introduced in spark 1.4.0:

    from pyspark.mllib.evaluation import binaryclassificationmetrics scoreandlabels = ... binaryclassificationmetrics(scoreandlabels).areaunderroc

    python scala apache-spark mllib apache-spark-mllib

    c# - What causes "Role Instances are taking longer than expected" error with Azure SDK 2.4? -



    c# - What causes "Role Instances are taking longer than expected" error with Azure SDK 2.4? -

    i getting infamous "role instances taking longer expected" error when trying start azure project single worker role. used work before, started failing without apparent reasons between 2 debug sessions.

    i tried create brand new solution new azure project , default worker role, fails start.

    i have found numerous other questions , forum posts discussing topic, of them outdated , none of suggestions worked.

    i found no relevant message in event logs, error message found in c:\users\username\appdata\local\dftmp\emulatorruntimelogs\errorruntime.log, contains lots of lines this:

    [00006892:00014472, 2014/10/16, 18:40:45.247, error] failed create fsrm quota manager instance.

    the output role in compute emulator displays next log indefinitely:

    [fabric] role instance: deployment24(4).mysolution.myproject.mysolution.myproject.0 [fabric] role state busy [fabric] role state aborted [fabric] role state busy [fabric] role state aborted [fabric] role state busy [fabric] role state aborted [fabric] role state busy ...

    do have suggestions can cause error latest 2.4 version of azure sdk?

    i solved removing startup tasks servicedefinition.csdef

    c# azure azure-worker-roles azure-compute-emulator

    c# - Operator '&&' cannot be applied to operands of type 'bool' and 'bool?' -



    c# - Operator '&&' cannot be applied to operands of type 'bool' and 'bool?' -

    this question has reply here:

    weird operator precedence ?? (null coalescing operator) 2 answers

    trying read datacontext class

    var users = new list<user>(); var roles = new int[] { 1, 2 }; // here need users who's role in role (1, 2), hence above line // , need user who's isvalid field true, please note isvalid sql 'bit' field , nullable //this doing foreach (var user in datacontext.users .where(u => roles.contains(u.roleid.value) && u.isvalid ?? false == true)) // here '&&' part i'm struggling , getting above error { users.add(new user() { // users added in collection }); }

    so question in clause need user's in role(1,2) && isvalid == true, if isvalid 'null' create false.

    you have wrap in parentheses:

    roles.contains(u.roleid.value) && (u.isvalid ?? false)

    bit of confused (u.isvalid ?? false), not mean if u.isvalid == null create false , users u.isvalid false, not want.

    roles.contains(u.roleid.value) && u.isvalid.hasvalue && u.isvalid

    c# linq

    mysql - Joining two queries to display in the same -



    mysql - Joining two queries to display in the same -

    i have 2 queries display independently.

    select 'new orders' 'type', @new_customers 'total', concat(round((@new_customers / @total_purchases) * 100, 1), '%') 'percentage'; select 'repeat orders' 'type', @repeat_customers 'total', concat(round((@repeat_customers / @total_purchases) * 100, 1), '%') 'percentage';

    i list them show such

    +---------------+-------+------------+ | type | total | percentage | +---------------+-------+------------+ | new orders | 4 | 11.4% | | repeat orders | 4 | 11.4% | +---------------+-------+------------+

    here variables , view

    ## sql variables select count(distinct customer_email) sales_flat_order @new_customers; select count(customer_email) view_orders total_orders > 1 @repeat_customers; ## view client total orders create view foodhub_magento.v_orders select customer_email, count(*) total_orders foodhubsales_flat_order grouping customer_email having count(customer_email) > 1;

    you utilize union all operator:

    select 'new orders' 'type', @new_customers 'total', concat(round((@new_customers / @total_purchases) * 100, 1), '%') 'percentage' union select 'repeat orders' 'type', @repeat_customers 'total', concat(round((@repeat_customers / @total_purchases) * 100, 1), '%') 'percentage';

    mysql sql

    java - How to set checkbox checked? -



    java - How to set checkbox checked? -

    so created custom listview adapter. every listview's item contains checkbox. , have button check or uncheck checkboxes in listviw. seek so:

    // buttons' click listener's code for(int = 0; < list.getcount(); i++) { // list listview view item = adapter.getview(1, null, list); // adapter list's adapter checkbox ch = ((checkbox)item.findviewbyid(r.id.mycheckbox)); ch.setchecked(true); }

    as can see seek set checkboxes in listview checked. code perfomed successfully, no exception. checkboxes reman unchecked. why?

    change :

    view item = adapter.getview(1, null, list);

    to :

    view item = adapter.getview(i, null, list);

    java android checkbox

    ios - Having issue with AVAssetWriterInput parameter sourceFormatHint -



    ios - Having issue with AVAssetWriterInput parameter sourceFormatHint -

    i working avassetwriterinput sourceformathint parameter giving warning:

    incompatible integer pointer conversion sending 'int' parameter of type 'cmformatdescriptionref' (aka 'const struct opaquecmformatdescription *')

    here code:

    avassetwriterinput* videowriterinput = [avassetwriterinput assetwriterinputwithmediatype:avmediatypevideo outputsettings:settings sourceformathint:kcmmediatype_video]; videowriterinput.expectsmediadatainrealtime = yes; videowriterinput.transform = videotrack.preferredtransform; avassetwriter *videowriter = [[avassetwriter alloc] initwithurl:outputurl filetype:@"public.mpeg-4" error:nil]; [videowriter addinput:videowriterinput];

    what parameter should pass in sourceformathint?

    hello see below setup working me....:)

    -(bool) setupwriter { nserror* error = nil; videowriter = [[avassetwriter alloc] initwithurl:[self tempfileurl] filetype:avfiletypequicktimemovie error:&error]; nsparameterassert(videowriter); //configure video nsdictionary* videocompressionprops = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithdouble:1024*1024], avvideoaveragebitratekey, nil ]; nsdictionary* videosettings = [nsdictionary dictionarywithobjectsandkeys: avvideocodech264, avvideocodeckey, [nsnumber numberwithint:320.0], avvideowidthkey, [nsnumber numberwithint:568.0], avvideoheightkey, videocompressionprops, avvideocompressionpropertieskey, nil]; videowriterinput = [avassetwriterinput assetwriterinputwithmediatype:avmediatypevideo outputsettings:videosettings]; // videowriterinput =[avassetwriterinput assetwriterinputwithmediatype:avmediatypevideo outputsettings:videosettings sourceformathint:kcmmediatype_video]; nsparameterassert(videowriterinput); videowriterinput.expectsmediadatainrealtime = yes; nsdictionary* bufferattributes = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint:kcvpixelformattype_32argb], kcvpixelbufferpixelformattypekey, nil]; avadaptor = [avassetwriterinputpixelbufferadaptor assetwriterinputpixelbufferadaptorwithassetwriterinput:videowriterinput sourcepixelbufferattributes:bufferattributes] ; //add input [videowriter addinput:videowriterinput]; [videowriter startwriting]; [videowriter startsessionatsourcetime:cmtimemake(0, 1000)]; homecoming yes; }

    ios objective-c avfoundation avassetwriter

    ios - How to stop clipping of NSString drawAtPoint: withAttributes: in a UIView subclass -



    ios - How to stop clipping of NSString drawAtPoint: withAttributes: in a UIView subclass -

    how 1 utilize drawatpoint: withattributes within instance of uiview subclass text drawn on screen can seen outside of frame of uiview subclass instance? utilize of [self setclipstobounds:no] within subclass of uiview resulting in clipping of text along frame of view.

    the uiview subclass using, wordview.m:

    #import "wordview.h" @implementation wordview -(id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { [self setbackgroundcolor:[uicolor redcolor]]; [self setclipstobounds:no]; } homecoming self; } - (void)drawrect:(cgrect)rect { [@"hello world" drawatpoint:cgpointmake(0, 0) withattributes:@{ nsfontattributename: [uifont systemfontofsize:40], nsforegroundcolorattributename:[uicolor greencolor] }]; } @end

    i creating wordview in viewwillappear stage of viewcontroller:

    -(void)viewwillappear:(bool)animated { wordview *wordview = [[wordview alloc]initwithframe:cgrectmake(20, 20, 150, 40)]; [self.view addsubview:wordview]; }

    ios objective-c uiview

    c# - Get Printer Names and number of trays -



    c# - Get Printer Names and number of trays -

    i trying display available printer names on server , number of trays associated them. how display number of trays associated printer?

    i used next code. works doesn't display communicate information. should include messagebox? how display these information?

    using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.printing; using system.drawing.printing; using system.management; namespace find { class programme { static void main(string[] args) { var printerquery = new managementobjectsearcher("select * win32_printer"); foreach (var printer in printerquery.get()) { var name = printer.getpropertyvalue("name"); var status = printer.getpropertyvalue("status"); var isdefault = printer.getpropertyvalue("default"); var isnetworkprinter = printer.getpropertyvalue("network"); console.writeline("{0} (status: {1}, default: {2}, network: {3}", name, status, isdefault, isnetworkprinter); } } } }

    your code works fine me. it's console window displaying info , exiting. seek adding console.readkey() @ end of main method, console session remains after displaying information.

    at end of main method, add together like:

    console.write("\ndone! press key exit..."); console.readkey();

    c# asp.net printers tray network-printers

    Unable to Initialize Slider Control Variable in MFC Visual .NET 2008 -



    Unable to Initialize Slider Control Variable in MFC Visual .NET 2008 -

    i created ordinary vertical slider variable in mfc visual .net 2008. when seek initialize slider command variable phone call "m_vsliderbar" through next lines of codes

    m_vsliderbar.setrange(0, 100, true); m_vsliderbar.setpos(0); m_vsliderecho.format("%d", 0);

    then next error output:

    error c2664: 'void atl::cstringt<basetype,stringtraits>::format(const wchar_t *,...)' : cannot convert parameter 1 'const char [3]' 'const wchar_t *'

    i don't understand error. help me compile code properly?

    you have unicode build. seek this:

    m_vsliderecho.format(_t("%d"), 0);

    the error message telling format function expecting wchar_t argument (i.e. 16-bit character, means unicode) , have supplied ansi string. _t() macro prepends right modifier literal string depending on project properties.

    so unicode builds, translate ;

    m_vsliderecho.format(l"%d", 0);

    variables mfc visual-studio-2008

    Unexpected EOF in mysql shell script -



    Unexpected EOF in mysql shell script -

    i'm getting mysql info shell this:

    #!/bin/bash keyorpass=$1 intercom=$2 flat=$3 number=$4 mysql -ulogin -ppassword db_name << eof select codeguestemail, codeprivateemail mbus_clients flat=$flat , domophone=$intercom; eof

    i found solution in tutorial, says: check manual corresponds mysql server version right syntax utilize near 'eof' what's wrong? how can finish mysql session? http://www.cyberciti.biz/faq/using-mysql-in-shell-scripts/ here illustration of tutorial found solution. update added different quotes eof doesn't work too.

    in query pass dynamic variable quotes ..

    select codeguestemail, codeprivateemail mbus_clients flat='$flat' , domophone='$intercom';

    or seek this

    select codeguestemail, codeprivateemail mbus_clients flat=${flat} , domophone=${intercom};

    mysql shell

    Nodejs Websocket image upload not working on CentOS -



    Nodejs Websocket image upload not working on CentOS -

    i implemented websocket file upload implementation described on: http://code.tutsplus.com/tutorials/how-to-create-a-resumable-video-uploade-in-node-js--net-25445

    it worked great on ubuntu vm. when uploaded code centos 6 server, images didn't work when got uploaded. tried uploading big text file, , fine. tried zip, , still didn't work. file on server , file beingness uploaded have same file size appears work fine. can assume sort of character encoding issue? stuck. got ideas?

    i'm tempted seek using ajax working if haven't made progress in next day or 2.

    i found solution.i had apply new chain rule iptables,and allow server hear on custom port web sockets..after that,everything works great. had create permanent.

    websocket

    jquery - How to create a border that will outline div minus the margins -



    jquery - How to create a border that will outline div minus the margins -

    ok, have issue. using 960 gs , can see code complicated layout me @ least. part of issue supposed have 10px gutter. divs didn't. accomplish layout wanted had add together top margin of 10px of divs. needed add together hover effect padding color alter divs. can see on divs added 10px border goes around margin too. not achieving want. set class , jquery remove margin when hover on divs move/shift. 1 time again not achieving effect want. please help - either how can prepare grid scheme don't have add together top margin or how can add together padding doesn't include margins. html below set code, js , css on jsfiddle, please see: http://jsfiddle.net/penrysh/mr99962t/

    <div class="page"> <div class="container_14"> <div class="grid_6 alpha omega"> <div class="grid_6 alpha"> <article class="grid_4 alpha results"> <div id="bulletin" class="tooltip" title="tip1"> <h2>bulletin board</h2> <p></p> </div> </article> <!-- end bulletin board --> <article class="grid_2 omega results"> <div id="take5" class="tooltip" title="tip2"> <ul> <li><h3>take 5</h3></li> <li><img src="http://placehold.it/75x75" alt="learning break icon" /></li> <li><a href="#take5box" title="take 5 learning break" class="lightbox">learning break</a></li> <div id="take5box"> <h3>take 5</h3> <p>more content...</p> <a href="#">take 5</a> </div> </ul> </div> </article> <!-- end take 5 --> <article class="grid_2 omega results1"> <div id="longterm" class="tooltip" title="tip3"> <ul> <li><h3>long term</h3></li> <li><img src="http://placehold.it/75x75" alt="long term learning icon" /></li> <li><a href="#longtermbox" title="long term learning" class="lightbox">learning</a></li> <div id="longtermbox"> <h3>long term learning</h3> <p>more content...</p> <a href="#">long term learning</a> </div> </ul> </div> </article> <!-- end long term --> <div class="clear"></div> <article class="grid_6 alpha omega results1"> <div id="career" class="tooltip" title="tip4"> <h2>career insight: highlight work!</h2> <p>create sharepoint blog can link to, upload, , discuss work. becomes part of professional portfolio.</p> </div> </article> <!-- end career insight --> </div> </div> <div class="grid_8 omega"> <div class="grid_8 omega"> <article class="grid_8 alpha omega results"> <div id="whatis" class="tooltip" title="tip5"> <h2>what learning , development network?</h2> </div> </article> <!-- end --> <div class="clear"></div> <article class="grid_6 alpha results1"> <div id="featured" class="tooltip" title="tip6"> <h2>featured courses</h2> <table> <tbody> <tr> <td><img src="http://placehold.it/75x75" alt="health care 101" /></td> <td><a href="#"></a></td> </tr> <tr> <td><img src="http://placehold.it/75x75" alt="our values" /></td> <td><a href="#">our values</a></td> </tr> </tbody> </table> </div> </article> <!-- end featured courses --> <article class="grid_2 omega results1"> <div id="kl" class="tooltip" title="tip7"> <ul> <li><img src="http://placehold.it/75x75" alt="" /></a></li> <li><a href="#klbox" title="" class="lightbox"></a></li> <div id="klbox"> <h3></h3> <p>more content...</p> <a href="#"></a> </div> </ul> </div> </article> <!-- end kl --> <article class="grid_2 omega results1"> <div id="mylearning" class="tooltip" title="tip8"> <ul> <li><img src="http://placehold.it/75x75" alt="" /></li> <li><a href="#mylearningbox" title="m" class="lightbox">my learning</a></li> <div id="mylearningbox"> <h3></h3> <p>more content...</p> <a href="#"></a> </div> </ul> </div> </article> <!-- end --> </div> </div> <div class="clear"></div> </div> <!-- end container --> </div> <!-- end page -->

    please take @ jsfiddle, believe require. i've done i've set margin-top of 10px each element results1 class , removed previous margin-top of 10px had set different elements. since you're setting border results1_hover class, margin-top needs applied , not child-container.

    jquery html css 960.gs

    unix - Concatenating input to svn list command with output, then pass it to grep -



    unix - Concatenating input to svn list command with output, then pass it to grep -

    i have next shell command partially working:

    svn list $myrepo/libs/ | xargs -p 10 -l 1 -i {} echo $myrepo/libs/ {} trunk | sed 's/ //g' | xargs -p 20 -l 1 svn list --depth infinity | grep .xlsx

    where $myrepo corresponds svn server address.

    the libs folder contains number of subfolders (currently 30 although 100), each contain number of tags, branches , trunk. wish list of xlsx files contained within trunk folder of each of these subfolders. command above works fine returns relative path $myrepo/libs/subfolder/trunk/, back:

    1/2/3/file.xlsx

    because of potentially big number of files have search through, performing in 2 parallel steps using xargs -p (i not have , cannot utilize parallels). trying in 1 command can used in php/perl/etc. , avoid multiple sytem calls.

    what concatenate input part of command:

    xargs -p 20 -l 1 svn list --depth infinity

    with output it, give following:

    $myrepo/libs/subfolder/trunk/1/2/3/file.xlsx

    then pass grep find xlsx files.

    i appreciate assistance provided.

    if manage correctly divine intention, might work you.

    svn list "$myrepo/libs/" | xargs -p 20 -n 1 sh -c 'svn list -r "$0/trunk/$1" | sed -n "s%.*\.xlsx$%$0/trunk/$1/&%p"' "$myrepo"

    briefly, postprocess output inner svn list filter .xslx files , tack total svn path on @ same time. way, processing happens repo path still known.

    we hack things bit passing in "$myrepo" "$0" subordinate sh don't have export variable. input outer svn list comes $1.

    (the repos have access have different layout there copy/paste error somewhere.)

    unix svn grep xargs

    powershell - Add documentation to custom methods (ScriptMethod) -



    powershell - Add documentation to custom methods (ScriptMethod) -

    a custom powershell script or function can documented standard comment @ origin of body:

    function welldocumented { <# .synopsis documented function .description "be verbose in documentation" - .parameter foo should 42 or 15, not more #> param( [int]$foo ) <# ... #> }

    get-help welldocumented returns nice info then. how can document custom scriptmethods in custom objects? next not work:

    $myclass | add-member -memtype scriptmethod -name "foo" -value { <# .synopsis - brief .description #> <# ... #> }

    is there standard way document scriptmethods?

    you can write script method separate function first (like did welldocumented) pass function scriptblock:

    class="lang-powershell prettyprint-override">$myclass | add-member -memtype scriptmethod -name "foo" -value ${function:welldocumented}

    you still can't phone call get-help $myclass.foo, can phone call get-help welldocumented.

    in testing not able help on method.

    powershell powershell-v2.0 powershell-v3.0

    python - Beautiful Soup 4 find_all don't find links that Beautiful Soup 3 finds -



    python - Beautiful Soup 4 find_all don't find links that Beautiful Soup 3 finds -

    i noticed annoying bug: beautifulsoup4 (package: bs4) finds less tags previous version (package: beautifulsoup).

    here's reproductible instance of issue:

    import requests import bs4 import beautifulsoup r = requests.get('http://wordpress.org/download/release-archive/') s4 = bs4.beautifulsoup(r.text) s3 = beautifulsoup.beautifulsoup(r.text) print 'with beautifulsoup 4 : {}'.format(len(s4.findall('a'))) print 'with beautifulsoup 3 : {}'.format(len(s3.findall('a')))

    output:

    with beautifulsoup 4 : 557 beautifulsoup 3 : 1701

    the difference not minor can see.

    here exact versions of modules in case wondering:

    in [20]: bs4.__version__ out[20]: '4.2.1' in [21]: beautifulsoup.__version__ out[21]: '3.2.1'

    you have lxml installed, means beautifulsoup 4 utilize that parser on standard-library html.parser option.

    you can upgrade lxml 3.2.1 (which me returns 1701 results test page); lxml uses libxml2 , libxslt may blame here. may have upgrade those instead / well. see lxml requirements page; libxml2 2.7.8 or newer recommended.

    or explicitly specify other parser when parsing soup:

    s4 = bs4.beautifulsoup(r.text, 'html.parser')

    python web web-scraping beautifulsoup