Tuesday, 15 February 2011

node.js - Asyncronous set method in mongoose -


When a new user prompts the MPOS & amp; Before saving the MongoDB user frequency, I want to get the values ​​from another collection. Currently I use the following solution, but it causes the user to save twice ... Worse, if the user does not pass verification first, then the save () is said anyway. Usually an unwanted exception is generated.

My current code works in the following ways:

  UserSchema.path ('address.postCode'). Set (function (newVal), cb) {var that = this; This.model ('PostCode'). FindOne ({postCode: newVal}, function (mistake, postcode) {if (postCode) {that.longitude = postCode.longitude; that.latitude = Postcode.latitude;} and {that.longitude = undefined; that.latitude = undefined ;} That.save ();}); Return newVal;});  

Anyone knows the better way to do this?

The function is expected to have a synchronous return, you have an asynchronous call inside this function and therefore < Code> Back will be named after PostCode

Also, you should not call save inside the setter Save as it will be saved anyway.

Since you want to get data from another model, you should use pre-middleware, for example:

  UserSchema.pre ('save', true, Function (next, done) {var that = this; if (this.isNew || this.isModified ('address.postCode')) {This.model ('PostCode'). FindOne ({postCode: that.address.postCode }, Function (mistake, postcode) {if (postCode) {that.longitude = postCode.longitude; that.latitude = postCode .latitude;} and {that.longitude = undefined; that.latitude = undefined;} done (); });} next ();}); The second parameter has been passed for  

pre ( true ), it defines that it is an asynchronous middleware.

For more information on mediators, check.


php - XDegug session termination (PDT) -


When I end the XDebug session in PDT, cookies are not deleted and the session is still active. Thus, I have to end each debugging session manually with XDEBUG_SESSION_STOP in the browser, otherwise, while trying to connect Xdebug, I run the script without debugging. Is this a PDT issue, or maybe I'm doing something wrong? My configuration: Eclipse 4.4.2, Xdebug 2.3.1, Windows 7 X64. Thank you.

This is a bug, in order to ignore debug session restoration, "jit" in debug configuration Disable, or manually remove cookies (for example Firefox / Chrome plugin).

Bug Report:


Laravel 4 Schema Builder - Circular Reference -


मेरे पास उपयोगकर्ता तालिका और एक कंपनी तालिका है

उपयोगकर्ता तालिका में एक कॉलम 'company_id' है, जो संदर्भ Companies.id और कंपनियों के पास कॉलम 'असाइनमेंट' है, जो यूजर को सूचित करता है IID।

जाहिर है, कोई फर्क नहीं पड़ता कि मैं पहली बार क्या बनाने का प्रयास करता हूं, मुझे यह कहते हुए एक त्रुटि मिलती है कि यह संदर्भ बाधा नहीं बना सकता है क्योंकि दूसरे तालिका मौजूद नहीं है।

मैं इसे मैन्युअल रूप से कर सकता हूं, लेकिन मैं कारीगर माइग्रेट कमांड का उपयोग करने के लिए एक मार्ग की तलाश कर रहा था।

क्या इसके लिए एक वैकल्पिक उपाय है?

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

  स्कीमा :: बनाएँ ('कंपनियां', फ़ंक्शन ($ तालिका) {$ table- & gt; वृद्धि ('आईडी'); $ table- & gt; स्ट्रिंग ('नाम'); $ टेबल- & gt; पूर्णांक ('प्राथमिकता'); $ टेबल- & gt; स्ट्रिंग ('रंग'); $ टेबल- & gt; स्ट्रिंग ('शॉर्ट-एन'); $ टेबल- & gt; पूर्णांक 'असाइनमेंट'); $ टेबल- & gt; विदेशी ('असाइनमेंट') - & gt; संदर्भ ('आईडी') - & gt; पर ('उपयोगकर्ता'); $ ta ble- & gt; timestamps (); }); स्कीमा :: बनाने ('उपयोगकर्ता', फ़ंक्शन ($ तालिका) {$ table-> वेतन वृद्धि ('आईडी'); $ टेबल- & gt; स्ट्रिंग ('उपयोगकर्ता नाम'); $ table- & gt; स्ट्रिंग ('पासवर्ड') ; $ Table- & gt; स्ट्रिंग ('ईमेल'); $ टेबल- & gt; पूर्णांक ('सुरक्षा'); $ टेबल- & gt; स्ट्रिंग ('टोकन'); $ table- & gt; पूर्णांक ('company_id'); $ तालिका- & gt; विदेशी ('company_id') - & gt; संदर्भ ('आईडी') - & gt; पर ('कंपनियां'); $ टेबल- & gt; टाइमस्टैम्प ();});  

आप ऐसा कर सकते हैं:

  स्कीमा :: निर्माण ('कंपनियों', फ़ंक्शन ($ तालिका) {$ table- & gt; वृद्धि ('आईडी'); $ टेबल- & gt; स्ट्रिंग ('नाम'); $ table- & gt; पूर्णांक ('प्राथमिकता') ; $ टेबल- & gt; स्ट्रिंग ('रंग'); $ टेबल- & gt; स्ट्रिंग ('शॉर्ट-ना'); $ टेबल- & gt; पूर्णांक ('असाइनमेंट'); $ टेबल- & gt; टाइमस्टैम्प ();}); स्कीमा :: बनाने ('उपयोगकर्ता', फ़ंक्शन ($ तालिका) {$ table-> वेतन वृद्धि ('आईडी'); $ टेबल- & gt; स्ट्रिंग ('उपयोगकर्ता नाम'); $ table- & gt; स्ट्रिंग ('पासवर्ड') ; $ Table- & gt; स्ट्रिंग ('ईमेल'); $ टेबल- & gt; पूर्णांक ('सुरक्षा'); $ टेबल- & gt; स्ट्रिंग ('टोकन'); $ table- & gt; पूर्णांक ('company_id'); $ तालिका- & gt; विदेशी ('company_id') - & gt; संदर्भ ('आईडी') - & gt; पर ('कंपनियां'); $ टेबल- & gt; टाइमस्टैम्प ();}); स्कीमा :: टेबल ('कंपनियों', फ़ंक्शन ($ तालिका) {$ table- & gt; विदेशी ('असाइनमेंट') - & gt; संदर्भ ('आईडी') - & gt; पर ('उपयोगकर्ता');});  

MS Access msoFileDialogFilePicker, hard codeFolder Location -


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

  • 2 जवाब

मेरे पास निम्न कोड है उपयोगकर्ता को फ़ाइल चुनने की अनुमति देता है वह भाग काम करता है; लेकिन मैं उस फ़ोल्डर का प्रारंभिक स्थान चाहूंगा जिसे उपयोगकर्ता कूटबद्ध होने के लिए ब्राउज़ कर रहा होगा।

  निजी उप इनपुटफ़ाइल_किल () Dim fDialog Office.FileDialog मंद फ़ाइलनाम के रूप में वैरिएल्ट मंद varFile जैसा वर्जन डिम ओप ऑब्जेक्ट सेट के रूप में oApp = CreateObject ("Excel.Application") 'सूची सूची सामग्री को साफ़ करें 'Me.TextBoxName =' '' फ़ाइल संवाद सेट करें 'सेट करें fDialog = Application.FileDialog (msoFileDialogFilePicker) fDialog के साथ। अनुमति दें MultiSelect = False' डायलॉग बॉक्स का शीर्षक सेट करें '। टाइटल = "कृपया फाइल चुनें"' वर्तमान फिल्टर को साफ़ करें, और अपना स्वयं का जोड़ें। ' फ़िल्टर्स। क्लीअर .Filters.Parent = "R: \" फ़ाइल का स्थान आमतौर पर रहता है \ ".फ़िल्टर। जोड़ें" एक्सेल सीएसवी "," * .csv ".फ़िल्टर। जोड़ें" फ्लैट फाइल txt "," * .txt " फ़िल्टर। जोड़ें "सभी फाइलें", "*। *" 'संवाद बॉक्स दिखाएं। यदि। शो विधि रिटर्न सच है, '' उपयोगकर्ता ने कम से कम एक फ़ाइल को चुना यदि। शो विधि रिटर्न '' False, उपयोगकर्ता ने रद्द किए क्लिक किया 'यदि। शो = सच तो' प्रत्येक फाइल के माध्यम से लूप चुने और हमारे सूची बॉक्स में इसे जोड़ने के लिए। 'प्रत्येक varFile में। चयनित फ़ाइलें फ़ाइल नाम = राइट (varFile, 51) फ़ाइल की प्रतिलिपि varFile, "\\ network \ location \" & amp; फ़ाइल नाम I.TextBoxName = फ़ाइल का नाम अगला अगला संदेशबाक्स "आपने फ़ाइल संवाद बॉक्स में रद्द किया क्लिक किया है।" एंड एंड एंड एंड एंड एंड एंड  

क्षमा करें, मैं स्टैक ओवरफ्लो पर समाधान खोजने के लिए समाप्त हो गया <पूर्व> आरंभिक दृश्य = एमएसओफ़ाइलडायलोगदृश्यसूची


java - Missing return Statement of multiple IFs -


Where's the problem? If I use a variable then it works fine, but I'm missing something.

  Public boolean xyzThere (string str) {if (str.length ()> gt 2) {if (str starts ("xyz")} {back true; } Else {for (int i = 1; i & lt; str.length () - 2; i ++) {if (str.substring (i, i + 3) .equals ("xyz") & amp; amp ;! Substring (i - 1, i) .equals (".")) {Back true; } Other {return false; }}}} Other {return false; }}   

In this situation, a return statement is required because the inside of the loop The code can not be reached

  else {for (int i = 1; i & lt; str.length () - 2; i ++) {if (str.substring (i, i + 3) .equals ("Xyz") & amp;! Str.substring (i - 1, i) .equals (".")) {Back true; } Other {return false; }}}  

java - Playing with form elements with setvisible method -


I am currently developing a program in Java SE and in my program, buttons, labels, text fields are constantly changing. Because the nature of the project Finally, I have realized that many of the set-usable genuine false in the source code are false. I have to play with all the components. Is this a good programming theory and as an alternative, do you give me some tips to increase the quality of work?

Thank you in advance,

Function should not play much with you Set Vivebel (but sometimes it is the best / easiest way and depends on your logic between your elements). To reduce this and better OPP programming is to use JPenle to collect its elements together as a group.


javascript - Instafeed changing tagged value by input -


I am trying to rename my tag with input, once the key is pressed it feed.run Is run again by ();

  var num = 60; Var inputTextValue; Window.onkeyup = keyup; Function Funnel (E) {inputTextValue = e.target.value; . $ ('# SearchValue') text (inputTextValue); If (e.keyCode == 13) {inputTextValue = e.target.value; Feed.run (); }} Var feed = new Instafeed ({get is: 'tagged', tagname: inputTextValue, userId: 3,614,616, accessToken: '3614616.467ede5.abc0b5a861d34365a5c8dd8db0163c4b', range: "100", Resolution: "Low_resolution" After: function ( ) {Var images = $ ("# instafeed"). ('A'); $ .each (images, function (index, image) {var delay = (index * 75) + 'ms'; $ (image). Css ('-bbkit-animation-delay', delay); $ (image). Css ('-socks-animation-delay', delay); $ (image) .css ('-ms-animation-delay', delay ); $ (Image) .css ('-o-animation-delay', delay); $ (image). Css ('animation-delay', delay); $ (Image) KaddClass ( 'animated Flipiaks');});} template:' & lt; a href = "{{link}}" target = "_ blank" & gt; & lt; img src = "{ {Image}} "/> gt; & lt; div class =" like "& gt; & gt; heart; {{likes}}   gt; '}) ;  

and I'll get an error with it

  no tag name is specified, use the 'tagname' option  

Any idea can update tag name value? Thanks for the help.

The root of this issue that you are running in the variable works in Javascript.

The strings are "passed by value", which in your case it means that the value of input text VLUE is copied to Instafeed.js When you make your example by doing new Instafeed ({..}), then .

It also means that when you value inputTextValue later, it will not update the Instafeed.js settings (because it copied when you install Instafeed.js).

In order to work around it, you would like to update the Instafeed.js settings directly by changing a property on your feed variable. Here is a slightly modified version of your original script:

  var num = 60; Var inputTextValue; Var feed = new Instafeed (get {: 'tagged', tagname 'placeholder', userId: 3,614,616, accessToken: '3614616.467ede5.abc0b5a861d34365a5c8dd8db0163c4b', range: "100", Resolution: "Low_resolution" After: function ( ) {Var images = $ ( "# instafeed"). ( 'A'); $ .each (images, function (index image) {var delay = (index * 75) + 'MS'; $ (image). Css ( '-vibikit-animation-delay, delay); $ (image). css (' - socks-animation-delay, delay); $ (image). css ( '- MS-animation-delay, delay ); $ (Image). CSS ('-o-animation-delay', delay); $ (image). CSS ('animation-delay', Ilnb); $ (image) KaddClass ( 'animated Flipiaks');});} template:' & lt; a href = "{{link}}" target = "_ blank" & gt; & lt; img Src = "{{image}}" /> 

In QTP, why are Browser, Page, Frame, and some function calls checkpointed when I have not included checkpoints for them? -


I have seen in the output output viewer that my browser, page and frame objects, as well as "passed" in some functions report Status, although I have not specified that they have checkpoints, after viewing in the Run Result Viewer User Guide, it has been said that "PASS" or "FAIL" will only be given to the checkpoint object, so I'm stymied. Why is this, and how can I stop them? After all, if I add my own checkpoint with these items, will it create a conflict?


web development server - PHP explode doesn't work -


I have a text file and I want each row to be an element of an array.

  $ file = file ("books.txt"); $ Partition = explosion ("\ n", $ file);  

Then if I try to print an element of the array:

  "$ split [0]" echo;  

I do not get any output.

Because file ("Books.txt") already new line As a result of the explosion gives an array, you echo "$ file [0]"; , no need for further exploding.


Appfuse Tutorial troubles - BeanCreationException -


After

I am working through Appfuse tutorial for version 3.5 (as before answering another question, Matt Rabble Advised).

I am on the move:

But when I create (mvn package) .. I get the following error:

Run gov.nysed .archives Nimbus.dao.PersonDaoTest Running gov.nysed.archives.Nimbus.webapp.controller.UpdatePasswordControllerTest

Warning [main] GenericApplicationContext.refresh (487) | Exceptions reference during initialization - cancel recent attempt org.springframework.beans.factory.BeanCreationException: Error creating bean wit h the name 'userManager': autowired failed dependency injection; Law could not autowire :: Nested exception org.springframework.beans.factory.BeanCreationException public void gov.nysed.archives.Nimbus.service.impl.UserManagerImpl.set MailMessage (org.springframework.mail.SimpleMailMessage); Nested exception is java.lang.NoClassDefFound error: [Lorg / Hibernate / Engine / Filter definition; ~ On org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues ​​(AutowiredAnnotationBeanPostProcessor.java:334) [Spring-beans -4.1.3. RELEASE.jar: 4.1.3.RELEASE] ...

Can I cause this problem by adding "person" section (unit and controller etc)? It passed the tests before adding this new institution ... Of course, yes ... but how?


php - Update email_address_id, bean_id ,bean_module - Sugarcrm REST API -


I am working on the Gradar Brake API to update a candidate email address. First of all I am updating the email_addresses table and then in the email_addr_bean_rel table

  • For each table update, I am creating session ID and passing through the API.

  • On running the API, this update does not contain values ​​in the Email_ addresses table, but on the email_addr_bean_rel table.

Do I need to establish a relationship ??

Please help me solve this problem ...

  // login ----------------- --- ------------------------- $ login_parameters = array ("user_auth" = & gt; array ("user_name" => $ Username, "password" = & gt; MD5 ($ password), "version" => 1 ")," application_name "= & gt;" restestest "," name_qua_list "=> array () ,); $ Login_result = Call ("Login", $ Login_Permatores, $ url); // mill session session $ session_id = $ login_result-> Id; $ Set_entry_parametersEADDR = array (// session ID "session" = & gt; $ session_id, // module name to get the record. "Module_name" = & gt; "email address", // record attribute "name_value_list" = & Gt; array ('name' = & gt; 'email_address', 'value' = & gt; $ _POST ['emailid']), array ('name' = & gt; 'email_address_caps', 'value' = & gt; Array ('name' = & gt; 'opt_out', 'strings', 'strings', 'strutupper' ($ _POST ['emailid']), array ('name' = & gt; 'invalid_email', 'value' => Value '= & gt;), array (' name '= & gt;' date_created ',' value '= & gt; date (' YMD HK: I: S ')), array (' name '= & gt; 'Date_modified', 'value' = & gt; date ('YMD HK: I: S')), array ('name' = & gt; 'deleted' '' Value '= & gt; 0),)); $ Set_entry_result Add Email Mail = Call ("set_entry", $ set_entry_parametersEADDR, $ url); Echo "& lt; east & gt;"; Print_r ($ set_entry_resultEmailsAdd); Echo "& lt; / pre & gt;"; // login --------------------------------------------- $ login_parameters = Array ("user_auth" = & gt; array ("user_name" = & gt; $ username, "password" => md5 ($ password), "version" => 1), " Application_name "=> RestTest", "name_value_list" = & gt; array (),); $ Login_result = call ("login", $ login_permatories, $ url); // mill session session $ session_id = $ login_result- & Name; $ Set_entry_parametersEmailAddressBean = array (// session ID "session" => Module_name "= & gt;" email address ", // record for receiving from record // record Attribute "name_value_list" = & gt; array ('name' = & gt; 'email_address_id', 'Value' = & gt; $ set_entry_result email mail add- & gt; id), array ('name' = & gt; 'bean_id', 'value' => $ set_entry_result- array ('name' = & gt; ('Name_ =' = ' = & Gt; 0), array ('name' = & gt; 'date_created', 'value' = & gt; Date ('YMD H: I: S')), array ('name' => date_modified ',' value '= & gt; date (' YMD HK: I: S ')), array (' name '= & Gt;' deleted ',' value '=> 1),),); $ Set_entry_resultEmailBean = Call ("set_entry", $ set_entry_parametersEmailAddressBean, $ url); Echo "& lt; east & gt;"; Print_r ($ set_entry_resultEmailBean); Echo "& lt; / pre & gt;";  

Hello You should be able to use session ID between call id.

Given_candidates to set up an email address for a custom module

Is the email field set correctly in the Gaura Candidates module?

You should not modify the email attachment table directly. Instead you should use the built-in email methods for Chinese.

For any module with an email relationship

You can set a primary email address by setting the field "email1" (or email 2 and so on But up to 5 I believe)

Although I'm not sure you can add stock email links to a custom module.


php - Comparing mysql password hashes using query row returning 0 (not working) -


I am creating a login system for my website using a MySQL database.

When the user registers, it saves the database using this password:

  $ password = hash ("sha512", "somesalt". $ Password. "Morseet" );  

Then when I login, I compare the password of the password in the database using the same hash function.

I use this to compare the database:

  $ query = mysql_query ("Select from user where password = '$ password' and email = ' $ Email '", $ connection); $ Rows = mysql_num_rows ($ query); If ($ rows == 1) {// do login stuff}  

but rows always return to 0. When I remove the hash function from both registers and logins, it logs properly, what is wrong?

In the case of someone's thinking, I am using my scheme as a side note, but the database version of my webhosting is out of date. They are using 5.2. I do believe.

I forgot to make sure that I checked to ensure that the database has been viewed in these photos (like images can not be embedded). P>

What is the length of your password field in the database << p />

Due to the reason I think the length of the hashead password is very long and when you save the database part or it is removed ...

Then when you compare, you get 0 row. .


How to add routesms bulksms API to a PHP website? -


I have an online form that fills users and registers I want them to receive an SMS alert Report that their registration was successful. I also have a way API.

When you write this link in the brush:

, your registration was successful

it

This is my code, the result is not in the received SMS message:

  Send SMS and send email here ('jit_user', 'nem-piro'); Defined ('jit_pwd', 'xxxxxx'); Defined ('enable_sms', 1); Defined ('credit_load', 5); Defined ('smssenderid', 'sampleID'); If (enabled_sms) {$ jit_user = jit_user; $ Jit_pwd = jit_pwd; $ Mobile = $ data- & gt; mobile; $ SmsBody = "Hello {$ surname} {$ alias name}, your registration was successful. Thanks!"; $ SmsSender = smssenderid; $ Link = "http://sms.brantilo.com:8080/bulksms/bulksms?username={$jit_user}&password={$jit_pwd}&type=0&dlr=1&destination=". Urlencode ($ mobile) "And source =". Urlencode ($ smsSender) "And message =". Urlencode ($ smsBody); $ Result = file_get_contents ($ link); } // Send SMS and email here $ session-> Data ['UTMEregnum'] = $ reg; $ Session- & gt; Data ['data'] = $ data; $ Session- & gt; Save (); $ Ref_from = "./utme-register-ok.php"; } And {$ ref_from = "./register.php?err=signup_no"; }  


node.js - Why can't I load js and css when using hexo publish blog -


I want to use hexo to make my blog public on gitub I can use my webpage Localhost: 4000 but later Jithub was deployed. I can only get words with pages but JS and CSS can not be loaded. There is an error message from the Chrome console


Failed to load the resource: The server responded with a status of 404 (not found)


Any content in it Not the CSS file, but I can find the contents in the repository files.

When I install Hexo I get a warning

  & gt; $ NPM installs hexo-g NPM variants optional Dpsy failed, continuous fsevents@0.3.5 | & Gt; Dtrace-provider@0.4.0 Install C: \ Users \ Rudy \ AppData \ Roaming \ npm \ node_modules \ h exo \ node_modules \ bunyan \ node_modules \ dtrace-provider & gt; Node script / install.js npm vern Alternative backup fail, constant fsevents@0.3.0  

I am not familiar with nodes, so I do not know that this place is something wrong. / P>

How can I fix this problem?

Maybe hexo2.8 to choose a good I had the same problem, That's why I changed the CSS style of topics. And then I came back to Hexo 2.8, the problem is missing.

npm install hexo@2.8 -g


php - Using DomPDF to create invoice PDF -


हमारे वेब सर्वर पर चालान के लिए एक उदाहरण लिंक:

  http: // billing / View / invoice? Id = 1  

यह ब्राउज़र में चालान दिखाता है।

इसे पीडीएफ के रूप में सहेजने के लिए मैंने कोशिश की:

 < कोड> & lt;? Php फ़ंक्शन file_get_contents_curl ($ url) {$ ch = curl_init (); Curl_setopt ($ ch, CURLOPT_AUTOREFERER, TRUE); Curl_setopt ($ CH, CURLOPT_HEADER, 0); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_FOLLOWLOCATION, TRUE); $ डेटा = कर्ल_एक्सएसी ($ ch); curl_close ($ ch); $ डेटा वापसी; } Need_once ("dompdf / dompdf_config.inc.php"); $ Dompdf = नया DOMPDF (); $ इनवॉइस = file_get_contents_curl ('दृश्य / इनवॉइस? आईडी = 1'); $ Dompdf- & gt; load_html ($ चालान); $ Dompdf- & gt; set_paper ( 'ए 4'); $ Dompdf- & gt; प्रस्तुत करना (); $ Dompdf- & gt; स्ट्रीम ("dompdf_out.pdf", एरे ("अनुलग्नक" = & gt; गलत)); बाहर निकलने के (0); ? & Gt;  

यह एक खाली पृष्ठ, कोई चालान या पीडीएफ नहीं दिखाता है।

अगर मैं बदल

  $ invoice = file_get_contents_curl ('दृश्य / इनवॉइस? आईडी = 1'); $ Dompdf- & gt; load_html ($ चालान);  

से

  $ इनवॉइस = "हैलो"; $ Dompdf- & gt; load_html ($ चालान);  

फिर यह "हैलो" युक्त एक पीडीए दिखाता है, इसलिए ऐसा लगता है कि गतिशील PHP चालान कैप्चर करने में कोई समस्या है।

त्रुटि रिपोर्टिंग शो:

  चेतावनी: file_get_contents (देखें / order.php? Id = 1432923): स्ट्रीम खोलने में विफल: पंक्ति 6 ​​पर सी: \ inetpub \ wwwroot \ billing \ test.php में कोई त्रुटि नहीं  

इसमें पूर्ण यूआरएल जोड़ने की कोशिश करें:

  $ invoice = file_get_contents_curl ('http: / /...view/invoice?id=1 ');  

javascript - Storing the returning value in the calling script -


Hey guys, I'm new to javascript and I'm playing to understand this language, I object-oriented Javacript I I am trying to prepare a small script, but I have no problem, what I have to share with me.

Actually I have this library which I am making, a little bit, I have the following function. (My Library is in Mapster.js):

  addMarker: function (opts) {var marker; Opts.position = {lat: opts.lat, lng: opts.lng} marker = this._createMarker (opts); If (opts.event) {this._on ({obj: marker, incident: opts.event.name, callback: opts.event.callback}); } Return marker; },  

So basically the marker returns to the above function

Now in my script.js, in which file I actually own my library of Mapster.js I have the following lines of code:

  Map. AddMarker ({lat: 15.498 9, lng: 73.8278, draggable: true, visible: true, // false is false and the marker event will disappear: {name: 'click', callback: function () {alert ('yups I am gautam ');}}}); Var infoWindow = New google.maps.InfoWindow ({Content: 'I'm on a map'}); InfoWindow.open (map.gMap, marker); // I get an error saying the reference error: the marker is not defined  

It is well enough, I asked one of my greatest vantage and he said the following:

As the message says, you have not defined the marker In AddMarker you create it and return it, but you are not specifying the returned value in the calling script.

I think he had given it to Enver, but I am still struggling with, "How can I store the return value in the calling script, IE script. ".

I would really be great if someone can answer this question for me

thanks

Alexander

< P>

You only need to specify the result of addMarker in a variable:

 < Code> var marker = map.addMarker ({lat: 15.498 9, lng: 73.8278, dragable: true, visible: true, // it is wrong and the marker will disappear from the event: {name: click}, callback: Function () {Alert ('UPS I Gotam');}}}); InfoWindow.open (map.gMap, marker);  

go - godoc no match found error -


I am new to Goolge and just write a few test applications and document them all on my GOHOME \ src \ myapp app .

I can use the following command to start a server and use the browser to view the browser. It works:

Devok -http = ": 5050"

However I created files in HTML files I will copy it so that other people can read the document. I tried:

godoc myapp -zip = "1.zip" or godoc myapp -zip = "1. Zip "-index = true

I always get an error:

No matches found.

How should I do so that I can generate all the document files?

Thank you!


xaml - Designing image gallery in xamarin.forms -


I have a JSON that has image thumbnail URLs and some text to present as an image gallery such as a phone gallery . I did a lot of research about the grid layout but there was no way to speed up the number of grid widths fixed width and height to display the images. Can anyone tell me what would be the best component to create a gallery type page with a number of images?

There is a gallery control in Xamarin. Doodle Please see sample -

If it is not what you are looking for then you can use your own with pictures. And vacancies You can show the full image See sample list view with images in Xamarin.form examples.

If you need multiple stack layouts in horizontal rendering, and in the sequences of that list, maybe 3.

that you have 3 columns and unlimited scrolling rows.

Edit: You must create a view modal in which there will be a class with the public property that you want to bind. Avatar your JSON in an IEnumerable of this ViewModel class and tie it in your list view. In it, you have to use

to create an image because you have written it from the URL, the following syntax will help you:

  webImage.Source = new UriImageSource { Uri = new Uri ("http://xamarin.com/content/images/pages/forms/example-app.png"), caching enabled = true, CacheValidity = new timespan (5,0,0,0,0,0) };  

Binds a ListView with an image and 2 label .

Class Employee Employee: ViewSell {Public Employee Cell () {var image = new image {horizontal option = layout options. Start}; Image.SetBinding (Image.SourceProperty, New Compulsive ("ImageUri")); Image.WidthRequest = image.HeightRequest = 40; Var nameLayout = CreateNameLayout (); Var viewLayout = New StackLayout () {Orientation = Stack Orientation. Horizontal, child = {image, name layout}}; View = View Layout; }}

Edit 2: If you have variable URLs in the Create URL, then you will go ahead for one. The tableview is not bound to the data source and you can parse the JSON object and create individual cells according to your requirement. That is: Each JSON object will be a TableSection and each image will be a ImageCell


android - VAST tag URL for admob video ad -


Can someone please guide VAST tag url for an adobe ad that I use in DFP to show video Can I Ads In My Android Apps?

I have implemented the IMA SDK and a media player that should play video ads before playing my video, but I do not know how to create a creative in DFP which is used by Ad Edob and its service . In the 'Add New Creativity', I am selecting the third type, 'redirection' and I do not know what I should enter in the VAST tag URL field. I created an ad, but I can not find it my original tag URL anywhere.

I am very new to this, so please guide me if I am doing something wrong.

Well, found out that AdMob does not support VAST tags for its video ads (anyway? ). If you need a lot of tags, you should get another ad provider that provides a VAST tag URL for video ads.


unit testing - iOS: how to run XCTest on device? -


I am currently learning XCTest for the purpose of testing the unit. I was able to run the default template XCtest on the simulator without any problem I could do all the green tickcos in the test navigation scene. However, when I ran them as a hosted application on my device with the app, nothing happened. My app was launched on the device and did not seem to run Xtestes. I even put a break point in the test and it did not break. In the simulator, the app automatically closes when the test ends, however, while running on the device, my app was just running and never was placed on the stop, am I doing something wrong?

This message should be displayed by xCode while running XCest on physical device.

Logic test is not supported on iOS devices. You can run a logic test on the simulator.


ruby - Gem install error due to invalid ssl using rbenv -



ruby - Gem install error due to invalid ssl using rbenv -

i'm trying install new gem (gem install lunchy), getting next error due ssl certificate:

error: loading command: install (loaderror) dlopen(/usr/local/cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle, 9): symbol not found: _sslv2_client_method referenced from: /usr/local/cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib in /usr/local/cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle - /usr/local/cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle error: while executing gem ... (nomethoderror) undefined method 'invoke_with_build_args' nil:nilclass

i've tried number of fixes:

tried gem update --system per reply bundle install fails ssl certificate verification error same error on command.

tried brew install openssl followed brew link openssl --force per question no avail: openssl error installing ruby 2.0.0-p195 on mac rbenv

even tried reinstalling rbenv , ruby didn't work either, still same error.

the ruby beingness executed in error not 1 installed rbenv, homebrew.

if you're trying utilize rbenv, maybe run brew uninstall ruby and/or check output of echo $path create sure ~/.rbenv/shims @ start.

ruby ssl gem rubygems homebrew

css - my responsive design doesn't work on safari/ iPhone 5s -



css - my responsive design doesn't work on safari/ iPhone 5s -

i working on responsive design , started using firefox responsive design view media queries, work on it..but when start using safari on iphone5s doesn't work. have

<meta name="viewport" content="width=device-width, initial-scale=1.0" /> in head tag...am missing needs there safari/iphone 5s ? in advance!

i've tried these

/* iphone 5 retina regardless of ios version */ @media (device-height : 568px) , (device-width : 320px) , (-webkit-min-device-pixel-ratio: 2) /* , (orientation : todo: can add together orientation or delete comment)*/ { /*iphone 5 css here*/ }

or seek @media screen:

@media screen , (device-aspect-ratio: 40/71) { }

it might improve not focus on designing iphone 5, given iphone 6 , 6+ have entered fray (and users still using 4s devices well).

it improve think device-agnostically , design viewport width. @yoshi has said, specifying viewport ensure devices show site @ intended pixel width.

although guard against disabling zoom (by specifying maximum-scale). breaks affordance , makes hard users interact site may expect able to.

<meta name="viewport" content="width=device-width, initial-scale=1">

from there can specify pixel based media queries:

.item { width:25%; } @media screen , (max-width:750px) { .item { width:33%; } } @media screen , (max-width:450px) { .item { width:50%; } } @media screen , (max-width:250px) { .item { width:100%; } }

this simple illustration of how item adapt across different browser widths.

this approach far more future-friendly well, knows how big or little devices come out. luck! =)

css css3 responsive-design

My program isnt correctly comparing values in python -



My program isnt correctly comparing values in python -

i wrote code , it's supposed compare set of line values nominal value. user supposed input percentage value compare linevalue nominal value. if linevalue within percentage given nominal value pass true.

my programme homecoming true if linevalue number nominal value. other values failures if within percentage user inputs. see error in code prevent numbers beingness registered true?

nominalvalue=470 print "nominal resistor value: " , nominalvalue linevalue = [470, 358, 324, 234, 687,460] user_input=raw_input("please come in tolerance %: ") if user_input.isdigit(): tolerance = int(user_input) if tolerance <=20 , tolerance >=1: print "tolerance level:", user_input percentagehigh = (tolerance/100.0 + 1.00) percentagelow = (1.00 - tolerance/100.0) print percentagehigh print percentagelow highnominal = nominalvalue*percentagehigh lownominal = nominalvalue*percentagelow print highnominal print lownominal seriesinput in linevalue: if (percentagehigh*seriesinput) <= highnominal , (percentagelow*seriesinput) >= lownominal: print seriesinput,"pass" print percentagehigh*seriesinput else: print seriesinput,"fail" print percentagelow*seriesinput else: print "please come in value between 1-20" else: print "please come in number percent value"

you've computed highnominal , lownominal, want line:

if seriesinput <= highnominal , seriesinput >= lownominal:

or @greghewgill pointed out:

if lownominal <= seriesinput <= highnominal:

python

kivy - Python for Android: No project.properties file -



kivy - Python for Android: No project.properties file -

while in python-for-android/dist/default, calling

./build.py --dir ../../../kivy/ --package org.example.myapp --name 'myapp' --version 0.1 debug

has provoked:

build failed ../python-for-android/dist/default/build.xml:6: source resource not exist: ../python-for-android/dist/default/project.properties

any idea?

kivy

vim - What does this symbol mean (similiar to ^@) in the context of text editing? -



vim - What does this symbol mean (similiar to ^@) in the context of text editing? -

unfortunately, can't post pictures due lack of reputation looks "^@".

for context, have script goes through list of names generate configuration file. run executable configuration , if doesn't run, script proceed next name , erase content of previous configuration. however, if executable run, script move on next name , append onto exist configuration. problem when first iteration erased, leaves behind symbol conflict subsequent iterations. thought symbol mean? much appreciated.

it doesn't "^@", is "^@". ^ denotes command character; illustration ^x control-x. null character can entered on keyboards typing control-@.

look @ table of ascii codes. control key, in many cases, modifies character subtracting 64 ascii value; control-g character (71 - 64) or 7, ascii bel character.

as special cases, ascii del character, 127, represented "^?", , nul character can entered (on keyboards) typing control-space. (vim doesn't utilize "^ " represent nul character because hard read.)

vim text text-editor

apache spark - how to convert LibSVM file with multi classes into an RDD[labelPoint] -



apache spark - how to convert LibSVM file with multi classes into an RDD[labelPoint] -

using next method org.apache.spark.mllib.util.mlutils bundle ,loads binary labeled info in libsvm format rdd[labeledpoint], number of features determined automatically , default number of partitions.

def loadlibsvmfile(sc: sparkcontext, path: string): rdd[labeledpoint]

my problem loading info multi class labels? when using method on multiclass labeled data...it getting converted binary labeled data.. there way load multiclass info in libsvm format rdd[labeledpoint]...??

there 1 more method in same bundle next description

loads labeled info in libsvm format rdd[labeledpoint], default number of partitions.

def loadlibsvmfile(sc: sparkcontext, path: string, numfeatures: int): rdd[labeledpoint]

but when i'm trying utilize ,,there error showing "found int ,requires boolean"

what version of spark using? used file http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/glass.scale

spark 1.1 , next code:

val lbldrdd = mlutils.loadlibsvmfile(sc,svmfile) lbldrdd.map(_.label).collect().toset.map(println)

i see output:

5.0 1.0 6.0 2.0 7.0 3.0

which seems right me

apache-spark libsvm mllib

java - Connection problems with the socket.io-client to socket.io server 0.9.6 -



java - Connection problems with the socket.io-client to socket.io server 0.9.6 -

i have problem socket.io code android.

the server uses socket.io 0.9.6 on android i'm using socket-io-client-0.1.3.jar , engine-io-client.0.2.3.jar nkzawa

after connection mychannel myconnect emitted. afterwards "something_changed" message if changes new values. version in js works fine, on android get:

event_connect_error: com.github.nkzawa.engineio.client.engineioexception: xhr poll error

any ideas how prepare it?

socket = io.socket(websocket + "mychannel"); socket.on(socket.event_connect, new emitter.listener() { @override public void call(object... args) { socket.emit("myconnect", userinfo); } }).on(socket.event_connect_error, new emitter.listener() { @override public void call(object... arg0) { log.e("event_connect_error", arg0[0].tostring()); } }).on("something_changed", new emitter.listener() { @override public void call(object... args) { jsonobject obj = (jsonobject) args[0]; log.i("something_changed", obj.tostring()); } }); socket.connect();

i faced same issue. causing because of net access permission.

add net permission in manifest.

<uses-permission android:name="android.permission.internet" ></uses-permission>

it should work.

java android websocket socket.io

angularjs - How to pass special characters in a function -



angularjs - How to pass special characters in a function -

i new angular, working on poc of how utilize modal in application. here doing:

i have controller declares function called open in scope. function open takes url input. now, url need pass in dynamically created:

<a ng-click="open(/test/obj['test-attr']/update/)" href="/test/{{ obj['test-attr'] }}/update/">{{ obj['test-attr'] }}</a>

but gives me parse error. not sure how pass info controller.

update:

the error not because of quotations because of /. there angular way pass in special character function.

this error get:

error: [$parse:lexerr] http://errors.angularjs.org/1.2.22/$parse/lexerr?p0=unexpected%20nextharacter%20&p1=s%205-5%20%5b%5c%5d&p2=open(%5c

your problem not going solved passing special characters. misguided.

the look in ng-click has syntax errors. remember "javascript code" (or "javascript expression" more precise). mean, type next in javascript?

open(/test/obj['test-attr']/update/)

...this won't fly in javascript. /test/ , /update/ string literals , should quoted. , concatenate strings, utilize old + (plus) sign. sum up, should like:

open('/test/' + obj['test-attr'] + '/update/')

here's syntax (and working plunker):

<a ng-click="open('/test/' + obj['test-attr'] + '/update/')" href="/test/{{ obj['test-attr'] }}/update/">{{ obj['test-attr'] }} </a>

http://plnkr.co/edit/uctqc5byrr0wmvyui5nx

potential second issue: next off-topic related code in plunker. not reply original question, issue ran while testing plunker example.

window.open() in angular expressions not straight available.

these expressions not "javascript", rather "angularjs expressions".

it appears code attempting phone call "open()" (a global javascript object - not accessible in "angularjs expressions"). angular keeps tight command on what's accessible globally.

i mean, can access stuff in $scope within these expressions. created "open" method in $scope calls $window.open(). ($window angularjs wrapper "window" unit testing/mock, angular way of calling global javascript functions).

var app = angular.module('plunker', []); app.controller('mainctrl', function($scope, $window) { $scope.obj = { "test-attr": "testattrdata" }; $scope.open = function() { $window.open.apply(null, arguments); } });

i suspect might have third issue: open() called not prevent href action take normal effect of reloading page. if that's case add together $event.preventdefault(); in ng-click expression:

ng-click="open('/test/' + obj['test-attr'] + '/update/'); $event.preventdefault();"

angularjs escaping angularjs-controller

sql - MySQL JOIN "WHEN"- is such a thing possible? -



sql - MySQL JOIN "WHEN"- is such a thing possible? -

background:

i'm running query gets total widgets, sprockets, , gizmos ordered client during lastly month i have total orders column runs subquery counting every order in month the reason total orders in subquery, instead of adding 3 columns, because have farther 2 total orders columns 2 previous months i have orders table stores financial records, , separate tables actual product details widgets, sprockets, , gizmos

the problem:

occasionally, widget might 'half-deleted' (don't ask!) - has orders record, not corresponding widgets record i not want count in total widgets column - easy enough, join however, not want count in total orders column...

my current query looks total widgets:

select count(orders.id) orders bring together widgets on widgets.id = orders.item_id orders.product_id = 1 -- product id 1 widget , orders.date between "2014-09-01 00:00:00" , "2014-09-30 23:59:59"

so 'accurate' widgets, intact widget table record.

here current query total orders:

select count(orders.id) count orders bring together widgets on widgets.id = orders.item_id , orders.product_id = 1 orders.date between "2014-09-01 00:00:00" , "2014-09-30 23:59:59"

so thinking above query should join when order has product_id of 1. however, joins in every case. means if we've ordered 10 widgets (2 of have been half-deleted), 5 sprockets, , 5 gizmos, rather showing 18 orders, shows 8. changing left join shows 20, still wrong, should 18.

hopefully above makes sense - in advance.

okay so... straight bring together doesn't work because filter orders.product_id = 1 , won't count sprockets or gizmos. widgets. , if have 2 half deleted, 10 on record... 8 right answer. left outer join lets bring together on rows product_id <> 1, too, rows orders (which contains order records on widgets, sprockets, gizmos - half deleted or not). allows 2 half deleted rows.

why don't straight join? if want reply 18, bring together orders , products , count it. not filter widgets only. not left outer if don't want half deleted.

create table product ( product_id int, product_name varchar(20) ); insert product values (1,'widget'); insert product values (2,'sprocket'); insert product values (3,'gizmo'); create table `order` ( order_id int, widget_id int ); insert `order` values (1,1); insert `order` values (1,2); insert `order` values (1,3); insert `order` values (1,4); -- half deleted insert `order` values (2,1); insert `order` values (2,2); insert `order` values (3,3); insert `order` values (3,4); -- half deleted insert `order` values (4,4); -- half deleted select o.order_id, count(*) `order` o bring together product p on o.widget_id=p.product_id grouping o.order_id +----------+----------+ | order_id | count(*) | +----------+----------+ | 1 | 3 | | 2 | 2 | | 3 | 1 | +----------+----------+ 3 rows in set (0.00 sec) mysql> select o.order_id, -> p.product_name, -> (case when p.product_id null -> 'half_deleted' else '' end) half_deleted -> `order` o -> left outer bring together product p -> on o.widget_id=p.product_id -> order order_id ; +----------+--------------+--------------+ | order_id | product_name | half_deleted | +----------+--------------+--------------+ | 1 | gizmo | | | 1 | null | half_deleted | | 1 | widget | | | 1 | sprocket | | | 2 | widget | | | 2 | sprocket | | | 3 | gizmo | | | 3 | null | half_deleted | | 4 | null | half_deleted | +----------+--------------+--------------+

mysql sql join

apigee - How to force a Response in the Request flow skipping the Target Endpoint -



apigee - How to force a Response in the Request flow skipping the Target Endpoint -

in apigee border api proxy, while processing policies in api proxy request flow, how 1 can forcefulness flow go response flow , skip sending request target service, without using raise fault policy or responsecache policy??

you can utilize routerule no targetendpoint value. take status matches when want bypass target service. routerules evaluated in order top bottom, first status match beingness chosen.

<routerule name="notarget"> <condition>skiptarget = true</condition> <!-- no target endpoint --> </routerule> <routerule name="default"> <!-- no condition, 1 matches --> <targetendpoint>default</targetendpoint> </routerule>

see this link more info.

apigee

mysql - select into outfile permission denied on windows -



mysql - select into outfile permission denied on windows -

i trying run select outfile command mysql 5.6 command line (mysql user : root) on windows 8 , permission denied error.

the next error: error 1 (hy000): can't create/write file 'c:\\users\\xxxx\\desktop\\project\\output.txt' (errcode: 13 - permission denied)

the next command trying execute through mysql command line: mysql>select * contractor_info outfile "c:\\users\\xxxx\\desktop\\project\\output.txt";

i want save re-create of table in project folder.

mysql into-outfile

javascript - How to access div attributes (on click event) which is inside the iframe? -



javascript - How to access div attributes (on click event) which is inside the iframe? -

below code.

here whenever click on song1 need respective id , attributes.

<div> <iframe id="songs" src="song.html"> <div id="song1" class="sngs" name="song123">song1</div> <div id="song2" class="sngs" name="song122">song2</div> <div id="song3" class="sngs" name="song121">song3</div> </iframe> </div>

and doing here:

$(document).ready(function(){ $("iframe").click(function(){ var currentsongname=$("iframe").contents().find("#"+this.id).getattribute("name"); console.log(currentsongname); playsong(currentsongname); }); });

but here this.id coming else. how can id , attribute of div clicked on?

retrieve native element using index

var currentsongname=$("iframe").contents().find("#"+this.id)[0].getattribute("name");

or utilize jquery equivalent of attr()

var currentsongname=$("iframe").contents().find("#"+this.id).attr("name");

javascript jquery iframe

How to enable google maps android api for smooth two finger zoom? -



How to enable google maps android api for smooth two finger zoom? -

on original google maps if utilize 2 fingers zoom in or out zoom animation not stop after releasing screen. continues zoom in or out respectively little more. nice, on google maps api when zoom in or out 2 fingers zoom animation stops release fingers screen. there way enable feature? there is.. don't know name of effect... maybe zoom echo? :)

try this:

uisettings uisettings = mmap.getuisettings(); uisettings.setzoomgesturesenabled(true); uisettings.setzoomcontrolsenabled(true);

more here: http://developer.android.com/reference/com/google/android/gms/maps/uisettings.html

android google-maps

mysql python - Pycharm MySQLdb 'module' object has no attribute 'Number' -



mysql python - Pycharm MySQLdb 'module' object has no attribute 'Number' -

the next programme executes using python script , gives me expected output :

database version : 5.6.19-0ubuntu0.14.04.1

however, exact same programme doesn't seem work on pycharm.

it outputs:

/usr/bin/python2.7 /home/shog/pycharmprojects/pythonadvancedtutorial/databases.py traceback (most recent phone call last): file "/home/shog/pycharmprojects/pythonadvancedtutorial/databases.py", line 12, in <module> db = mysqldb.connect('localhost', 'root', '*****', 'testdb') file "/usr/local/lib/python2.7/dist-packages/mysql_python-1.2.4b4-py2.7-linux-x86_64.egg/mysqldb/__init__.py", line 81, in connect homecoming connection(*args, **kwargs) file "/usr/local/lib/python2.7/dist-packages/mysql_python-1.2.4b4-py2.7-linux-x86_64.egg/mysqldb/connections.py", line 147, in __init__ mysqldb.converters import conversions file "/usr/local/lib/python2.7/dist-packages/mysql_python-1.2.4b4-py2.7-linux-x86_64.egg/mysqldb/converters.py", line 174, in <module> decimal import decimal file "/usr/lib/python2.7/decimal.py", line 3743, in <module> _numbers.number.register(decimal) attributeerror: 'module' object has no attribute 'number'

here program:

#!/usr/bin/python import mysqldb db = mysqldb.connect('localhost', 'root', '2soid', 'testdb') cursor = db.cursor() cursor.execute("select version()") info = cursor.fetchone() print "database version : %s " % info db.close()

remove #!/usr/bin/python or alter #!/usr/bin/env python, you're calling wrong python library

pycharm mysql-python

sql - filter data with entity framework -



sql - filter data with entity framework -

i'm trying right data

rooms table

id | name 1 room1 2 room2

resources table

id | name 1 resource1 2 resource2 3 resource3

roomresources table

id | roomid | resourceid 1 1 1 2 1 2 3 1 3 4 2 2 5 2 3

i want select room resource1 , resource2 i'm using code

int[] ids = sresources.split(',').select(s => int.parse(s)).toarray(); rooms = r in context.rooms r.area.office.id == officeid && r.maximumpeople >= numberofpeople && r.roomresources.any(s => ids.contains(s.resourceid)) select r;

but homecoming room1 , room2 , result should room1

i appreciate help, thanks

maybe this?

int[] ids = sresources.split(',').select(s => int.parse(s)).toarray(); rooms = r in context.rooms r.area.office.id == officeid && r.maximumpeople >= numberofpeople && ids.all(i => r.roomresources.any(s => s.resourceid == i)) // seek here select r;

sql linq entity-framework model-view-controller entity-framework-6

asp.net - Merging gridview cells with templatefields -



asp.net - Merging gridview cells with templatefields -

i'm trying format gridview during onrowdatabound event need merge column cells values. works find except 1 of columns templatefield linkbutton inside. code reads blanks when iterates through templatefield column , merges entire column single cell.

markup:

<asp:gridview id="grdsummary" runat="server" onrowdatabound="grdsummary_rowdatabound" > <columns> <asp:templatefield headertext="period" > <itemtemplate> <asp:linkbutton id="lnkperiod" runat="server" cssclass="linkbuttoncellstyle" text='<%# eval("period") %>' onclick="lnkquartersummary_click" commandargument='<%# bind("period") %>' /> </itemtemplate> </asp:templatefield> <asp:boundfield headertext="timeline" datafield="timeline" /> <asp:boundfield headertext="americas" datafield="americas" dataformatstring="{0:#,0}" itemstyle-cssclass="summarygridcellstyle" /> </columns> </asp:gridview>

codebehind:

protected sub grdsummary_rowdatabound(byval sender object, byval e gridviewroweventargs) rowindex integer = grdsummary.rows.count - 2 0 step -1 dim grdrow gridviewrow = grdsummary.rows(rowindex) dim grdpreviousrow gridviewrow = grdsummary.rows(rowindex + 1) cellcount integer = 0 0 if grdrow.cells(cellcount).text = grdpreviousrow.cells(cellcount).text if grdpreviousrow.cells(cellcount).rowspan < 2 grdrow.cells(cellcount).rowspan = 2 else grdrow.cells(cellcount).rowspan = grdpreviousrow.cells(cellcount).rowspan + 1 end if grdpreviousrow.cells(cellcount).visible = false end if next cellcount next rowindex end sub

i'm able read templatefield value using this:

dim test string = databinder.eval(e.row.dataitem, "period")

but can read current row, not previous 1 well. ideas?

asp.net vb.net gridview

sql - Create view with Union give error in IBM i -



sql - Create view with Union give error in IBM i -

hi trying add together 1 table info create needed info set. doing union via greenish screen strsql. gives error message: column list required' in cpyf add, don't have anything, whne legnths , attibutes of each fields same. here not sure do.

create view astccdta.eoddetails select lintot, odord#, odseq#, odlstc, odordd, odordt, odprlc, odprt#, odshp#, odntu$, odrqsd astccdta.eoddetaila union select lintot, ouord#, ouseq#, oulstc, ouordd, ouordt, ouprlc, ouprt#, oushp#, ountu$, ourqsd astccdta.eoddetailh

the first thing seek add together column lists:

create view astccdta.eoddetails(lintot, odord#, odseq#, odlstc, odordd, odordt, odprlc, odprt#, odshp#, odntu$, odrqsd) select lintot, odord#, odseq#, odlstc, odordd, odordt, odprlc, odprt#, odshp#, odntu$, odrqsd astccdta.eoddetaila union select lintot, ouord#, ouseq#, oulstc, ouordd, ouordt, ouprlc, ouprt#, oushp#, ountu$, ourqsd astccdta.eoddetailh ;

perhaps required strsql.

db2 accepts views without explicit column names.

edit:

you may able this:

create view astccdta.eoddetails select lintot, odord#, odseq#, odlstc, odordd, odordt, odprlc, odprt#, odshp#, odntu$, odrqsd astccdta.eoddetaila union select lintot, ouord# odord#, ouseq# odseq#, oulstc odlstc, ouordd odordd, ouordt odordt, ouprlc odprlc, ouprt# odprt#, oushp# odshp#, ountu$ odntu$, ourqsd odrqsd astccdta.eoddetailh ;

sql ibm-midrange db2400

ios - Associate Facebook Account With Multiple Users in Parse -



ios - Associate Facebook Account With Multiple Users in Parse -

in application utilize parse's services connect users facebook. when user tries connect facebook business relationship linked user in app, error given , user not allowed connect. since using anonymous users in app, particular problem if user deletes app , reinstalls, old business relationship still exists in database connected facebook account, have new anonymous user account, , cannot link new business relationship facebook.

what best way me prepare problem? if i'm not mistaken, there no way tell when user deletes application, can't delete old user database when app deleted. need way either log out old user , log in new user when new user tries connect facebook or allow multiple users linked same facebook account. or suppose merge new anonymous user business relationship old 1 linked facebook.

anyways, has had issue , found solution?

ios objective-c parse.com

user permissions - VMWare vCenter v5.5 Deleted Administrator Group -



user permissions - VMWare vCenter v5.5 Deleted Administrator Group -

while setting single sign-on our windows active directory (ad) server , cluster permissions, accidentally assigned administrators grouping "no access" on 1 of clusters. tried browse cluster alter permissions, not see anymore, under of accounts in administrators group. groups structured such "vsphere administrators" advertisement grouping added "administrators" vsphere.local group, advertisement business relationship assigned "vsphere administrators" advertisement grouping automatically members of "administrators" vsphere group.

my next step add together administrators total permissions vcenter server, , have propagate else. cluster still not visible.

since signed administrator account, , administrator explicitly assigned administrator role vcenter server, figured fastest way remove permissions assignment administrators grouping delete it. after deleting administrators group, still not see cluster.

i removed myself "vsphere administrators" advertisement group, signed in using advertisement account, added advertisement business relationship adminstrator role on vcenter server, , able see cluster again. adminstrators vsphere grouping still entered, removed it, , of accounts can see cluster again.

now real problem starts: when went administration -> single sign-on -> users , groups, administrator business relationship can not create/edit users or groups. other accounts adminstrator role in vcenter can not see single sign-on menu.

i tried using vmware cli, specifically

vicfg-user.pl --server <server-ip> -e grouping -o add together -d administrators

but response

host business relationship manager not found.

i ssh'd vcenter, , can't find of command line tools installed on esx hosts.

i hope can give me suggestion on making administrator user able edit users , groups, or how manually create grouping in vcenter.

thanks

you should able login administrator@vsphere.local business relationship , create changes require.

if not work need reinstall sso component, resolve issue.

steve

vmware user-permissions vsphere vcenter

javascript - making iris's color selector dissappear when it's not in focus -



javascript - making iris's color selector dissappear when it's not in focus -

my html:

<input type="text" id='color-picker' value="#bada55" /><br />

my javascript:

jquery(document).ready(function($){ $('#color-picker').iris(); $('#color-picker').blur(function() { $('#color-picker').iris('hide'); }); $('#color-picker').focus(function() { $('#color-picker').iris('show'); }); });

my jsfiddle: http://jsfiddle.net/vdmw1knl/3/

without blur / focus stuff if click on text input color picker appear , never go away. blur / focus stuff if click on color picker it'll appear it'll go away if select color.

i want color picker go away if either text input it's attached or html composing go out of focus. clicking on color within color picker ought not create go away. unfortunately, don't know how create this. ideas?

you can checking whether clicked within or outside color picker this:

class="snippet-code-js lang-js prettyprint-override">jquery(document).ready(function($) { $('#color-picker').iris(); $('#color-picker').blur(function() { settimeout(function() { if (!$(document.activeelement).closest(".iris-picker").length) $('#color-picker').iris('hide'); else $('#color-picker').focus(); }, 0); }); $('#color-picker').focus(function() { $('#color-picker').iris('show'); }); }); class="snippet-code-html lang-html prettyprint-override"><link href="https://raw.githubusercontent.com/automattic/iris/master/src/iris.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> <script src="http://automattic.github.io/iris/javascripts/iris.min.js"></script> <input type="text" id='color-picker' value="#bada55" /> <br /> <div style="position: relative" id="#test">zzz</div>

javascript jquery html css

javascript - How can I pass a variable from iframe to a parent window? -



javascript - How can I pass a variable from iframe to a parent window? -

i have colorbox parent page contains tabcontainer different iframes on case sec tab in alter made database , need update textbox of parent window.

unfortunately can't straight interact across boundaries of iframe nowadays security risk.

one workaround can alter url within iframe include #anchor value or ?querystring , read iframe's url parent.

javascript c# asp.net iframe colorbox

php - Regex to extract file extension from URL -



php - Regex to extract file extension from URL -

i looking regex match .js in next uri:

/foo/bar/file.js?cache_key=123

i'm writing function tries identify kind of file beingness passed in parameter. in case, file ends extension .js , javascript file. i'm working php , preg_match i'm assuming pcre compatible regular expression. i'll build on look , able check multiple file types beingness passed in uri isn't limited js, perhaps css, images, etc.

you can utilize combination of pathinfo , regular expression. pathinfo give extension plus ?cache_key=123, , can remove ?cache_key=123 regex matches ? , after it:

$url = '/foo/bar/file.js?cache_key=123'; echo preg_replace("#\?.*#", "", pathinfo($url, pathinfo_extension)) . "\n";

output:

js

input:

$url = 'my_style.css?cache_key=123';

output:

css

obviously, if need ., it's trivial add together file extension string.

eta: if want regex solution, trick:

function parseurl($url) { # takes lastly dot can find , grabs text after echo preg_replace("#(.+)?\.(\w+)(\?.+)?#", "$2", $url) . "\n"; } parseurl('my_style.css'); parseurl('my_style.css?cache=123'); parseurl('/foo/bar/file.js?cache_key=123'); parseurl('/my.dir.name/has/dots/boo.html?cache=123');

output:

css css js html

php regex

How to remove option element in JQuery mobile? -



How to remove option element in JQuery mobile? -

this question has reply here:

html 1st alternative in select not render selected item on page jquery mobile? 1 reply

i have

<select id="zone" name="zone"> <option value="10">australia/sydney</option> <option value="11">australia/melbourne<option> <option value="12">australia/brisbane<option> </select>

i want remove options element can start repopulating options different option.

how do that? looking @ jquery mobile, didn't see selectmenu methods can utilise.

thanks

for removing options can use:

$('#zone').find('option').remove();

you need refresh selectmenu see modified select:

$('#zone').selectmenu('refresh', true);

and appending new values:

$('#zone').append("<option value='13'>australia/perth</option");

jquery jquery-mobile

javascript - Filtering ngOptions by properties of an attribute -



javascript - Filtering ngOptions by properties of an attribute -

i have code:

//sample of data. var combobox = new[] { new { key = 1, value = "a[del]", isdelegate = true }, new { key = 2, value = "b[del]", isdelegate = true }, new { key = 3, value = "c", isdelegate = false }, new { key = 4, value = "d", isdelegate = false }, new { key = 5, value = "e[del]", isdelegate = true } }; <select ng-model="selectedfilter" id="selectedfilter" ng-options="item.key item.value item in combobox track item.key" ng-change="loaddata()"> <option>--</option> </select>

i'm trying add together ng-if options result this:

<select ng-model="selectedfilter" id="selectedfilter" ng-options="item.key item.value item in combobox track item.key" ng-change="loaddata()"> <option value="item.key" ng-if="item.isdelegate">{{item.value}}</option> </select>

you can utilize filter

class="snippet-code-js lang-js prettyprint-override">var app = angular.module('my-app', [], function() { }) app.controller('appcontroller', function($scope) { $scope.condition = { isdelegate: true } $scope.combobox = [{ key: 1, value: "a[del]", isdelegate: true }, { key: 2, value: "b[del]", isdelegate: true }, { key: 3, value: "c", isdelegate: false }, { key: 4, value: "d", isdelegate: false }, { key: 5, value: "e[del]", isdelegate: true }]; }) class="snippet-code-html lang-html prettyprint-override"><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="my-app" ng-controller="appcontroller"> <select ng-model="selectedfilter" id="selectedfilter" ng-options="item.key item.value item in combobox | filter:condition track item.key" ng-change="loaddata()"> <option value="item.key" ng-if="item.isdelegate">{{item.value}}</option> </select> </div>

javascript angularjs

Problems with node names in Igraph with R -



Problems with node names in Igraph with R -

i have list of data.frames (dflist) i'd generate directed weighted networks in igraph in r. edge-weight variable "valueusd", while vertices identified numbers columns "reporter" , "partner". here follows function prepared called "write.graphs" used lapply on "dflist".

write.graphs<-function(filename){ d<-graph.data.frame(filename[c("reporter", "partner")], directed=true) d <- set.edge.attribute(d, "weight", value=filename$valueusd) } graphs<-lapply(dflist, write.graphs)

every thing work perfectly. if check vertex names get:

graphs[1]$names null

but troubles emerge when want utilize names in place of numbers identify vertices, using corresponding columns "reportern" , "partnern" in each of data.frames in dflist. here can see how data.frames like:

dflist[1] $`aug 2014` reporter yearperiod year period commodity partner netweightkg valueusd cost partnern reportern 1 76 201408 2014 8 150910 0 4472917 22028271 4.924811 world brazil 2 76 201408 2014 8 150910 32 380891 1533948 4.027262 argentine republic brazil 3 76 201408 2014 8 150910 152 239776 1336057 5.572105 republic of chile brazil 4 76 201408 2014 8 150910 251 289 2164 7.487889 french republic brazil 5 76 201408 2014 8 150910 300 27592 170658 6.185054 hellenic republic brazil 6

this message get:

> grafi<-lapply(dflist, scrivi.grafi) there 50 or more warnings (use warnings() see first 50) > warnings() warning messages: 1: in graph.data.frame(filename[c("reportern", "partnern")], ... : in `d' `na' elements replaced string "na" 2: in graph.data.frame(filename[c("reportern", "partnern")], ... : in `d' `na' elements replaced string "na" 3: in graph.data.frame(filename[c("reportern", "partnern")], ... :

if helps, checked:

class(dflist[1]$partnern) [1] "null"

any suggestion? can explain me happens?

thanks lot, umberto.

igraph names vertices

php - Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object -



php - Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object -

i'm building bundle in laravel 4 getting non-object error when attempting access db seems instantiated object. here's setup:

the config , class in question:

composer.json:

... "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/testcase.php" ], "psr-0": { "vendor\\chat": "src/vendor/chat/src" } } ...

the class:

namespace vendor\chat; utilize illuminate\database\eloquent\model eloquent; class chathistory extends eloquent { protected $table = 'chat_history'; protected $fillable = array('message', 'user_id', 'room_token'); public function __construct($attributes = array()) { parent::__construct($attributes); } }

the call:

$message = new message($msg); $history = new chathistory; $history->create(array( 'room_token' => $message->getroomtoken(), 'user_id' => $message->getuserid(), 'message' => $message->getmessage(), ));

the error:

php fatal error: phone call fellow member function connection() on non-object in /home/vagrant/project/vendor/laravel/framework/src/illuminate/database/eloquent/model.php on line 2894

i believe i'm missing fundamental , under nose. , help!

edit:

here class that's instantiating chathistory , calling write:

namespace vendor\chat; utilize ratchet\messagecomponentinterface; utilize ratchet\connectioninterface; utilize vendor\chat\client; utilize vendor\chat\message; utilize vendor\chat\chathistory; utilize illuminate\database\model; class chat implements messagecomponentinterface { protected $app; protected $clients; public function __construct() { $this->clients = new \splobjectstorage; } public function onopen(connectioninterface $conn) { $client = new client; $client->setid($conn->resourceid); $client->setsocket($conn); $this->clients->attach($client); } public function onmessage(connectioninterface $conn, $msg) { $message = new message($msg); $history = new chathistory; chathistory::create(array( 'room_token' => $message->getroomtoken(), 'user_id' => $message->getuserid(), 'message' => $message->getmessage(), )); /* error here */ /* ... */ } public function onclose(connectioninterface $conn) { $this->clients->detach($conn); } public function onerror(connectioninterface $conn, \exception $e) { $conn->close(); } protected function getclientbyconn(connectioninterface $conn) { foreach($this->clients $client) { if($client->getsocket() === $conn) { homecoming $client; } } homecoming null; } }

the fact db isn't available suggest eloquent isn't beingness loaded top?

answer:

bootstrap bundle in service provider's boot method.

explanation:

since you're developing bundle used laravel, there's no point in making own capsule instance. can utilize eloquent directly.

your problem seems stem db/eloquent not beingness set yet time code hits it.

you have not shown service provider, i'm guessing you're using 1 , doing in register method.

since bundle depends on different service provider (databaseserviceprovider) wired prior own execution, right place bootstrap bundle in service provider's boot method.

here's quote the docs:

the register method called when service provider registered, while boot command called right before request routed.

so, if actions in service provider rely on service provider beingness registered [...] should utilize boot method.

php laravel package eloquent composer-php

xpath - How to trim the XSLT use attribute expression -



xpath - How to trim the XSLT use attribute expression -

i new xslt , have got special requirement. xml file looks below.

<results> <result> <price> <lineprices> <productid>productid:1000</productid> <uom>kg</uom> <quantity>0</quantity> </lineprices> <lineprices> <productid>productid:1002</productid> <uom>each</uom> <quantity>0</quantity> </lineprices> </price> </result> <result> <productlist> <productid>1000</productid> <relevance>0.9</relevance> <sponsored>0</sponsored> </productlist> <productlist> <productid>1001</productid> <relevance>0.8</relevance> <sponsored>0</sponsored> </productlist> </result> </results>

i have write xslt keys match pattern. have written key productlist shown below.

<xsl:key name="productsidforproduct" match="productlist" use="productid" />

in similar way trying write key lineprices shown below.

<xsl:key name="productsidprice" match="result/lineprices" use="productid" />

however returns 'productid:1000' in utilize attribute. trying trim 'productid:' utilize attribute value. how can write trim look extract '1000' 'productid:1000' within xpath expression?

just utilize substring-after():

substring-after(productid,':')

xslt xpath

c++ - Using Vicon Datastream SDK with Unreal Engine throws error on namespace CPP in Vicons client.h -



c++ - Using Vicon Datastream SDK with Unreal Engine throws error on namespace CPP in Vicons client.h -

first of have mention i'm new c++ within course of study of studies have gained experiences programming. currently, i'm working on plugin datastream between vicon blade 1.7 , unreal engine 4.4.3. should done using vicon datastream sdk v 1.4 contains header file, library , .dll file.

right now, i'm having problems compiling basic plugin. vicon datastream sdk build within older version of visual studio 2010. want know if there possibility go on working vicon sdk in visual studio 2013? should forcefulness sdk utilize latest .dll in visual studio , if how do that?

i tried go on working sdk ignoring problem i've mentioned before. when built project without changing header file of sdk i'm getting error:

error 2 error c2059: syntax error : 'constant'

here affected rows:

#ifdef win32 #ifdef _exporting #define class_declspec __declspec(dllexport) #else #define class_declspec __declspec(dllimport) #endif // _exporting #elif defined( __gnuc__ ) #if __gnuc__ < 4 #error gcc 4 required. #endif #define class_declspec __attribute__((visibility("default"))) #else #define class_declspec #endif #include <string> namespace vicondatastreamsdk { namespace cpp { ... } }

if redefine sec namespace 'ucpp' i'm getting huge list of errors one:

error 2 error lnk2019: unresolved external symbol "__declspec(dllimport) public: __cdecl vicondatastreamsdk::ucpp::client::client(void)"

i think it's because cpp defined in unreal engine because of dependency of header file .dll file in sdk definition of namespace unchangeable in sdk. expectation right or on wrong track?

i had similar problems name space. prepare did in ue4 plugin header file before including vicon datastreamsdk

#define ucpp cpp #undef cpp #include <client.h> //vicon datastreamsdk .....

at end of file redifined cpp macro

#define cpp pcpp

this compiles , works fine no problems

c++ visual-studio sdk unreal-engine4

html - Outlook changing border css on table -



html - Outlook changing border css on table -

i'm having problems creating html emails display correctly in outlook desktop 2013, i've managed solved problems until border issue can't understand.

basically in outlook web app table looks this: http://imgur.com/eqblukf

but on outlook 2013 somehow looks this: http://imgur.com/s1zqrqw

here's table code before outlook eats , makes mess:

<table cellspacing="0" cellpadding="1" border="0" align="center" width="100%" style="margin:auto;"> <thead> <tr height="40" style="background-color: #cfe1d3; "> <th align="center" width="17%" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px 0 0 1px;"><strong><?php echo $this->__('item') ?></strong></th> <th align="center" width="17%" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px 0 0 1px;"><strong><?php echo $this->__('product code') ?></strong></th> <th align="center" width="30%" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px 0 0 1px;"><strong><?php echo $this->__('product description') ?></strong></th> <th align="center" width="10%" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px 1px 0 1px;"><strong><?php echo $this->__('quantity') ?></strong></th> </tr> </thead> <tbody> <tr> <td align="center" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px; border-right-width: 0; border-top-width: 0;"><img src="images/product" alt="test" width="100%" height="auto" align="left" /></td> <td align="center" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px; border-right-width: 0; border-top-width: 0;">test</td> <td align="center" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px; border-right-width: 0; border-top-width: 0;">this test</td> <td align="center" style="line-height: 1.6em; border-style: solid; border-color: #777; border-width: 1px; border-top-width: 0;">1</td> </tr> </tbody>

have yout tried adding border-collapse: collapse table's style attribute? outlook supposes borders of table cells should not overlap, unless beingness told to.

html css email outlook outlook-2013

const - Accessor functions in class c++ -



const - Accessor functions in class c++ -

for illustration have accessor function class:

class { public: int a; int& geta() const; }; int& a::geta () const { homecoming a; // error: invalid initialization of reference of type 'int&' look of type 'const // int' }

the questions are: 1. info fellow member 'a' not of type 'const int', why error? 2. when alter homecoming type int works. why?

because specify geta() const. returning non const reference fellow member variable method declared const allow modify value referenced.

if want read-only accessor declare accessor as

const int& a::geta() const

otherwise must remove constness method.

turning returned value int allowed because not returning reference anymore, re-create of a there no way modify original fellow member variable.

mind allowed have them both available:

int& geta() { homecoming a; } const int& geta() const { homecoming a; }

c++ const accessor

html - Submit button wont change on hover -



html - Submit button wont change on hover -

i trying donate button alter on hover in next site http://laceibamfi.org/.

the css using won't respond on hover. don't know do.

what want is:

<input type="submit" value="donate now!" name="submit" id="thebutton">

to have hover affect, have css:

#thebutton { background: none repeat scroll 0 0 #73752b !important; border-radius: 13px; border-top: 1px solid #d4d117; box-shadow: 0 1px 0 rgba(0, 0, 0, 1); color: #000000; font-family: georgia,serif; font-size: 24px !important; padding: 6px 12px; text-decoration: none; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); vertical-align: middle; }

working jsfiddle have: http://jsfiddle.net/bxm2wnyd/1/

you haven't called :hover selector.

if using css, create new block so

#thebutton:hover { selector: property }

if using sass can phone call &:hover within id element

#thebutton { ... ... &:hover { } }

html css web

customization - Opencart hide default text if no special offers available -



customization - Opencart hide default text if no special offers available -

my question similar opencart hide special offers title if no special offers available.

i want remove default text, "there no special offer products list." displays when there no specials offered.

i not know file find , remove this.

i'd grateful help this. thanks.

the text looking in next language file:

catalog/language/english/product/special.php

you can either remove text between single quotes, $_['text_empty'] variable following:

$_['text_empty'] = '';

... or improve solution, disable displaying in theme. search next file:

catalog/view/theme/your_theme_name/template/product/special.tpl

... , remove next string it:

<?php echo $text_empty; ?>

an improve way using vqmod script, mentioned in question, you'd remove file, skip part.

customization opencart default

excel vba - VBA BUTTON to copy from one workbook to another -



excel vba - VBA BUTTON to copy from one workbook to another -

and need help accomplish specific re-create , paste. have active client list updating. , when work finish have prepare invoice. trying no success create button on active costumer workbook re-create client name select maybe highlighting cell in column c, transfer name template named invoice in cell b3. template set vlookup , if function populate info based on client name. want button re-create cell select not whole column or row. code possible?

both these suggestions assume in client workbook/sheet cell selected ... button code this:

sub copy_cust() workbooks("invoice").sheets("sheet1").range("b1") = activecell end sub

or

sub copy_cust2() selection.copy workbooks("invoice").sheets("sheet1").range("b1").pastespecial application.cutcopymode = false end sub

excel-vba excel-formula buttonclick commandbutton

Ruby Freezes when Installing on server -



Ruby Freezes when Installing on server -

i have digital ocean account, , i've never had problem before. whenever seek utilize cap deploy:install, install ruby , etc server. command prompt get's point in first image. ("installing ruby") , if cancel it, will show image 2. if help this. amazing. it's client of mine , can't seem figure out.

image = ubuntu 1 gig nginx

ruby-on-rails ruby ubuntu nginx capistrano

android - Unity AndroidJavaObject java.lang.NoSuchMethodError: -



android - Unity AndroidJavaObject java.lang.NoSuchMethodError: -

i want useragent on unity. platform android.

but nosuchmethoderror why?? im not @ english. sorry

androidjavaclass unity = new androidjavaclass ("com.unity3d.player.unityplayer"); androidjavaobject context = unity.getstatic<androidjavaobject>("currentactivity").call<androidjavaobject>("getapplicationcontext"); androidjavaobject webview = new androidjavaobject ("android/webkit/webview", context); androidjavaobject webviewsetting = webview.call<androidjavaobject> ("getsettings"); string useragent = webviewsetting.call<string>("getuseragentstring");

you need utilize "." , not "/" in class name

correct

androidjavaobject webview = new androidjavaobject ("android.webkit.webview", context);

java android unity3d

phpmailer - PHP Mailer Coding Issue -



phpmailer - PHP Mailer Coding Issue -

i having issue getting php mailer code work correctly. can send email on page load fine, issue isset command submit form 1 time submit button has been pressed. have tried putting in various places still can't work. help appreciated.

<?php require '/phpmailer/phpmailerautoload.php'; require_once '/phpmailer/class.phpmailer.php'; include '/phpmailer/class.smtp.php'; if(isset($_post["submit"])) { $emailaddress = '****@**********'; $message= 'name: '.$_post['name'].'<br /> email: '.$_post['email'].'<br /> ip: '.$_server['remote_addr'].'<br /><br /> message:<br /><br /> '.nl2br($_post['message']).' '; $mail = new phpmailer(); $mail->issmtp(); // telling class utilize smtp $mail->host = "********"; // smtp server $mail->smtpdebug = 1; // 1 = errors , messages,2 = messages $mail->smtpauth = false; // enable smtp authentication $mail->port = 25; // set smtp port gmail server $mail->smtpsecure = 'false'; // enable encryption, 'ssl' accepted $mail->charset = 'utf-8'; // interprets foreign characters $mail->setfrom('***********'); $mail->addreplyto('**********'); $mail->subject = "contact form submission ".$_post['name']." "; $mail->msghtml($message); $mail->addaddress($emailaddress); if(!$mail->send()) { echo "message not sent. <p>"; echo "mailer error: " . $mail->errorinfo; exit; } echo "thank you, message has been sent!"; }

i'm going create comment answer, because conclusion can come , be, without seeing op's html form.

your conditional statement if(isset($_post["submit"])) based on submit button named submit. if submit button has name="submit" instead of name="submit", explain it. if isn't named, do.

i.e.:

<input type="submit" name="submit" value="send email">

is not same as

<input type="submit" name="submit" value="send email"> post variables case-sensitive.

your presently shown code has proper bracing.

having used error reporting , placed top of file(s) right after opening <?php tag

error_reporting(e_all); ini_set('display_errors', 1);

would have signaled undefined index submit... warning message.

php phpmailer

mysql - How to place a UNION record into a specific query row -



mysql - How to place a UNION record into a specific query row -

is possible construction in mysql query?

+---------+------------+--------+ | name | date | total | +---------+------------+--------+ | bob | 2014-10-09 | 100.00 | | roy | 2014-10-09 | 200.00 | | joy | 2014-10-09 | 150.00 | | total | 3 | | | jim | 2014-10-10 | 100.00 | | lin | 2014-10-10 | 300.00 | | total | 2 | | | | total | 850.00 | +---------+------------+--------+

right have query looks this:

(select r.id id, concat(g.fname,' ',g.lname) name, r.arrival arrival, r.departure departure, datediff(r.departure, r.arrival) days, u.unit_nickname unit, r.total_price reservations r, guests g, units u g.id=r.guest , r.unit = u.id , r.deleted_at null having r.arrival between '2014-10-01' , '2014-10-30' order r.arrival) union (select "totals", "", count(arrival), "", "", "",sum(total_price) reservations)

obviously columns different gist same. after each day want display count of reservations on day. possible in mysql?

right 1 lastly record of "totals" , total reservations overall along total money (i want maintain record).

mysql sql join union

c# - Google Contacts API -



c# - Google Contacts API -

i started working google contacts api , can´t find illustration how work authentification stuff.

i used google contacts api version 3.0 documentation understanding basic workflow contacts api, have no thought how work authentification tokens.

after searching in web found tutorial google oauth2 c# in tutorial working usercredential object. in google contacts api version 3.0 documentation used requestsettings object. object has constructor accepts applicationname , gdatacredentials object.

so tried next code:

gdatacrendentials credentials = new gdatacredentials(clientid); credentials.username = "<my gmail username>"; this._requestsettings = new requestsettings(getapplicationname, _credentials);

the clientid got sec link posted.

so tried access contacts code:

feed<google.contacts.contact> f = _contactsrequest.getcontacts(); ilist<icontact> mappedcontacts = new list<icontact>(); foreach (var contact in f.entries) { //do stuff }

with code google.gdata.client.gdatarequestexception @ foreach:

{"execution of request failed: https://www.google.com/m8/feeds/contacts/default/full"}

could please give me suggestion wrong here?

there oauth2 sample included gdata .net client library:

https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs

the relevant source code located here:

https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/oauthutil.cs#200

c# .net google-api google-oauth google-contacts

python - Make undirected graph directed -



python - Make undirected graph directed -

i've got undirected, finish graph , convert directed acyclic graph (unidirectional) path between each node. start off, want add together random edges , stop 1 time nodes connected. algorithm @ (using python, language do).

so instance graph, not connected further:

a ---- b ---> b \ / => / \ / v c c

, in case, undirected edges turn directed edge

a ---- b ---> b \ / => ^ ^ \ / \ / c c

update

note aim convert undirected graph directed graph per above constraints. spanning tree, there more 1 solutions conversion process (as shown in above example).

you need directed spanning tree.

it's easy find directed spanning tree in undirected graph. depth-first-search, ignoring , cross edges. edges traverse form directed tree touches every node in each connected component.

however have added restriction want border selection random.

so can utilize minimum spanning tree algorithm kruskal's algorithm random border weights.

note there no reason store , compute random border weights. first step of algorithm sort weight. replace sort random permutation of edges, , you're in business.

python graph directed-acyclic-graphs

xampp - Android Connecting to Xamp -



xampp - Android Connecting to Xamp -

good day.i trying connect android application xamp. have application uses xamp, works on emulator not on actual device.after hours of searching, found solutions utilize tethering on usb , wifi. tethering error "adb problem, unable communicate device..please kill add".with wifi, not access localhost.i know might broad question.what asking is, how can create device access xamp localhost?

i mentioned above show tried , not succeed.

if android device , device running xampp, both on same network, utilize private ip address of machine running xampp, if they're not on same network, gonna need port forwarding , maybe static ip address.

android xampp

linux - How to run command in cron job with external string -



linux - How to run command in cron job with external string -

i need run corn job every month update software license.

the license ready in text file on remote server (example: http://codebox.ir/soft/license.txt) , update every month.

license.txt content illustration "tev3vv5-v343".

i want grab license , set in command:

# update xxxx-xxxx

how can create this?

centos 6.4

write script fetches file remoteserver

wget http://codebox.ir/soft/license.txt

then key out of textfile , pipe updatecommand

update `cat license.txt`

note backticks, script this

#!/bin/sh # # script fetches , updates licensefile # wget http://codebox.ir/soft/license.txt; update `cat license.txt`;

make file executable

chmod +x updatelicense.sh

and set in crontab

cd /path/to/script;./updatelicense.sh

or maintain compact, allthough check if file in expected format first.

#!/bin/sh # # script fetches , updates licensefile # update `wget http://codebox.ir/soft/license.txt`;

and checking if fetch succeeded

#!/bin/sh # # script fetches , updates licensefile # url = http://codebox.ir/soft/license.txt wget_output=$(wget -q "$url") if [ $? -ne 0 ]; update $wget_output fi

no can develop further, i'd advise check format of key before updating

#!/bin/sh # # script fetches , updates licensefile # # define url url = http://codebox.ir/soft/license.txt # fetch content wget_output=$(wget -q "$url") # check if fetch suceeded $? returnvalue of wget in case if [ $? -ne 0 ]; # utilize mad regexskillz check format of licensekey , update if matched if [[ $wget_output == [a-z0-9]+-[a-z0-9]+ ]] ; update $wget_output; fi fi

i'd homecoming values farther raise quality of script, i'd pass url , regex function maintain script reusable that's matter of taste

linux terminal cron centos