Posts

Showing posts from April, 2012

How to structure Rails link so that clicking it will update an ActiveRecord attribute -

I have two models, a property model and an app model. There are many properties in the application, and the property is an application_id in the property model, such as the application_id, which indicates the application associated with the property. I want to show a list of all the potential applications on the property show page, a link to the application which, if clicked, will update the application_id just in the property model in the ID of that application. Here is my relevant code: view / properties /show.html.erb select an application template : & Lt; Ol class = "microposts" & gt; & Lt;% @ owner.application.each do | Template | & Gt%; & Lt; Li & gt; & Lt;% = link_to "Application # {template.id}" ,: admin = & gt; "Attribute",: verb = & gt; "Update" ,: Method = & gt; : Put, application_id = & gt; Template.id% & gt; & Lt; / Li & gt; & Lt;% end% & gt; & Lt; / O...

html - How to prevent scrollbar from repositioning web page? -

I have a website with a center-aligned DIV. Now, some pages have to scroll, nothing. When I move from one type to the other, the page takes a few pixels aside as a scrollbar, is there any way to avoid this without clearly displaying the scrollbar on each page? overflow-y: scroll is correct, but you should use it with HTML tags, not On the body or on IE 7 you get a double scrollbar. Then the right CSS will be: html {overflow-y: scroll; }

mysql - Update a second table, using trigger -

I am trying to create a simple trigger, but, if I media Price comes from @total or @sum then the value on Proto is that I already have the option to test the option for "1" or "1 + 1" Tested to see if I was not updating properly or the problem was the operation itself. DELIMITER $$ Start triggering ratings before joining the rating for each line SET @total = @total + 1; SET @sum = NEW.stars + @sum; Update Prato P SET p.media = @ sum / @ total WHERE p.id = 1; End; $$ DELIMITER; Any ideology? I triggers on for each line . I thought, every time it was updated, it would move to run all the rows but, instead, it is implemented for each line which was updated , which could makes. This was my last result of the trigger, to add and update ratings (which prato ) DELIMITER $$ After inserting the trigger, after putting the INSERT on the rating for each line, if- (New.food_id is not empty) then SET @ media = (SELECT SUM (stars)) for ratings whe...

sql - How to do this dynamic where clause in EF -

Some advice about how to deal with the following selected queries with EF * Note, I Need help with SELECT only via e-mail. Insert a table table or stuff for a sample of my table structure. Create sample SampleTable value (1, 'GoodData'), (2, 'BetterData'), (2, 'whatever' Select from where SampleTable (* 10, 'GoodData') * Fu = 2 and Bar = 'BetterData') or (Fu = 1 and Bar = 'GoodData') --There these lines 'or' lines leave the table SampleTable Here are a couple of methods of extension: Public Static Class PredicateBuilder {Public Static Expression & lt; Funk & Lt; T, boolean & gt; & Gt; True & lt; T & gt; () {Return F = & gt; truth; } Public steady expression & lt; Func & lt; T, bool & gt; & Gt; Wrong & lt; T & gt; () {Return f = & gt; false; } Public steady expression & lt; Func & lt; T, bool & gt; & Gt; Or & lt; T & gt; (This expression ...

express - basic node.js tutorial error Object function router(req, res, next) has no method init -

I'm new to Express and WebStorm and I'm working on a simple tutorial Believe that I have followed all the instructions correctly and have fixed the type of site on (user vs. users etc.) Finally, I get the following error: / usr / bin / node app.js /home/admin/WebstormProjects/MyNode/app.js:61 users.init (); ^ Type Error: Object Function Router (Rick, Race, Next) {Router Handle (Rake, Race, Next); } There is no way 'init' on the object. & Lt; Anonymous & gt; (Module Js: 456: 26) on the object. Function module.load (module .js: 356: 32) function. Function on module._load (module .js: 312: 12) Module.Ranneman (module .js: 497: 10) at startup (node. Js: 119: 16) at node.js: 902: 3 end process with exit code 8 me It seems that this express edition is due to incompatibility. I had read the change doctor for Express 4, but I still can not debug this error You must change the router with exports.init () .init () : router.init = function () {user...

python - Checking a variable -

Currently I have a code that leads to vectors and creates one-third: b category (2047): For a boundary (B + 1,2048): Vector 1 = (L [B] [0], L [B] [1], L [B] [2]) Vector 2 = (L [A] [0], L [A] [1], L [A] [2]) X = Vector 1 Y = Vector 2 Vector 3 = List (NP. Array (X) - NP Array (Y)) Dot Product = Decrease (Operator.ed, map (operator.mult, vector3, vector3)) DP = dot product ** 5.Data_Point = DPB N = Int (DP / Bin_vidth) if the owner & lt; Num_bins: bins [bin] [2] + = 1.0 / bin_volumes [bin] ps b = 36771.881 but I want to say that if (vector 3 dot product with b) (b Dot product b) / 2 then vector 3 = vector 3 - b and (vector 3 dot product B) (B-dot product with B) / 2 > Then vector 3 = vector 3 + b How do I add it to my loop, so that it will check vector 3 for these two conditions for each vector 3? The package is being used: Import operator import matplotlib.pyplot plt as import npg as numpy Current Code: Border for Border = 36771.881 (2047): For a boundar...

decimal - In C#, why is this conversion causing an "Input string was not in a correct format." error? -

I have a code that reads a number (but comes in the form of a string) and I convert it to a byte I am trying to Normally the value is between 0 and 1 (like .25) and the below code works fine, but now I came to a negative value, especially "-1" and Trying to understand why this code is blowing: Public Static Bite GetByteVal (Detector Detroit, String Caption) {var val = dataRow.GetValue (Caption). Ostring (). Trim (); If (! String.IsNullOrEmpty (val)) {decimal converted val = decimals Purse (val, number style.alveexent | number equals; approbatory decimals) * 100; If (Convertvalle> = 0) {Return (byte) (converted veal); } Other {return (byte) 0; }} Return (Byte) 0; } When "val" variable comes in the form of "-1", I get an exception on this line: decimal converted val = decimal . Pars (Val, Number Style) Allow, Expand | Number Style, Allow, EmployPoint) * 100; which says: The input string was not in the correct format You must t...

sqlite - Refreshing views inside an android fragment -

Then I'm using an application and creating SQLite database. It has 3 swivelable tabs, which are made using pieces and in one tab I have a button that updates the SQL database and the other tab has a history of updates, or more specifically the history of purchase history In the tab I have a scrollview with a tablelayout that I can successfully draw on that piece of onCreateView method, although I have to update it with the new purchase to the database And I know how to do it I can tell because the new rows are adding when the database is being updated again when the application is reopened, but I do not get to update the perspective of history piece until the app has stopped and reopened Can. Any suggestions for doing this? "itemprop =" text "> After you update on your interface you should try that you can be dynamically As data transformation

Global name not working in python -

I am coding a program where I am using the curve to create a UI and I am using the terminal Has earned the width and height from a different command and I want to make those two variables universal so that I can pass them through parameters in every program (unless I have to do this?) I have a simple layout of: Def three (): print width, height def two (): three () def one (): two () global width global height width, height = console.getTerminalSize () one () So I'm getting a global name not defined error, but I'm sure why I have defined it globally, first it's called a series of functions, where did I go wrong? You do not need to define global in the main code; Any variables declared are global by default, you must put the global width and global height in that function where you call them the dragon Instead of using the global version of the variable instead of the local one (which is the default behavior). But to answer your second question: The us...

c# - Entity Framework 6 where did key and column attributes go -

I'm upgrading to Unit Framework 4.1.0.0 in Unit Framework 6 and I have really tough time tracking where all I have a class that looks like this and is using these properties but now I [key, column (order = 1)] public at person id {get; Set; } [Key, Columns (Order = 2)] Public Int Workout Id {Received; Set; } Etc ... Can not find out how the location features of the name are Even find out if I use them EEF can not liberate the class and rebuild it because the DB code is the first - I think .. Disclaimer: I have never worked before the code because I like that my ADMX file is being rebuilt from scratch Zhe can tell you in the right direction? MSDN Docs has some less, what I need in the EF 6 upgrade guide (found here) and you will not expect my last (not really - I do not see what I'm looking for). I'm not sure that I understand your question, but all EF 6 CF properties are: System.ComponentModel Data Annotation You can find here and here: ...

api - Nodejs POST request multipart/form-data -

I am trying to upload a post through a post request According to the readme I should be able to do just that var r = request.post ("http://posttestserver.com/post.php", requestbackback) var form = r.form () Form.append ("folder_id", "0"); Form.append ("filename", fs.createReadStream (path.join (__DERNAM, "image.png"))); Function Request Callback (error, race, body) {console.log (body); } The problem is, it does not work, I get a reply from the test server that it has left 0 post variable. I have confirmed that this short html page server & lt; Html & gt; & Lt; Body & gt; & Lt; Form action = "http://posttestserver.com/post.php?dir=example" method = "post" enctype = "multipart / form-data" & gt; File: & lt; Input type = "file" name = "submit" & gt; & Lt; Input type = "hidden" name = "some paragraph" value = "some...

ios - AdMob Mediation with iAd -

I have a universal iPhone / iPad application for which I am using AdMob mediation. I want to request the first IAD, and then an advertisement mb if IAD fails. I have $ 1.00 for the IADM and the ECPM setting is $ 0.20. However, I'm getting an IAD filling rate of about 20%, I have tried many different ECMP settings without success, before integrating AdMob mediation in a recent application update, I was just using iAds and an iAd Filling is about 99% rate. Is this happening because I am using a smart banner? What I believe supports the IAD Smart Banner. My app only supports portrait mode and the smart banner uses 320x50 for iPad and 768x90 for iPad. However, according to Apple's IAD programming guide, an IAD 768x66 is for an iPad. Is there an incorrect smart banner size for IADs to fail? Based on my iTunes sales report, I have more iPad users than iPad users. What is the best solution to this problem? Should I stop using a smart banner, or should I change the size of GADB...

Https Post Request Not Working in Android -

I am attempting to enter a website, by sending an HTTP post request and getting the source code for the next page After login "Android" i'v watches too many videos but nothing works: do any of these help in this code: The public class increases the main activity activity (textual text; @ Override protected zero creation (bundle saved inst Sustainate) {Super. NET (SENDED INSTEST STATES); setContentView (R.layout.activity_main); Text = (TextView) Find VViBID (RTTEV2); {New DownloadSourceCodeTask () ("Link");} hold (exception e) {GetApplicationContext (), "main in error", toast.LNNHNHLANG) Show ();}} PrivateInststream Open HTTP connection (string URL) IOException Throws {InputStream in = null; acute reaction = -1; Rl url = new url (url); url connection connection = url.openConnection (); if (! (HTTPL connection) for example new IOException ("no HTTPS connection"); Try {HttpURLConnection httpConn = (HttpURLConnection) conn; String Param = ...

javascript - How to trigger AJAX from a search button -

मेरे पास निम्न जावास्क्रिप्ट है: & lt; script & gt; फ़ंक्शन शोटेकेट्स (एआरआर) {if (str == "") {document.getElementById ("txtHint")। InnerHTML = ""; वापसी; } यदि (window.XMLHttpRequest) {xmlhttp = new XMLHttpRequest (); } Xmlhttp.onreadystatechange = function () {if (xmlhttp.readyState == 4 & amp; xmlhttp.status == 200} {document.getElementById ("txtHint")। InnerHTML = xmlhttp.responseText; }} Xmlhttp.open ("GET", "/processes/editticket.php?WTNum=" + str, सत्य); xmlhttp.send (); } अगर मैं एक selectbox का उपयोग करता हूं और "onchange" के साथ फ़ंक्शन को ट्रिगर करता है तो यह पूरी तरह से काम करता है। हालांकि, मेरे मुवक्किल ने इसके बजाय एक खोज बॉक्स का अनुरोध किया। मुझे इसे खोज बॉक्स के साथ काम करने के लिए नहीं मिल सकता है यहां खोज बॉक्स और div के लिए मेरा HTML है जहां परिणाम जाना चाहिए। & lt; form class = 'form-horizontal col-xs-12 col-md-12 col-lg- 12 'name = "editticket" व...

ios7 - Can we make our own Find My iPhone app -

I'm thinking of making my own app as soon as possible. But I am confused whether the apple allows developers to use play with security or is there an Apple API that can help us to include features as the above app? OK I can not comment because of low reputation but people have no reason to down-grade Should give. Very valid question of this

python - BytesIO stream to Numpy arrays? (Picamera) -

I am using Piccamera with Raspberry P to take pictures and then analyze the differences between them. . I am using the following code to capture a Bitciano stream and then read it in a Numpy array (taken from): stream = io.bytesIO () Camera with: picamera.PiCamera () Camera: Camera. Resolution = (100, 60) camera.framerate = 30 While not done: camera.capture (stream, format = 'jpeg', use_video_port = true) If previous data == None: previousData = cv2.imdecode (np. Fromstring (stream.getvalue (), dtype = np.uint8), 1) previous data = previous data [: ,,,, :: - 1] Other: timestar T. pneumatic = time.time () currentData = cv2.imdecode (np.fromstring (stream .getvalue (), dtype = np.uint8), 1) current data = past data [, ,,, :: - 1] ... (Excluded Analysis Code) .... Previous Data = Current Data The Analysis Code works, except that it will continue to use the same frame repeatedly. I am assuming that the way I am studying with the stream should be a problem, but I do not ha...

Order of treechart entries not correct in R igraph package -

Image
This is a follow-up question: I am using the following function: treechart = function () {library (psycho) field & lt; - max (count.fields (readclipboard ()), sep = "\ t") dat = read.table (text = readClipboard (), Sep = "\ t", col.names = paste0 ("V ", Sequence (field)), header = FALSE, fill = true, strip.white = TRUE, stringsAsFactors = FALSE, na.strings =" ") Library (zoo library) (igraph) # to generate data # if less Level (on the right) # is unavailable [1] & lt; - na.locf (for data [1]], Na.rm = FALSE (i ncol (dat): 2) {dat [[i-1]] & lt; - ifelse (! Is.na (dat [[i]]), na.locf (Dat [[i-1]], na.rm = F, dat [[i-1]])} # graph edges Get edges for & lt; - rbind (na.omit (dat [1: 2]), two .call ('rbind', lapply (1: (ncol (dat) -2), function (i) na.omit (setNames (dat [(1 + I): (2 + i)], name (dat [1: 2])))))) # graph graph create & lt; - graph.data.frame (edges) # Plot graph e (g) $ curvature & lt; - 0 plot...

c++ - Binary Serialization Using Boost and uint8_t -

When I work with binary data, I use uint8_t . I think that just looks like the type of a byte though, I can not understand how to promote binary serialization to work with that type. Is I impossible or just a few simple missing? This example program does not compile VS 2013 with some complaints that the streams are not being converted to std :: ostream or std :: istream . This program works properly with char instead of uint8_t , but this bug is me :) #include & lt; Cstdlib & gt; // EXIT_SUCCESS #include & lt; Vector & gt; #include "boost / archive / binary_oarchive.hpp" #include "boost / iostreams / device / array.hpp" # include "boost / iostreams / device / back_inserter.hpp" #include "boost / iostreams / stream_buffer.hpp" ant Main (Int arc, four ** argv) {typedef std :: vector & lt; Uint8_t & gt; Buffer; Buffer buffer; // serialization {int foo = 1; Typedef boost :: iostreams :: back_insert_device ...

javascript - fire jquery mobile panel menu by clicking android native menu button using phonegap/cordova -

Image
I am developing an Android app using Jquery Mobile / Phonegap. To control the phone's menu button I have the following code: & lt; Script type = "text / javascript" charset = "utf-8" & gt; Delivery on phone / phone call loading // // At this point, the document has been loaded but is not Phonegap-1.0.0.js. // When PhoneGap is loaded and talking to a native device, // this event will call the 'deviceready` // function onload () {document.addEventListener ("DeviceRedi", OnDevice Read, False); } // PhoneGrap is loaded and it is now safe to call Phonegap methods / calls. Devise Readie () {// Register the Event Listener Document. AddEventListener ("Menubutton", at Menukaadown, Incorrect); } // menu on the menu item, turn on the menu button // function. (Warning ("This works");} and on the tag I added: & lt ; Body onload = "onLoad ()" & gt; So when I click on the Android original menu button,...

c# - Parse JSON object using RegEx -

मेरे पास निम्न JSON स्ट्रिंग है: {"प्रथम नाम": "जॉन", "LastName": "Smith"} जब मैं निम्नलिखित regex को लागू करता हूं, यह सही-सही कुंजी-मूल्य जोड़ी समूह देता है: (? & Lt; keyValuePair & gt; (? & LT; कुंजी & gt; "\ w +"):) + (& lt; मान & gt +? "* [^ \\]।?"?)? मुझे मैचों मिलते हैं: 1 "प्रथम नाम": "जॉन" 1.1 कुंजी: "प्रथम नाम" 1.2 मूल्य: "जॉन" 2. "अंतिम नाम": "स्मिथ" 2.1 कुंजी: "अंतिम नाम" 2.2 मान: "स्मिथ" अब, मुझे ऑब्जेक्ट के लिए समूह होना है, यानी सभी ऑब्जेक्ट्स को ढूंढना है .. एक ही जेएसओएन स्ट्रिंग पर, मैं निम्नलिखित रेगेक्स (? & Lt; ऑब्जेक्ट & gt; {(? & Lt; गुण & gt;। *?)}) मुझे मैचों मिलते हैं: 1 1.1 "वस्तु": "जॉन", "अंतिम नाम": "स्मिथ"} 1.1 वस्तु: {"प्रथम नाम": "जॉन", "अंतिम नाम": "स्मिथ"} 1.2 गुणधर...

Angular Route & pagination in angularJS -

मैं कोणीय- ui-bootstrap में एक पेजिंग कर रहा हूं searchapp.config ( फ़ंक्शन ($ routeProvider, $ locationProvider) {$ locationProvider.html5Mode (सच); $ मार्गप्रदाता। जब ('/ खोज' पृष्ठ ', {नियंत्रक:' वर्गीकृत एडकंट्रोलर ', पुनः लोडऑन खोज: गलत});}); Searchapp.controller ('classifiedAdController', फ़ंक्शन ($ दायरा, $ स्थान, $ मार्ग पर्म, वर्गीकृत) {$ scope। $ Watch ('currentPage', फ़ंक्शन (पेज) {console.log (पेज); $ location.search (' पेज ', पेज);});}); यह मेरा क्रियान्वयन है, सब कुछ ठीक है जब पेज और पृष्ठ पर अंक लगाना ठीक से लोकलहोस्ट लोड हो जाता है: 3000 / search फिर जब मैं पृष्ठ 1,2,3 पर क्लिक करता हूं, तो यूआरएल स्थानीयहोस्ट में बदल जाएगा: 3000 / खोज? पृष्ठ = 2 लेकिन जब मैं मैन्युअल रूप से स्थानीय होस्ट प्रतिलिपि: 3000 / search? Page = 2 पताबार में, यह मेरे यूआरएल को स्थानीय होस्ट पर वापस लाएगा: 3000 / खोज कोई भी इशारा या विचार को लागू करने के लिए? और वास्तव में कोणीय रूट प्रदाता क्या करता है? मैं ऐसा करने के लिए एक और कां...

javascript - Google Analytics Dashboard AJAX Function Does Not get values -

I used the following function to pass some data into an ASP.NET web service. Function Set Janssen () {$. Ajax ({url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'post', data: {email: 'clientlink@russell.com', password: 'russell1234', URL: GetVaria ()}, success: work ( Data (warning "(" success warning "+ data); var sTitle = $ (data) .find ('string'). Alert (" sTitle Alert "+ sTitle); Warning (" Data String " Data);}, error: function (xhr, textstatus, errorThrown) {warning ('error in simple method'); warning (textstats); alert (errorThrown);}}); $. AJAX ({url: "/APIWebService.asmx/GetMessage", type: 'post', data: {email: 'clientlink@russell.com', password: 'russell1234', URL: getVaria ()}, success: Function (data) {warning (success); var sTitle = $ (data) .find ('string'). Text (); alert (attitle); alert (data);}, error: function (xhr, textStat...

android - Install self-signed SSL certificate on Google Glass -

I'm developing an app for Google Glass, which is supposed to get some data from a specific server on https While hosting the simple WCF OData service is not always an option in the form of proper root CADs, I need a way to install my own signed .cer files on the device. I did not find anything about this ... The above link shows that this should work , But I do not know how ... Any advice is appreciated Individually, instead of trying to import SSL certificates into Glass, I include a custom HTTPS handler that confirms SSL certificate,

sql - Checking condition in IF vs WHERE clause -

I have a problem and I have two solutions to the problem that I will write a process that the required categories Rows will return The first solution is to pass the required categories as the boolean (or bit) values: - DECLARE @ ISRowType1Req bit; DECLARE @ ISRowType2Req bit; DECLARE @ tbl1 table (ID int, bread type varchar (50)); DECLARE @tmpTbl table (ID int, bread type varchar (50)); If IRowType1Req = 1 INSERT @tmpTbl SELECT * FROM @ TBL1 WHERE RowType = 'RowType1'; IF @IsRowType2Req = 1 @tmpTbl SELECT * FROM @ tbl1 IO RowType = 'RowType2'; SELECT * FROM @tmpTbl; Now, this solution only uses the IF section to select the required types of rows. The second one is: - DECLARE @ ISRowType1Req bit; DECLARE @ ISRowType2Req bit; DECLARE @ tbl1 table (ID int, bread type varchar (50)); SELECT * @ tbl1 where RowType = 'RowType1' and @ IsRowType1Req = 1 UNION SELECT * Where @ tbl1 the FROM RowType = 'RowType2' and @ IsRowType2Req = 1 WHERE clause ...

c# - Error: "an object reference is required for the non-static field, method or property..." -

Creating an application on ImC #. To accomplish its work, if there is a prime and if the same swap number is the prime, when I create my solution on the visual studio, then it says that "an object reference is required for non-static field, law or property Is ... "Im" volteado "and" siprimo "with methods to deal with this problem. Can you tell me where the problem is and how can I fix it? Thanks! Namespace console application 1 {class program {static zero main (string [] arg) {console.light ("write number:"); Long A = Convert ToInt64 (Console.Readline ()); // A, the number given by the user is AV = Voltage (A); // AVI is "A" but if swap is done (Sipparomo (A) == incorrect & amp; amp; amp; nbsp; (AV) == wrong) console Wrightite ("Both original and swap numbers are prominent."); Else console. The light line ("one of the numbers is not prominent."); Console.ReadLine (); } Private Bull Scipomo (Long A) {// Eva...

.htaccess - CakePHP without URL rewriting: redirect / to index.php -

I am using a KPHP framework on a shared hosting and do not turn on URL rewriting can do. Everything is working fine when I open /tc/index.php/Controller/Action in the folder named / tc . However, I would like to make it a little easier for my users so that they do not do this, they should open /tc/index.php , but only / TC (which is then the Should be redirected to /tc/index.php ). How to .htaccess ? Thank you! Clarifeteen I want a request at / tc / redirect at /tc/index.php Solution A simple for me RewriteEngine On RewriteRule ^ $ index.php / $ 1 [L, QSA] Cake handles PHP comfortably because all links point to /tc/index.php/Controller.// Thank you for your help! Try using the following code in .htaccess & lt; IfModule mod_rewrite.c & gt; Rewrite code% {REQUEST_FILENAME} on rewriting! -f Rewrite Convert% {REQUEST_FILENAME}! -d RectiteAril. ^ (. *) $ Index.php / $ 1 [L] Index IGOROUGH * & lt; / IfModule & gt;

awk - pass one command to another one on the terminal -

नीचे दिए गए कोड को देखें awk '{print $ 1}' grep _Y myFile मैं grep _Y myFile के परिणाम को awk कमांड पास करना चाहता हूं उस रेखा को कैसे सही ढंग से लिखना क्यों नहीं एक बार में सब कुछ करें: awk '/ _y / {प्रिंट $ 1} 'myFile

couchdb - How to store each database in a different directory -

Allows installation of a directory where the database is stored, such as: database_dir = / path / to / the / database but I want to store each database in a different directory. Is this possible? Is there any way to make this possible, if it is not supported outside of the box? Are the other NSQL databases that support this? a % 2f to obtain it in your database name: dch ð ???? º http put $ trash / dir% 2fsubdb dch ð ???? Tree ~ / couchdb / dbs / users / dch / couchdb / dbs one ???? One ???? Line _replicator.couch one ???? One ???? _users.couch a "????" One ???? DIR / AAP ???? Subdb.couch IIRC should be protected from condensation. A better question would be "Why do you want to keep your DB in separate folders"? It is not visible to the user, and they are already in different files. What is the benefit? Can you put each table in its own directory in the SQL database?

angularjs throws 'undefined' error if cookie name contains hyphen (dash) in it -

I am using cookies to read cookies. Although one of my cookies has a hyphen / dash in which Inbetween When I tried to do this, the person throws an 'undefined' error event until a cookie exists. Although this cookie names are not being used without hyphen / dash in it. P> Because 'pd' is because hyphen is zero operator, javascript interpreter thinks you are trying. Subtracting When the property name contains special characters, you need to wrap it in quotation marks and use it like this: $ cookies ["AUTH-PD-ID"]

css - Radial-gradient over a background image does not work on Safari -

I am trying to add a radial gradient to the background image. It works perfectly on Chrome and Firefox, but it's not on Safari. I do not know why it may be. Here's my CSS: # banner {background-attachment: scroll, scroll, scroll, fixed; Background color: #fff; Background: radial-gradient (circle 60% 30%, rgba (0,0,0,0.1), rgba (0,0,0,0.7.7)), url (../images/food 2.jpg) center Not left -repeat; -WebKit-Background-Size: Cover; -MOZ-BACKGROUND-SHAPE: COVER; -o-background-shape: cover; Background size: cover; } I tried: Background: -WebKit-radial-gradient (circle 60% 30%, RGBA (0,0,0, 0.1 ), RGBA (0,0,0,0.7)), URL (../images/FOD 2.JPG) center left no repetition; But it still does not work thanks css # banner {background-attachment: scroll, scroll, scroll, fixed; Background color: #fff; / * Safari 5.1 to 6.0 * / Background: -WebKit-radial-gradient (60% 30%, closest party, RGBA (0,0,0,0.1), RGBA (0,0,0,0.7)); / Opera 11.6 to 12.0 * / Background: -O-radial-g...

node.js - EJS Template: Using forEach + include -

I have a number of files in a folder that want to include in a template (EJS). I try: gt; & lt;% contains slide / item%> gt; & lt;%}); & Gt%; I will use nodes to fill the array by looking in a folder. But I get an error: Error: It seems that ejs do not use "items" as a variable. There is a problem in Gitub for that problem.

php - simplexml_load_file not loading the xml file -

I have trouble with simplexml_load_file. It was not loading the XML file from the specified path. The file exists in the path. It was working in my local system (Windows 7), but when I run this command on the server system (Linux) it was not working. libxml_use_internal_errors (true); $ Xml = Simple XMLload_file ($ folder. $ Del_xml, 'simplexmail', libex ML_PARSEHUGE); If (! $ Xml) {Model_Log :: error ("Could not load XML file". $ Folder. ''. $ Del_xml); } Other {Model_Log :: info ("file {$ del_xml} load"); } Below is the XML. & lt ;? XML version = "1.0" encoding = "UTF-16"? & Gt; & Lt; The language of the products = "GB-N" XSI: Nomamageshesama location = "test_brand.xsd" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: gdha.library = "Blur: GDHA .library "& gt; & Lt; Products & gt; & Lt; Product_category_hierarchy & gt; & Lt; P...

Capitalized column name to retrieve data in Laravel 4 -

Image
अवलोकन: मेरे पास उपयोगकर्ता ध्यान दें कि अधिकतर प्रत्येक शब्द को कैपिटल कर दिया गया है, जैसे स्तंभ नामों पर स्टडडेल कैप हैं। अब, जब मैं प्रवेश कर रहा हूं, तब से एक समस्या निश्चित रूप से है, Laravel को कैपिटल कॉलम नाम पसंद नहीं है और जैसे। यह मेरा User Model है, मैं अपनी समस्या के बारे में संबंधित हिस्सों को अभी रखूंगा। कक्षा प्रयोक्ता सुधारात्मक उपकरण को बढ़ाता है UserInterface, RemindableInterface {protected $ primaryKey = "UserID"; सुरक्षित $ fillable = सरणी ('उपयोगकर्ता नाम', 'पासवर्ड', 'सक्रिय'); संरक्षित $ table = 'उपयोगकर्ता'; } और यहाँ मेरी विधि है जहां उपयोगकर्ता लॉगिन करने के लिए शुरू होता है। सार्वजनिक फ़ंक्शन postLogin () {$ validator = validator :: make (इनपुट: : सभी (), सरणी ('उपयोगकर्ता नाम' = & gt; 'आवश्यक', 'पासवर्ड' = & gt; 'आवश्यक')); अगर ($ validator- & gt; विफल ()) {// पुननिर्देशित} और {$ auth = AUTH :: प्रयास (ऐरे ('उपयोगकर्ता नाम' = & g...

#1111 - Invalid use of group function error in stored procedure mysql -

DELIMITER // CREATE PROCEDURE GetAllData () BEGIN execcrice DOUBLE DECLAR; SET निष्पादित = योग (अंतिम क्वालिटी * LastPx) / राशि (अंतिम क्वालिटी); AvgExedPrc, sum ((LastQty * LimitPrice)) के रूप में अंपायर चुनें / avgOrdPrc के रूप में (LastQty) योग, चर execprice का उपयोग करने में असमर्थ कोई भी कृपया मदद कर सकता है। sum () का उपयोग केवल एक क्वेरी में किया जाता है , जैसा कि यह 1 या अधिक पंक्तियां बताता है यहां आपके पास समेटे जाने के लिए कुछ भी नहीं है: SET execPrice = sum (LastQty * LastPx) / राशि (LastQty); इसे बदलें SET execPrice = LastQty * LastPx / LastQty;

How to expose a c++ function taking variable arguments in boost python -

I have a C ++ function that takes the variable number of arguments. Four Consists * Fun (int number, ...) {..... Some processing on the arguments given in}} Boost Python The code has been written to highlight this function, Namespace Promotion: Using Python Tax; BOOST_PYTHON_MODULE (lib_boost) {DEF ("fun", fun); } This code gives the following error when compiling /boost_1_42_0/boost/python/data_members.hpp15 In the file included, / from_1_42_0 / Boost / python / class.hpp.1, /boost_1_42_0/boost/python.hpp_1, from Lib_boost.h: 3, from Lib_boost.cpp: 1: /boost_1_42_0/boost/python/make_function.hpp: 'Boost in Function: : Python :: api :: object boost :: python :: make_function (f) [f with = const char * ( ) (int, ...) ': / boost_1_42_0 / boost / python / def Hpp: 82: 'boost :: python :: api :: object boost :: Python :: extension :: make_function1 (t, ...) [with t = const char instantiated ( ) (int, ...) '/boost_1_42_0/boost/python/def.hpp:91...

java - use of element is logback.xml -

मैंने slf4j-logback लॉगिंग के साथ एक सरल वेब अनुप्रयोग बनाया है मैं निम्न विन्यास का इस्तेमाल करता हूं जो mylog.log फ़ाइल में लॉग स्टेटमेंट प्रिंट करता है। & lt; कॉन्फ़िगरेशन & gt; & Lt; एपेन्डर नाम = "फ़ाइलएपैण्डर" वर्ग = "ch.qos.logback.core.rolling.RollingFileAppender" & gt; & LT; फ़ाइल & gt; $ {catalina.base} /logs/mylog.log</File> & LT; एनकोडर & gt; & Lt; पैटर्न & gt;% d {HH: mm: ss.SSS} [% धागा]% -5 लेवल% लॉगर {35} -% msg% n & lt; / pattern & gt; & Lt; / एनकोडर & gt; & Lt; / appender & gt; & LT; जड़ & gt; & Lt; level value = "DEBUG" / & gt; & Lt; एपेन्डर-रिफ रेफरी = "फाइलएपैण्डर" / & gt; & Lt; / जड़ & gt; & Lt; / विन्यास & gt; उपरोक्त काम ठीक है। मुझे एक लॉगर तत्व के रूप में & lt; logger नाम = "mylog" additivity = "false" & gt; & Lt; level value = "DEBUG" / & gt; ...

Getting the jquery right to do a search in lists and sublists -

I'm having trouble setting up a search input in my taskbar to hide and display elements in my menu. I Want to set a jQuery function which automatically gives the end to my first list and connects to the class ??? Active ?? # Thomas or # Thierry (to see the code) If a string enters the input (#search-bar), then some object exists in the sublist. Actually my HTML looks like this, anybody thinks how to write scripts? & lt; Script type = "javascript" & gt; Var str; Function search () {str = $ ('# search-bar'). Text (); AddClass ("active");}; & Lt; / Script & gt; & Lt; Input id = "search-bar" type = "article" name = "search" placeholder = "rechercher" class = "form-control geo-search-sidebar" /> & Lt; UL & gt; & Lt; Li id = "thomas" & gt; & Lt; Span class = "title" & gt; Thomas & lt; / Span & gt; & Lt; Ul class = "sub ...

mysql - order by case in sql 2005 server -

class = "text"> 155 Fast I need to firstly record the record with Fast Order SCC with the following order records: Instant 586 Fast 296 Fast 155 Fast 243Let 122Light I'm fasting in the first row, fast and late records, but they are not in asc order Order from the case Symbol 1 like '% FUT' when a symbol like '% CE' is 2, then when the symbol '% PE' then 3 and 4 end After placing an order to use the case statement, the symbol forwards its order by column order from the case when If there is a sign like '% FUT', then 1 when there is a sign like '% CE', 2 when symbol like '% PE' then 3 and 4 ends, symbol asc

nlp - Create wordforms using python -

How do I get different word forms using Python? I want to make a list like the following. function = ['work', 'work', 'works'] my code: raw = Nltk.clean_html (html) clear = re.sub (r '& amp; (ld | rd) quo? [; \]]', '\ "', Raw) token = Nltk.wordpunct_tokenize (clear) stemmer = PorterStemmer (T) [words for T in TOMMER and T in T] [tmemer.stem (t) text = nltk.Text (t) word = word (n) word = [stem word (e) for word ( E) appears in the word '' '' 'search_words =' set.split ('') '' sents = '' .join ([s.lower (for text)]] Blob = Textblob (sents.decode ('ascii', 'ignore')) match = [map (str, blob.sentences [i-1: i + 2]) # previous For the next, I, n (ni) (blob.sentences) is the # i index, e is the element if search_words & sets (s.words)] # return list (itertools.chain ('.') Replace ('& amp; rdquo', '') for matches in place of ('&...

javascript - Google Analytics AJAX e-commerce tracking -

I have an index.html which introduces the Universal Google Analytics tracking code: & lt; Script & gt; (Function (I, S, O, G, R, A, M) {i ['GoogleAnalyticsObject'] = R; I [R] = I [R] || function () {(I [R]. C = I [r] .q || []). Push (argument)}, I [R] .L = 1 * New date (); a = s.create element (O), M = S. ElementElementBitagname (O) [0]; a.async = 1; a.src = g; m.parentNode.insertBefore (a, m)}) (window, document, 'script', '// www.google-analytics.com/analytics. Js', 'ga'); GA ('Create', 'UA-XXXXXXX-X', 'Auto'); Ga ('Send', 'Pageview'); & Lt; / Script & gt; Later I load an HTML document which I insert through AJAX. Can I put JavaScript code for e-commerce tracking in a script tag in HTML which I insert again via Ajax without launching Google Analytics again? So I would have something like this: HTML inserted through AJAX: Will this be tracked correctly? And if a visitor closes the...

html - XPath select all text content for a inside that parent div exclude a specific tag -

एचटीएमएल के कुछ अंश जो मैं पूछता हूं: & lt; div class = "author "& gt; तोबी राफेल & lt; div class = "artdate" & gt; अंतिम अपडेटः 24 जुलाई 2014 | 16: 25 GMT & lt; / div & gt; & Lt; / div & gt; मुझे केवल "टोबी राफेल" की आवश्यकता है मैं & lt; div वर्ग "artdate" तत्व नहीं चाहता / चाहती हूं। मैंने XPath अभिव्यक्ति के नीचे की कोशिश की है लेकिन काम नहीं कर रहा है: [@ class = 'author'] / * / descendant-or-self :: * [text () और नहीं (स्वयं :: div)] मेरी क्वेरी में क्या गलत है? आपको रूट या चयनित तत्व से शुरू करना चाहिए। हम मूल में हैं का नाटक / div [@ class = 'author'] / text () यह बाहर होगा सभी तत्वों को खाली स्थान के रूप में रिक्त पाठ सहित, अपने स्थान के अंदर डाल दें ...: टेक्स्ट = 'टोबी राफेल' टेक्स्ट = '' यदि हम उस / div [@ class = 'author'] / text () से बचाना चाहते हैं तो [सामान्य करें-अंतरिक्ष (।)! = ''] आउटपुट बस टेक्स्ट: ...

java - Send data to android app from web client -

I am trying to do this that the Android app can be triggered by clicking on my web client from the computer I have searched extensively on setting up my set function but it seems that all devices need a mobile device to start a connection before doing anything to the web server. Is there any way to start the web client? Also, is there a way to do this without informing the user of the device, i.e. in the background? I am using the KPPP for the web client, but any type of answer would be appreciated. Thanks! Use push notification system to trigger any action on your device. Push notification systems such as, etc. are available for free and some are also paid. try them. Send a push notification and listen to that push message and trigger your action when you receive it.

android - How to change layout_weight in my View (programmatically) -

How do I use Java code to replace layout_weight of my code View object from XML? I have included the last thing that I tried below vynosy is my specialty with the value that I want to set see hospVyslLineAppColor = (see) View.findViewById (R.id.hospodarsky_vysledok_line_appcolor). HospVyslLineAppcolor.setLayoutParams (New LinearLayout.LayoutParams (Layout Paramount. MATCH_PARENT, Layout P. WRAP_CONTENT, Math. Falcon (Float) vynosy))); My XML: & lt; Android: id = "@ + id / hospodarsky_vysledok_line_appcolor" Android: layout_width = "match_parent" android: layout_height = "20dp" Android: layout_weight = "69382" Android: background = "# a8a8a8" /> You can use it for linerlight Code> LinearLayout. Outout Parameters = New liner layout. LayoutPam (Layout Parameter.philpaint, Layout Para. WRAP_CONTENT; Parameters.Wave = 1;

java - Jackson ignores end of body -

I have a problem with the fast XML jackson where the object ignores all of these things: {"StartIndex": 0, "length": 10, "gotoLastPage": false) Anyone who comes here is ignored I do not know It is possible to throw an error in this case. If the unexpected message is in the beginning, I want it to fail. The configuration property is set to DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES to the right. remove commas "," after line "" goto lateepage ": false, '

How do you create a "reverse pivot" in Google Sheets? -

Image
I am trying to create a "reverse smoke" function. I've searched long and hard for this type of function, but can not find what is already out. I have an abstract table anywhere from anywhere to 20 columns and hundreds of lines, although I would like to change it in a flat list so I used to create a database (or even flat for making more pivot tables) Data can be imported) So, I have data in this format: and it needs to be converted into this format Is: I have created a function which is the limit from sheet 1 Haaga and again will add formatted lines have been down the same sheet, although I try to make it work, so I could get work on sheet 2, that sheet will read the entire range of 1. Whichever I try, I can not do this to work, and wondering if anyone can give me any sign? Even what I have so far: function readRows () {var sheet = SpreadsheetApp .getActiveSheet (); Var rows = sheet.getDataRange (); Var numRows = rows.getNumRows (); Var values ​​= r...

php - 'insufficient data for an image' message when opening PDF -

मेरा php cli अनुप्रयोग टीसीपीडीएफ पुस्तकालय का उपयोग कर पीडीएफ बनाता है। अधिकांश मामलों में पीडीएफ को सफलतापूर्वक बनाया जाता है, लेकिन कभी-कभी पीडीएफ बनाया जाता है जो एडोब रीडर को त्रुटि को पॉप अप करता है: 'किसी छवि के लिए अपर्याप्त डेटा'। मैंने स्पष्ट रूप से इस संदेश पर कुछ शोध किया है, और इनमें से कोई नहीं नामित कारणों और न ही प्रदान किए गए समाधान मेरे मामले में प्रासंगिक हैं या समस्या का समाधान करते हैं। यद्यपि एडोब प्रॉडक्ट्स केवल एक ही समस्याएं हैं और अन्य पीडीएफ दर्शक भ्रष्ट फाइल खोल सकते हैं और इसे सही प्रदर्शित कर सकते हैं, इसका मतलब यह नहीं है कि यह एक एडोब से संबंधित समस्या है। उन्नत पीडीएफ संपादक के लिए, नाइट्रो 9, भ्रष्ट फाइलों को प्रदर्शित कर सकता है, लेकिन साथ ही समस्या का पता लगाता है और एक चेतावनी को पॉप अप करता है नाइट्रो का उपयोग करके मैं पीडीएफ फाइल को ठीक कर पा रहा हूं। चरण हैं: पीडीएफ से भ्रष्ट छवि ऑब्जेक्ट की छवि को निकालें और फिर छवि को पीडीएफ फाइल में सहेजी गई छवि से बदलें ... विशिष्ट छवियां जो त्रुटि / अलर्ट ट्रिगर करती हैं एक प्रकार (फ़े जेपी...

android - Eclipse IDE: How to stop Eclipse from opening .json files with Notepad, but with internal editor instead? -

I am using ADTPS for Android development with ADTS and for some time (about 2 weeks) .JSO Files that I archive are opened in Notepad / Raw folder instead of internal editor. How do I return these files to open with the internal editor? Right-click on the file and select "Open With At Text Editor" from the context menu.

php - SwiftMailer 'ErrorException' with message 'fopen(/tmp/...) failed to open stream: Permission denied' -

मैंने laravel एप पर एक cpanel साझा मेजबान । ईमेल usign मेल वर्ग भेजते समय, निम्न त्रुटि बेतरतीब ढंग से होती है (कभी-कभी मेल भेजी जाती है लेकिन कभी-कभी त्रुटि आती है) उत्पादन। सर्वर: अपवाद 'त्रुटि एक्स्पेक्शन' संदेश के साथ 'एफओपीएएन (/ टीएमपी / ई 19839 एफ 1 ए 2 डी 67 ए 4 बी 7 सी 83 ए 5951 सी 31 बीएफडी / बॉडी): स्ट्रीम को खोलने में असफल: अनुमति अस्वीकृत '/home/ekbatana/laravel4/vendor/swiftmailer/swiftmailer/lib/classes/swift/keycache/diskkeycache.php:300 में मैंने मेजबान समर्थन से संपर्क किया था, उन्होंने कहा था कि मुझे बदलने की आवश्यकता है डिफ़ॉल्ट अस्थायी निर्देशिका। SwiftMailer पैकेज में lib / preferences.php एक चर बुलाया $ tmp getenv ( 'TMPDIR' पर सेट है ) और फ़ाइल में एक टिप्पणी का कहना है कि: // आप टीएमपीडीआईआर परिवेश चर को सेट करके डिफ़ॉल्ट अस्थायी निर्देशिका को ओवरराइड कर सकते हैं। मैं स्थापित करने का प्रयास TMPDIR अलग अलग तरीकों से 1) .htaccess: setenv TMPDIR / घर / ... / laravel4 / ऐप्स / भंडारण / my_temp 2) में ...

jquery - Check if there's a name present in json -

I want to know that the json file has a 'archive' of the contents if it does and if it does not exist Many JSON files are present, so I will show it with a name and without the name of one. I do not know what is the best way to check my jQuery function. JSON // name store is present // {archive: {image: {}, product: {}, // etc}} {name: {}, content: {}, // etc}} // name does not exist // // catalog (or text page): What I try to do is something like this: function widget (catid, kathraff) {var url = catHref; $ .getJSON (url, function (jsn) {if (collection == true) {console.log ('yes products'); // create some HTML; and {console.log ('no sir no products'); / I have tried things like 'proprieti' or 'typewrite' or 'undefined' etc. but not with any luck. But can not it be difficult? Anyone? if (json ["archive"]) {...} or if (json.collection) {...} You obviously undefined and / or null for exa...

javascript - Cant' put number in value of text input using jquery -

I have a list that has many options, I dynamically set an event whenever a button is clicked , Create tables and text inputs and put values ​​in the list, but I have an option in which there is a number value but not set to the value of that input, see my code. My jquery code: $ ("# table_drugs"). Annexe ("& lt; tr> " + $ ("#Val (+) +" & gt; "+" & lt; / td & gt; & lt ("Explain #Drugs "). $ (" Explanation of # drugs "). Val () +" input type = 'text' name = 'how_to_use' value = "+ $ (" # drugs-explain "). Val () + "& Gt; +" & lt; / td & gt; & lt; td & gt; "+" & gt; Button type = 'button' class = 'call-sm-7btn btn-danger pull-right' & ' and my html: P> You need to quote around your values: $ ("# tables_drugs"). ("& Lt; tr & gt; & lt; td & gt;...

operating system - Is running Docker on bare metal maintainable? -

I want to create web services which will be distributed as a doc container on my platform. The docker running on a physical machine is faster than running in the VPS, because there is no upper part from the virtual OS layer. However, a VPS is more satisfying when the software in the environment crashes the system. I wonder what will happen if the environment is disconnected in the Docker Container, due to the OS bugs / exceptions or external attacks can affect the host system, and the whole machine is contaminated or Can the accident happen? Would you advise the docker to run physically or to any virtual machine? Sharing the kernel with the guest host by dock As a result, any kernel exploitation / corruption affects the host Will do Dockers safety seems so complex though. I advise to be very careful about reading and using users in our containers.

android - Editing list view items dynamically when using cursor adapters and loaders -

I am writing a small messaging app and I have had this problem recently. I have a ListFragment subclass, which implements the cursor loader callback. The built-in ListView is linked to a SimpleCursorAdapter . Each line view in this list has a layer illustration in the form of a background, I want to switch between the levels based on the database information (whether the message was sent or not). My question is, how do you change a line background in this case? Do I have to access it through the adapter? I'm pretty sure that this should be done in the onLoadFinished method. But this code gives me the NullPointerException you can talk me in the right direction, I would be really grateful Public Class MessagesFragment ListFragment LoaderManager.LoaderCallbacks Extends the apply. Cursor & gt; {Private Static MessagesFragment piece; Private stable main activity activity; Private Static SimpleCursor Adapter Adapter; Public static messagesFragment getInstance ...

javascript - How to convert an element to a string that can be stored and restored from localStorage -

My plan is after storing your elements in local elements once (for an online app) I think that If I can get it to work, it will make my app much faster). So I came up with the following, but the material seems to be either stored or returned as zero. Now I thought that an element was originally a string, so I do not have to do anything to store it in the local store, but apparently not. Does anyone know if I can get it, then what do I want? If you want to take it for a spin, you will need a small file which will have to be passed to HTML. Content is not important The first time it runs if (content) will evaluate for the wrong next time it is true and I added it to .clar () , made it optional . For the third time the showSource function will populate the id = localor element (which should be different from id = content element or whatever other element you choose to populate) "from the file "After the tap. function summary (source) {// function and related elem...