Posts

Showing posts from January, 2014

ios - Updating CentralManagers list of services for a peripheral -

Core has been an issue with bluetooth under iOS. I am programming an OTA updater, and in a strange issue Running when I turn the device into OATU mode, it disconnects and advertises different services under the same device, the UIID is a problem, when I try to find services from the newly connected device Give me the old list of services Which is not valid anymore. A split part of the problem is that the CBPeripheral.name value is the name of the original device, but returned to the ad dictionary DidDiscoverPeripheral is correct, this is the new name. Central Administration: (CBC Central Manager *) Central Duscare Supplementary Peripheral: (CBParyfare *) Peripheral Adadata: (NSStripe *) Advertisement Data: RSISI (NSN * *) RSS {Advertising (for advertising ( ID key) {NSLog (@ "key:% @, value:% @ \ n", key, [addata objectForca: key]); } NSLog (@ "Disclaimed Peripheral with Identifier:% @, State:% D, Name:% @, Service:% @", [Peripheral Identifier], [Peripheral Stat...

javascript - Get URL Params with JS -

इस सवाल का पहले से ही एक उत्तर है: 73 उत्तर 15 उत्तरों क्षमा करें, मैं इस पर नया हूँ, इसलिए मेरे साथ सहन करें। जावास्क्रिप्ट में, मैं कैसे सामग्री प्रश्न चिह्न के बाद यूआरएल का तो इस यूआरएल में: http://www.example.com/index.html#anchor?param1=value1& मुझे मान की एक सरणी चाहिए: {'param1': 'value1', 'param2': 'value2'} क्या जावास्क्रिप्ट में ऐसा करने के लिए कोई फ़ंक्शन है? आप कर सकते हैं इस तरह से कुछ करें: var पैरामीटर = window.location.search .substring (1) .split (/ & amp; /) .reduce (फ़ंक्शन (मापदंड, तत्व) {var की वैल्यू Pair = element .split (/ = /); p धमनी [चाबी वैल्यूपेयर [0]] = कुंजीवैलपेयर [1]; वापसी पैरामीटर; }, {}); अब पैरामीटर में आपके पैरामीटर मानों का एक पैरामीटर पैरामीटर नाम के आधार पर होगा।

java - Get only positive long from murmur3 guava -

I am using Java Moormoor 3 which will accept long to represent Lava. Is there any possibility of getting only positive long numbers? Correct ova USA Return +/- Results which are not good for me .. I use murmur3 to convert string IDs to numerical representation due to CRCAD framework limitations. I am not afraid of a small amount of confrontation. But I'm afraid to take the bus (murmur3Value). It should increase the probability of a lot of collision. Am I right? I have ~ 1 * 10 ^ 8 unique IDs, is it OK to fix their swan values ​​and to not be too confused I have 10 ^ 7 values But there is no composite but hashes are positive and negative, I just want to use positive values. Use of Math.abs is incorrect ... Math.abs (Long.MIN_VALUE) == Long.MIN_VALUE . It is also useless, considering that the simple options are: x> gt; & Gt; 1 and X & amp; Long.MX_VRA In any case you lose a bit, either the highest or the least important one. I think there is no...

javascript - Make the variables in Node module usable by jQuery, Ember, etc -

I am really new in the backend world, and I have a node module (called apjs) Accessed by Javascript module. If he counts, then he is called MonoDB. By now I can only send data () as the boring plain text on the page. I want to be able to manipulate this data for other purposes (such as creating a table) So how can I pass these variables in JavaScript, and so I can display them properly in HTML? You can use res.render to present data with Express and Z, it Express and Z: looks like res.render ('yourView', {data: yourVariable} .send is where to go. That should be either with an app initialization (app.js) or in an external file like (router.js), then your app is fed. Then, in the template used as a web page, You can make a list like this: # {data} or you can create a list like this (if you use Z Each data li = data in rows is expected that this is what is for you, and it helps: D. The example of an AP JS can look like now: var express = require (...

qt - How to enable a down arrow on QPushButton? -

By using (with you) method will add a menu and then draw down arrow button style settings). Is it possible to enable the drawing of the same arrow by any other method? When I click, I would like to use this style button to show a custom popup widget. You QToolButton instead of QPushButton Use Can and add actions on QToolButton. # include & lt; QWidgetAction & gt; Category myCustomWidgetAction: Public QWidgetAction {Q_OBJECT Public: Clear myCustomWidgetAction (QWidget * parent); Protected: QWidget * createWidget (QWidget * parent); }; myCustomWidgetAction :: myCustomWidgetAction (QWidget * parent): QWidgetAction (parent) {} QWidget * myCustomWidgetAction :: createWidget (QWidget * parent) {myCustomWidget * widget = new myCustomWidget (parent); Return widget; } You can add it to appear in a pop-up menu to your widget toolButton are: myCustomWidgetAction * widgetAction = new myCustomWidgetAction (this ); UI- & gt; ToolButton- & gt; AddAction (widg...

asp.net - Call UserControl method from a static method -

I am trying to make an AJAX call in my ASP.NET application. I have an ASPX page and an Essex page. I declare my user credit in all my Exxioni.spx first & lt;% @ Register TagPrefix = "UC" TagName = "UserControlEccezioni" Src = "~ / Eccezioni.ascx "%> .... & lt; Div & gt; & Lt; UC: User ControlAxcession Runat = "Server" id = "UKCZini" /> gt; & Lt; / Div & gt; I have this Ajax function: $ .ajax ({type: "POST", url: "Eccezioni.aspx / CheckExistingVariable", data Content Type: "Application / Jason; Charset = UTF-8", Data Type: "Jason", Success: Work () {Warning (Response D): '{var: "' + eccSplitt [i] + ' );}, Failure: function () {warning ("to");}}); I have webmath in eccezioni.aspx.cs: [System.Web.Services.WebMethod] Public Stable Boolean Checking Extensible Vehicle (string) Verb) {return ucEccezioni.CheckExistingVariable (var)...

c# - If GC does its job why do we get Out of Memory Exceptions? -

Normally I'm told that GC is very clever and messy than all of us It's not so, so I'm thinking when the memory gets reduced and releases memory for the program. Okay then why do I sometimes get out of memory exceptions on big things? At present, I am coming closer to another scenario which can be out of memory. I have a class level dictionary of some classes list, it has 200,000 keys in it at a global level. So I had to keep it in one of my ways I needed this, but as soon as I am done with that method, I want to empty my place. Is it sufficiently set to null? Private zoo (foo) {// do my_DICTIONARY work with MY_DICTIONARY = null //? // Ahh! Free memory or not? } This is not enough if you put a reference on your code somewhere: // Somewhere far away COPY_DICTIONARY = MY_DICTIONARY; ..... MY_DICTIONARY = Faucet; // inial dictionary will not be released because referencing the COPY_DICTIONARY object

ruby on rails - Can I use CanCan with model(s) other than User? -

I'm new to Rail and Construction apps with data on an API, I have two tables that I use for users I want to - students and teachers . I can authenticate with private def fetch_user_data (username, password) in controllers. 'URI' uriy = URI ('URL for API') res = Net :: HTTP.post_form (Yuri, 'username' => username, 'password' = & gt; password) xml = res.body doc = Noteary :: Slop (xml) @status = doc.auth.status.content.to_s @username = doc.auth.username.content.to_s @token = doc.auth.token.content.to_s @person_id = doc.auth. Person_pk.content.to_i @security_roles = doc.auth.security_roles.content.to_s.downcase End DECF Allocate if / faculty / = ~ @security_roles @user = Educator.find_by (person_id: @person_id) elsif / student / = ~ @security_roles @user = Student.find_by (person_id: @person_id) End end df authentication_jeter (user name, password) fetch_user_data (username, password) on assign_user sessi [: user_id] = @ user.id redir...

math - sine wave drawing using JavaScript -

I am working on creating a simple ice simulation, but I have been very unsuccessful on mathematics. Basically, when a snowflake is started, this position is set somewhere on the STVG canvas. Then from there, it falls straight down, it should be a simulation of a sine wave (x coordinate should grow like a sine wave) I have not triggered from last year, so I'm a little confused . Math.sin () takes radians, which I believe, then multiply by 180, then divide Pi to convert from degree? Let's say X Snow is the current X position, and the width is the width of the canvas. x + = (sin ((x / width) * (180 / Math.PI))) * width) this works , But it's everywhere. I am doing what I am doing, it is a vague idea, but I can not seem to push mathematics into the code from my mind. What am I doing wrong? should be: x + = A * Math. Sin (F * (y / height) * 2 * Math.PI); Where A is the dimension, that is how many pixels you want that you move the layer left and r...

In OCaml, why is there an auxiliary function in Core's List.find? -

In the core, List.find is defined using an auxiliary function, just like That's the following: Let's find l ~ f = REC find_x = function | [] - & gt; None. | HD :: TL - & gt; If FHD is available in some HD / Other Finder_exto then it can be defined directly For example: R Rick Mill l ~ f = Match with L | [] - & gt; None. | HD :: TL - & gt; If FHD then get some HD and TL what list.find ? In this case, there is an advantage in using a helpful function to define a function like It does not change a lot because both functions are tail-recursive, but still, the answer to your question is: Calling Find Two arguments need to be passed Calling find_aux is required to pass an argument Passing logic is not free: they stack Take the position, limit the maximum recursive depth if the function is not tail-recursive, and they take time to set up. This is a trade-off: in the core version, one must be allocated to share the permanent value name (c...

ios - first of 3 segments of UISegmentedControl to take half of width -

Through the storyboard, there is a way to set up my UIEGanded control so that the segment FIRST, SECOND, THIRD: FIRST ALWAYS In the ratio of the size of the material in relation to the second and the third one in the second? I can do this easily if I can add UIViewViews inside my UISegmentedControl but I can not. I should know that: - (zero) Something like setweeds will result in - (zero) viewwebweeper; {Float First Wide = self.view.frame.size.width / 2; [Self. Segment control control set: First time for Segment atindex: 0]; // should automatically change others} I think you leave the segmented view completely and instead do this with UIViews so that you complete the auto layout Power to use UISegmentedControl Styling is a bit of the remainder of the days that was to deal with only one screen size.

javascript - Animate div on hover and mouseleave with delay -

I have a blue diva, which should be animated on the hover on the green box. Place the cursor on a green box for a long time, the blue divis spreads when you move the cursor away, the blue color goes back to its original size. But if you move the mouse quickly to a green color, then nothing should be done. This part of this behavior is really my question, how to solve it? $ ('# c'). Hover (function () ($ ('# nav'). Delay (150). ({'Top': '- 10px', 'left': '- = 10px', 'width': '+ = 20px' 'Height': '+ = 20px', 'background-color': 'orange (' at the top: '+ = 0px', 'left') '}, {duration: 200});}, function () { Stop (true). (150): '+ = 0px', 'width': '- = 0px', 'height': '- = 0px', 'background-color': $ ('# NAV'). 'Blue'}, {duration: 200});}); Chetan ({'top': '+ = 10px', 'left': ...

ios - How to draw an open ended triangle with a specific angle in an UIView? -

Image
I have been stumped here and need some help with it. For testing purposes I have a UIView which I I draw through drawRect (code below). I am able to draw a circle with a specific angle, but it is full and closed. I need to be open and stroke I am currently using UIBezierPath but is there a better way to do this? I can attract the open android triangle as I want in UIBezierPath but I can not specify the angle I want (code below as well). Any assistance with this will be greatly appreciated. Thanks The picture below will look like how I like it when I draw it with a specific angle #import" AngleView.h "#define DEGREES_TO_RADIANS (degrees) ((M_PI * degrees) / 180) @ Implementation AngleView - (zero) drawRect: (CGRect) Rect {UIBezierPath * aPath = [UIBezierPath bezierPathWithArcCenter: CGPointZero Radius: 50 startAngle: 0 endAngle: DEGREES_TO_RADIANS (45) clockwise: NO]; [Fill epath]; .} @end And here I can draw it without a specific angle. UIBezierPath * bezier...

ajax - Saving canvas to file on server with PHP -

I do not have much experience in PHP, but I'm successful by combining some examples to create it. I just want to save the image of a canvas element to a file on the server, now a PNA has been created with 0 bytes, so I'm almost there. I was suggested to try another solution from a different thread, though unfortunately, this is the whole error (a PNG file 0 bytes) to me. Here is the complete index. FPP code: & lt ;; Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Meta name = "description" content = "" & gt; & Lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1" & gt; & Lt; Title & gt; Fingerprint Test & lt; / Title & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; ...

c# - Connection string not being read from App.config in project -

I am using an abstract class to get the connection string from my App.config file. However the connection comes with the app instead of the string ... {data source =. \ SQLEXPRESS; Integrated Security = SSPI; Attach DB Filename = | Data directory ASPANDDB.MDF; User instance = true} I do not know where this connection string came from. I do not have SQL Express installed I know that proper app.config can not be used because I added a dummy connection string called foo and when I move through debugging instead of two If I pick up, then only one connection string is raised. It seems that the app is getting a connection string from another app.config! Here's my class using the system; Using System.configuration; Namespace MyApiUpdater.Data {Public abstract class ConnectionAccess {secure string ConnectionString {get {return ConfigurationManager.ConnectionStrings ["MyDatabase"]. ConnectionString; }}}} And here my app Config file is & lt ;? Xml version...

Angular UI State name causing '$stateNotFound` error -

So I used to have my AngularUI state views cordless by using the following code $ stateProvider State ('dash.landing', {url: '/', templateUrl: '/partials/backup/dash/landing.html', Controller: 'Landing Controller'}) .state ('dash.order', {url: / 'Overview', template url: '/ particle / backup / dig / order / index html', controller: 'order controller'}) .state ('dash.order.overview', {url: '/ overview', templateUrl : '/partials/backup/dash/order/overview.html', Controller: 'Overview Controller'}) .state ('dash.order.email-accounts', {url:' / email-accounts ', TemplateUrl:' / partials / backup / dash / order / email-accounts.html '}) .state (' dash.order.alerts ', {url:' / alerts ', templateUrl:' / partials / backup / dash /order/alerts.html '}); And for some reasons my thoughts were not being translated and I was getting $ stateNotFou...

c# - How to use different Application Settings for different build configurations? -

Image
At the top of the application-tab (red) of project properties, there are 2 graded dropdown boxes (green), which I use Would like to i output based on existing build configuration Want to change the type. To use the console for debug output, when I want to make an debug-build project to be a console app when I release-build I should have this project a Windows application . How can I enable a grade out box? Note : This is a C # -app You can not apply Visual Studio to enable options, but you can manually get effects by editing the csproj file. MSBuild is really powerful and the Visual Studio goes to hide its functionality so that it's easy for basic use cases. To edit the Csproj file, right-click on the project and select the Load Project, right-click and select Edit. A standard CSPORG for the console app will appear at the top such a way & Lt; PropertyGroup & gt; & Lt; Configuration Status = "'$ (Configuration)' == ''...

get - How to have a class use a default getter/setter when referenced directly in C#? -

मान लें कि मेरे पास एक वर्ग है class SecretInt {private int secret = 1; } मैं ऐसा कैसे कर सकता हूं। गुप्त एक = नया गुप्तचर (); SecretInt b = नया गुप्तइंट (); कंसोल। लिखें (ए + बी); क्या आउटपुट 2 होगा? क्या ऐसा कुछ है कक्षा गुप्तइंत () {int secret = 1; {वापसी रहस्य मिल; } सेट {secret = value; }} इसलिए वर्ग के प्रत्यक्ष संदर्भ में कक्षाओं के बजाय गेटर्स और सेटर्स का उपयोग किया जाएगा? आप इसे दो चरणों में कर सकते हैं। अपनी कक्षा के लिए + operator ओवरलोड करें सार्वजनिक स्थिर गुप्तचर ऑपरेटर + (गुप्तइंट एस 1, सीक्रेट इंट एस 2) {var s = नया गुप्तइंट (); S.secret = s1.secret + s2.secret; वापसी एस; } फिर ओवरराइड toString विधि: सार्वजनिक ओवरराइड स्ट्रिंग ToString () {यह लौटें .secret.ToString (); } अधिक जानकारी के लिए एक नज़र डालें।

javascript - Set max date from date1 to date2 up to 365 days -

मेरे पास 2 jQuery के दिनांक पिकर हैं: & lt; p & gt; & lt; label & gt; प्रारंभ दिनांक & lt; / लेबल & gt; & Lt; / p & gt; & lt; p & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" id = "date1" name = "date1" class = "तिथि-चुनना छोटे इनपुट आवश्यक" / & gt; & Lt; / p & gt; & Lt; p & gt; & lt; लेबल & gt; समाप्ति तिथि: & lt; / लेबल & gt; & Lt; / p & gt; & lt; p & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" id = "date2" नाम = "दिनांक 2" वर्ग = "तिथि-चुनना छोटे इनपुट की आवश्यकता" / & gt; * & lt; / p & gt; & Lt; p & gt; & lt; लेबल & gt; कुल अवधि: & lt; / लेबल & gt; & Lt; / p & gt; & lt; p & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" id = "कुल_Period" name = "Total_Period" वर्ग = "smallInput आवश्यक" / & gt; * & Lt; / p & gt; मुझे निम...

Building Docker Images with Drone.io -

I am running my own example in AWS and I want to make it a dock image and put it in my repos . The drone runs its build environment in a Docker Container, so I basically want to make Docker images from inside a Docker Container. I found and saw that you can mount the docker socket. How can I do this with a drone? Docker Run-Write-V / / / / / docker sock: /var/run/docker.sock mycompany / buildimage Then I Can I run the Docker Build inside the container or do you know about any other CI tool, which I can run my custom script and make Docker images. Answer is out of date, please check the solution of @ Brade below, Use as context Install your doc to client in your mycompany / buildimage Curl https://get.docker.io/builds/Linux/x86_64/docker-latest-o/usr/ local / bin / donor chmod + x / usr / local / bin / docker Then you can run Docker Build command to use the Dockers host environment $ docker -H unix: // / var / run / doc Ker.sock build To make it ea...

With Drupal 7 tokens, how do I get the path from a custom link field? -

This should be trivial, but for my life, I can not understand how to get the URL / path with token I am using the Display Suite module of the Link field and want to create the entire teaser of the node link of the url specified in a link field. Therefore, in the custom wrapper GUI for node display type, I add "Link as add link" and add this token: [node: field-goto-link ] This gives me a hyperlink, so I thought I would do: [node: field-goto-link: url] ... but this is not a valid token. So what are the sub-pieces of the links? By ensuring the tokens that are not visible in your list are not available, access to field link URLs Be sure to enable the unit token to receive. Token in my case [node: field-link: url]

node.js - Bootstrap carousel with transition background displacement -

When the slide transitions, background image is located below the carousel before going back to the correct position on each transition on every infection is (click or wait time) has been showing a GIF that is what happens I've looked through some of the same questions (all around). The only one that seems to be the same is the issue, but the solution is not applicable in my situation. Here's the code, it's mostly some HTML in Z and it happens here. Was Your div position: relative . Bootstrap uses position: full to perform the transition. div.item (style = "background: url (http://p1.pichost.me/640/ 25 / 1477731.jpg) no-repeat; background-size: cover, width : 900; height: 400; position: relative; ') see

java - ignore interface abstract method to be optimized in Proguard? -

I have a class customistener that is given as below: public interface CustomList {public abstract zero abd (Arrayist & lt; custom object & gt; list); } This class is in my library and when I created it with Maven and Progord, this method has been customized as the normal alt type type below. How can I do it? Am I Public Interface CustomListener {Public abstract zero abs (error list); } Normal signature archive in Java compiler signature Does. The Java Virtual Machine ignores these attributes, so the progesterone removes them by default, you can keep them if necessary, e.g. For reflection or processing libraries: - contractor signature

node.js - Web Scrape Meteor Pages -

I'm trying to write an application that snaps a meteor's webpage, it is not difficult because the meteor webpage is full initially Well presented in the form of javascript. Maybe there is no way to present the page with scraper in some way? Maybe it is going to do with the node, if it helps. Thanks You can use fastenomes to render webpages This is an example, specially designed for meteor webpages, (from sparrable) to capture your HTML: var fs = require ('fs'); Var requires child_process = ('child_process'); Console.log ('loading a web page'); Var page = requirement ('webpage'). Create (); Page.open ("http: // localhost: 3000", function (position) {}); Var i = 0; SetInterval (function () {var ready = page.evaluate (function ()} (If (type of meteorite! == 'undefined' & amp; amp; amp; amp; amp; amp; amp; amp; typeof (Meteor. Status!) == 'Undefined' & amp; amp; amp; & amp; amp; Meteor.Status () ....

jsf - getselectednode from another bean (primefaces) -

I have a managed node of nick and other managed bean, where I would like to get from selectNode and getType execute some code But the problem is that I can not get the reason for the selected node every time: java.lang.NullPointerException: javax.faces.FacesException: # {dimMan.makeDim ()} : Java.lang.NullPointerException And this is my two managed wing: @ManagedBean @ViewScoped public class TreeBean applies Serializable {Personal Static Final L Sector serial VERSIONUID = 2417620239014385855 L; Private triode route; Private triode selected node; ..... And secondly, where I would like to test the type of selected node: @ManagedBean (name = "hotman") @ Session-scocked public square DimenssionManaged {@EJB DimensionDaoRemote dimService; @Internet TreeBean Tree selected; Select string; Receive public trebrainTree selected () {Return tree selected; } Selected public zero set (selected tree tree) {this.tree selection = tree selected; } Public Zero MakeDIM () {Sys...

networkx - Iterating through and changing nested list entries in Python -

Everyone is writing a simple function in Python 2.7, which is to test using the Networks 1.9 module My graph algorithm implementation works correctly. For this, I have a list, Divix, in which there is a list for each block in the division of lists, which gives information about the edges of each node in the classes in the partition. Take a swan: Block in the list block: block no = p.index (block) dvecs [blockNo] = [[-1] * numBlocks] * lane for node in block: node = block for other.index (node) p P: Other block nozz = P.index (otherBlock) dvecs [blockNo] [nodeNo] [otherBlockNo] = len (set (nx.neighbors (G, node)) intersection (set (other block)) The problem that comes to me That is, in the last row of the nested loop, the line begins with DVC [block non ...], according to the debugger, each entry from the center depth list (one node specified by the node specified in the index) interval For each recurrence of the loop, it is being updated with the same value. In other ...

xml - Android Custom AlertDialog not drawn correctly -

Image
The problem I'm trying to optimize as an AlertDialog is that I do not know the black lines How to get rid of what appears above my first text view and editing text (above the gray button areas). Here's my XML. What am I missing? & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: android = "Http://schemaskandroidkcom/apk/res/android" android: orientation = "vertical" android: background = "@ color / butGreyBack" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" & gt; & Lt; TextView android: id = "@ + id / TV_TITLE" Android: Layout_width = "Wrap_content" Android: layout_height = "0dp" Android: Layout_gravity = "center" Android: layout_weight = "30" android: text = "" android: background = "# 00000000" android: text collar = "@ android: color / white...

php - Send all values from a combobox to an array variable through post method -

I want to send all values ​​from a combo box inside a php into a php $ _POST variable. Notice: I do not have to send the selected values, but nothing to choose from is nothing. My attempt was to do it (it is not in the right way, but I think it is closed): HTML code: & lt; Form action = "method =" post "name =" form "id =" list2 "& gt; Select multiple sizes =" 8 "style =" width: 280 "& gt; & lt; option value =" aline Alternate Chestel & lt; / option & gt; Option value = "Bruno.Freitas" name = "user []" & gt; Bruno Sosa Phatas & lt; / Option & gt; & lt; / select & gt; & lt; input type = "submit" name = "submit" value = "send" /> PHP code: if (isset ($ _ POST ['submit']) {$ $ _POST resonance [user] [ 0]. ''. $ _ Post ['Usage Expected results: aline.chastel bruno.freitas My work: ...

Insert String in Python SQLite Statement -

I am trying to insert a string into a SQLite selection statement in Python. When I try this code: cur.execute ("SELECT * FROM DB where employee name = '?'", (EmpNum,)) I get this error: sqlite3. Programming Error: Supply of wrong number of binary. Current statement uses 0, and 1 is supplied there. When I try this code: cur.execute ("SELECT * FROM DB where employee Num = '", I get this error: Type error: the function takes up to 2 arguments (3 given) Code> How do I ask this string? Sorry I'm new to Python Any help would be appreciated! "post-text" itemprop = "text"> The string with commas only works with print . Instead try this: cur.execute ("select * FROM DB where employee name = '" + empNum + "'")

ant - Checking inputs before running dependent tasks -

I have an ant build script that I need to compile part of my project (this is included in the creation of a third party I use the system for javascript libraries). I want to wrap the griddle around this, so I have imported ant build, and I can successfully implement ant targets through Grad. I have also added the input and output of the target and input, so that if they do not need they will not work, they work on ant targets - they mostly import configuration and settings Do this through dependence on a init , which takes approximately 4-5 seconds to build runs Any suggestions? Example the built-in build script ( build Xml ): & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Project name = "MyOffix" default = "build" & gt; & Lt; Target name = "init" /> & Lt; Target name = "build" dependent = "init" & gt; & Lt; Echo message = "hello" file = ...

asp.net - change control outside UpdatePanel -

In short: I want to enable a button outside UpdatePanel when I click on a button Click UpdatePanel inside Enables the Problem: But the tag i and ASP: localization is not visible in the code provided Click the button UpdatePanel updPnlOfferings Description: I button inside a DataList UpdatePanel for each item List of which is included in the removal The Delete button is firing an event on the server that removes the record and disables one button (such as out of UpdatePanel. As I have suggested that I have the UpdatePanel > & lt; asp: UpdatePanel ID = "updPnlCourse" runat = "server" UpdateMode = "conditional" & gt; & lt; ContentTemplate & gt; & lt; asp: LinkButton ID = "lnkDeleteCourseDetails" runat = "server" onclick = "lnkDeleteCourseDetails_Click" & gt; & lt; i class = "icon-removal sign" & gt; & lt; / i & gt; & lt; asp: localization ID = ...

javascript - How to Jasmine test code within angular module run block -

I would like to test Jasmine that welcome.go has been called. Welcome to an Angular Service angular.module ('welcome', []) .Run (function (welcome) {Welcome.go ();}); This is my test so far: Description ('module: welcome', function () {first (module ('welcome')); (Welcome, 'Go');})); It should call (welcome.go), function () (hopefully (welcome.go)) (hopefully you are welcome. ToHaveBeenCalled ();});}); Note: Welcome (lowercase w) module Welcome (uppercase w) service Manage to manage. Here is where I came with: 'strict experiment'; Describe ('module: welcome', function () {var is welcome; first each (function () (modules ('welcome', function ($ rendered) {$. Value ('welcome', {go: Jasmine.createSpy ('Go')};}); Injection (_Welcome_) {Welcome = _Welcome_;})}) ('module should call welcome.go on run', function () {Hope (Welcome .go) ToHaveBeen Callalled ();});});

python - When using an event in Tkinter, how can you pass in other variables to the event function? -

इस सवाल का पहले से ही एक उत्तर है: 6 उत्तर इस उदाहरण में, कि मैं से उपयोग किया जाता है, आप फ़ंक्शन कॉलबैक के लिए अधिक चर में कैसे पारित कर सकते हैं मान लीजिए कि आप उस डिक्ट में पारित करना चाहते थे जिसे आपने बनाया और उस शब्द का इस्तेमाल किया, आप वैश्विक चर को बिना कॉल कैसे कर सकते हैं। Tkinter import * root = Tk () def callback (event) : Print "clicked at", event.x, event.y फ्रेम = फ़्रेम (रूट, चौड़ाई = 100, ऊंचाई = 100) फ्रेम.बिंद ("& lt; बटन-1 & gt;", कॉलबैक) frame.pack () रूट। मेनब्लूप () न्यूबेस में, कुछ अजीब शब्द-कथन हो सकते हैं, स्पष्टीकरण मांगने में संकोच न करें। यहां दो संभावित तरीके हैं। आप अपने 'कॉलबैक' फ़ंक्शन को एक वर्ग में रख सकते हैं, और स्व-परिभाषित चर में पास करने के लिए स्वयं का उपयोग कर सकते हैं आप अपने सभी चर को अन्य मॉड्यूल फ़ाइल में सेट कर सकते हैं और उसे इस फ़ाइल में आयात कर सकते हैं। चूंकि किसी अन्य फ़ाइल के चर को इस नेमस्पेस में आयात किया गया है, इसलिए आप उन्हें 'कॉलबैक' फ़ंक्शन में बिना गुजर ...

c# - RedirectToRoute causes redirect loop -

सार्वजनिक कार्यवाही लॉगआउट () {FormsAuthentication.SignOut (); रिडायरेक्ट रीरो ("होम") लौटें; } मुझे उम्मीद है कि इस क्रिया को उपयोगकर्ता को होमपेज पर पुनर्निर्देशित करने के बजाय, एक रीडायरेक्ट लूप होता है (क्रोम के अनुसार)। उपरोक्त कार्रवाई एक नियंत्रक "व्यवस्थापक" क्षेत्र में जहां "होम" मार्ग को डिफ़ॉल्ट क्षेत्र के लिए परिभाषित किया गया है - मुझे यह संदेहास्पद है। यहां अच्छे उपाय के लिए मार्ग है: मार्गों के लिए। मार्गरेट ("होम", "{नियंत्रक} / {action} / {slug}", नया {नियंत्रक = "डाक", कार्रवाई = "सूचकांक", स्लग = यूआरएलपीरामिटर.ऑपरेशनल}, नया [] {" GoBlog.Controllers "}); अपडेट वापसी कथन को निम्न के साथ बदलकर अपेक्षित रूप से कार्य करने के लिए कार्य करेगा: वापसी रीडायरेक्ट टोरो रूट ("होम", (रूटिंगटबल। मार्ग ["होम"] रूट के रूप में)। डीफॉल्ट्स); मुझे यह जानना है कि यह मामला क्यों है। आदर्श रूप से मैं (बोझिल) दूसरा तर्क छोड़ सकता हूँ यह समस्या कॉल Redirec...

ruby on rails - Mongoid sorting on custom method -

I have an object called 'Choice' in my model, which will give the total number of choices for the object. Now I want to sort this model on the basis of overall choice. How can we achieve it in Mongoed? Now this is a problem. You can not do that which mongoid using silent order objects based on their fields Now if you save 'likes' for every object in the field, well, this is straightforward: Model.desc (: like) If not, you have to use it, which is more complicated like this for a simple matter (of my limited perspective), but of course I Your app does not know, so maybe it compensates.

sql server - PHP Mssql multi query in a store procedure -

I have PHP scripts that execute the store process. So far, so good. Now I have a shop that executes two questions within the store process: Remove from EXEC ('db.) .Debo. [Table]') EXEC ('INB IN [ DB] [Table] ([Colonel]) Value (1) ') If I call SP on php, then it only removes the content of the table and The first row does not include the line. (It appears that only the first Exec will be executed) I call the SP as a PP: $ stmt = sqlsrv_query ($ connection, "EXEC my_sp"); ... ($ line = sqlsrv_fetch_array ($ stmt, SQLSRV_FETCH_ASSOC)) {...} Returning is not important to me at this time. I'm just thinking that only the first query is executed Why is it If the SP calls directly to the database then the query will be executed as expected. Is there an error message or something like this? Does anyone know how can I execute "execs" with a single php call to a SP? Thanks for the help! V I think you do not need to write EXEC (DB). [...

kendo-ui grid filter icon not displaying -

The filter is not being displayed in the icon tab. But when I try to click on the last filter options displayed, show the filter icon and what code I have to write .. $ ("# grid"). Kendo Grid ({Data Source: Data Source: DataBound: Function () {updateGridForStage (stage) riskGridTitle ("Topic", Title: "Topic", Width: "40%"},), Height: 'Auto', Scrolling (Field: "status", headline: "status", width: "30%"): [true], true, filterable: object, page qualified: incorrect, column: [{field: "subject", title: {field: "status" }, {Field: "day_open"}, {field: "risk", title: "score", width: "10%"}, {field: "owner", title: "owner", width: "25%"} , Title: " The following Open ", Width:" 15% "}, {field:" Agla_vritt ", titled:" The next review date "width:" 25% "}, {command}]}); ...

Difference between FutureTask and AsyncTask in android -

I know the difference between FutureTask and AsyncTask in Android Want to According to my thinking we can get current status in Futuratsk. Using the Executable Service we can create a pool of parallel processes. I can get the same property using AsyncTask when I want to use the Ascend Task and the use of FutureTasks I have asked a Question but no answer met. Now I think I should change the way my domain web server obtains data. So I think I should use the FutureTask because they have the work IDone () and cancel Please do not allow me to recover data from some web-services. Guides the way. Because the adapter of my text view is very slow. Or just need to cancel the incompatible task I run or replace with it when the user calls w for AsyncTask and when it is in AutoTextview Words will call it three times for waka and wak and waka for one Is it possible to cancel the running work when users will press another text? See my provides callback ( onPreExecute...

node.js - npm unable to install dependencies -

I am trying to install some NPM modules and do not try to install the dependency of the installed module , Npm shows this log: $ sudo npm install -g npm ERR! AddLocal could not be installed NPM ERR! Error: ENOENT, open 'package.json' NMP ERR! If you need help, you can report this * full * log, NPM ERR! NPM and Node versions, including: NPM ERR! & Lt; Http: //github.com/npm/npm/issues> NPM ERR! System Darwin 13.2.0 NMP ERR! Command "node" "/ usr / local / bin / npm" "install" "-g" npm ERR! CWD / user / roemerbakker NPM ERR! Node-v v0.10.26 nmp err! NPM-V 1.4.21 NMP ERR! Path Package Jason NPM ERR! Code ENOENT NPM ERR! Wrong 34 NMR ERR! NPM ERR! Additional logging details can be found in the following: NPM ERR! /Users /roemerbakker/npm-debug.log NMP ERR! The code is not correct 0 $ The command is tried without it but it also does not work. There is no need for this when you npm install & lt; Package Name & gt;...

collections - Router.go() does not trigger rendered -

मान लें कि मेरे पास "home" नामक टेम्पलेट है: & lt; template name = "घर" & gt; & Lt; h1 & gt; हैलो, दुनिया! & Lt; / h1 & gt; & Lt; / टेम्पलेट & gt; और मैं इसे एक गाया हुआ ईवेंट देता हूं: Template.home.rendered = function () {चेतावनी ('हैलो!'); }; और "घर" मार्ग: राउटर.मैप (फ़ंक्शन () {this.route ('home', {path: '/' });}); अब, जब मैं पहली बार पेज को "नमस्ते!" लोड करता हूँ चेतावनी सही ढंग से आती है लेकिन फिर, कोई भी बात नहीं है कि मैं कंसोल में राउटर.गो ('घर') टाइप करता हूं, प्रदान की गई कॉलबैक से चेतावनी अब और ट्रिगर नहीं करता ... मैं हर बार एक रूटर लिखने के बारे में कैसे जाना होगा, जो एक रूटर है .go (), लेकिन टेम्पलेट पूरी तरह से प्रस्तुत किए जाने के बाद, (विशेष रूप से, संग्रह की एक सूची जो भिन्न हो सकती है), जैसा मैं चाहता हूं हर बार संग्रह तत्वों का एक नया सेट करने के लिए jquery लागू होते हैं? अगर आपको सिर्फ jquery को लागू करने की आवश्यकता है तत्वों क...

javascript - Ajax Django Empty List -

I have been stuck with this problem for a few days and there is a problem finding a solution. I have taken a look at Google and a lot of similar questions here, but cant seems to get this work done. The closest I have come to me is that I have now. Actually what I'm trying to do, when a user clicks on checkout, a JavaScript prompt opens and asks to check the item, then another directly, check Asking for the name of the authorized person. & lt; Script & gt; $ (Document) .ready (function () {$ ( 'chkrclass1.') Function (event Click () {var authby; var cause; var chkr = $ ( 'tdata :. Eq (3)' ..) HTML (); if (chkr == "out of stock") {;) EventkpreventDefault (; alert ( "this item went already checked out!")} if (confirm ( "are you sure Want to keep this item checkedout? ") == true) {cause = sign (" Please enter your reason for picking item "); authby = sign (" Please enter who authorized checkout. "); $ A...

p2 - How to initialize the Transport Service in Eclipse UpdateSite -

जब UpdateSite के लोड विधि को प्रारंभ करते हैं, UpdateSite.load (updateSiteURI, (रिपोजिटरीट्रांस्पोर्ट) एजेंट GetService (Transport.SERVICE_NAME), नई NullProgressMonitor ()); तर्क (रिपोजिटरी ट्रांसस्पोर्ट) agent.getService (Transport.SERVICE_NAME) हमेशा रिक्त लौट रहा है। किसी भी तरह से प्राप्त करने के लिए परिवहन सेवा? बंडल org.eclipse.equinox.p2.transport.ecf डिफ़ॉल्ट परिवहन पी 2 के सेवा कार्यान्वयन तो आपको यह सुनिश्चित करने की ज़रूरत है कि आपने अपने आरसीपी / ओएसजीआई रनटाइम में इस बंडल और उसकी निर्भरताओं को शामिल किया है।

ruby - Gem install takes forever -

I am building and installing a local gem. In addition to installing verbose gem, bus sits and just waiting for long. No output When the output occurs, it ends in seconds. A local gem will expect to run quickly, but obviously it is doing something on the network, however, the gem is locally, which takes forever. Any ideas on how it can be fixed? I can do this but I think I have already found the problem. I have to set / unset proxy settings and it seems that RubyGames is using a proxy server, even if I am not using it for example on the home network. As a result, the problem solves the problem. I did not expect that the gem will be used locally and all the dependencies are satisfied. Are there. Since it turns out that RubyGames tries to use the network, there is no error message btw installed without any timeout error or nothing gem error messages. It only takes a very long time and there is no indication that anything is wrong.

ajax - Jquery executes in weird order -

Please refer to this code. I hope this is: Execute the executable which saves two values ​​( latitude and longitude ) Use these values ​​here = var center = new google.maps.LatLng (resplat, resplon); The problem is that the code does not execute in this sequence. It "jumps" on the initial ajax and goes for a second time when it comes back first. This makes me two worthless useless. Can the code explain the logic behind the order being executed? function initialize () {$ .ajax ({type: "GET", url: 'http: // ip-api .com / json', datatype: "Jason", success: Work (resp) {resplat = resp.lat; resplon = resp.lon;}}); // Google has touched its interface to some extent - it asks the API to use that new UI google.maps.visualRefresh = true; Var center = new google.maps.LatLng (resplat, resplon); // These are the options which set the initial zoom level, where the map is centered to start at the world level, and to show the map map var map =...

html5 - how to set the authorization in html email -

I am sending a html email that refers to some pictures on Amazon S3. Images require an authorization in the http header. Specifically they need this: curl-h 'authorization:' How can I provide HTML email to that blank location authority? You can not There is no point in specifying custom HTTP headers for HTML requests. If you were using Browser , you can use JavaScript with XMLHttpRequest to request and then response to data: Can convert URI and use it Image source is not such a choice of HTML formatted e-mail.

html - floating div with same height -

I have floating four divs if the content of the first division is high, then the boundary is not the same in four divisions. But I want to limit the height of the boundary to the extent of long content in four parts. As mentioned in this example, the first device is getting more content, so the height below the boundary is four div. How can I create equal height in four divs for different contents of the div? & lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div & gt; & Lt; Div style = "float: left; width: 24.5%; boundary: 1 px solid;" & Gt; & Lt; Span & gt; This is a trial period & lt; / Span & gt; & Lt; Span & gt; This is a trial period & lt; / Span & gt; & Lt; Span & gt; This is a trial period & lt; / Span & gt; ...

jquery - CSS not working on spritesheet loaded in manifest -

I am loading all my page elements using a manifest in the createjs, even though CSS does not apply to the sprysheesh. // CSS .btn {background-position: -200px 0px; Status: Completed; Width: 100px; Height: 101px; Opacity: 1; Margin-left: 1px; Margin-top: 49px}; // JavaScript appears = [[src: "images / spritesheet.png", id: "spritesheet"}}; Loader = new createjs.LoadQueue (wrong); Loader.loadManifest (revealed); Loader.on ("full", handle complete, this); Function handle full () {var btn = loader.getResult ("spritesheet"); $ (".btn") .andand (_btn)} This works when I load CSS from the image, though I should try something wrong I try some things But still there is a problem. .selection_btn01 {background-image: url (images / spritesheet.png); Background-position: -200px 0px; Status: Completed; Width: 100px; Height: 101px; Opacity: 1; Margin-left: 1px; Margin-top: 49px}; After adding the CSS ({"background-condition": ...

phantomjs - Tests PASS outside Vagrant, FAIL inside Vagrant -

I am running CasperJS scripts on a Mac and under the periodic box. The test succeeds outside the wagrant but not inside it. Why? For reference, I have put the results of the exam at the bottom of this post. Version (in and out of the warranty) Casper: 1.1.0-beta3 Phantom: 1.9.7 OSX: 10.9.4 Elite: 1.3.5 If you need something else to debug, please let me know, I will add: -) test command This is what I am using in the console to run the test. Casey test price_filter.js test script it should be www3.smatch.com Since then it is publicly accessible to work for you too. In fact, the script goes to the 'Lady Exceors' section, which finds a product in the Dome and gets its price. Then it checks that the value of at least one product is high and there is no high priced product after checking the price filter. var x = require ('casper'). SelectXPath; Casper.test.begin ('Maximum Price Filters', Function Suite (Test) {casper.start (...

c++ - What is the most modern way, the most "right" way to iterate through a vector, in c++11 -

Now I am learning C ++ and I am looking at several ways to walk again through a vector. I was thinking, because I want to know it correctly, what is the right approach for nowadays? Depends on the following factors: Is your loop or just inside the elements? Do you almost always like auto (AAA) or almost ever auto (ANA)? For example, if you want a std :: vector & lt; Int & gt; You can do this on the loop on some of the elements of the elements: for (int element: v) {// use element} If you are an AAA person, you would write auto element instead. If you want to save a copy, you want a conference reference: for (int Const & amp; element: v) {// Usage Element} If you are an AAA person, you can replace it with auto const & amp; Element . If you want to modify the values ​​inside the vector, then you want an amended reference: for (int and element: v) {// use Element} Once again, if you prefer AAA, instead of auto & amp; Element I...

jsp - Adf selectonechoice adding item -

I have a list of managed webservice List it Rescheey = new ArrayList & Lt; & Gt; (); 1- How to tie this list with online software? 2- How to manage a managed e-comma page from Need to create a list of selectItem objects. As from the list & lt; SelectItem & gt; MyList = New Array's & lt; & Gt; (); This list can be accessed by and lt; Af: selectItems & gt; Choose an option in . You can do Google to return prices from here -sid

ios - Swift: IBoutlet always returns nil object? -

Image
I have UITablesView with its nib file with custom UItableViewCell function table view (Table View: UITableView !, CellphoneRouthindex Text Index: NSIndexPath!) - & gt; UITableViewCell! {To cell = tableView.dequeueReusableCellWithIdentifier (quoteCellIdentifier, forIndexPath: indexPath) DynamicTableViewCell if (cell == null) {println ( "not started")} println (cell) println (cell.scenarioLabel) return} as cell Console / p & lt; _TtC17Dynamic_Cell_Demo20DynamicTableViewCell: 0xb291a70; BaseClass = UITableViewCell; Frame = (0; 320 44); Layer = & lt; CALayer: 0xb291e40 & gt; & Gt; To be able to: null Custom UITableViewCell class DynamicTableViewCell: UITableViewCell {@IBOutlet bridesmaid scenarioLabel: UILabel @IBOutlet bridesmaid quoteContentLabel: UILabel Connection I think you are not registered in tableview nib, - viewDidLoad Swift: tableView.registerNib (UINib (nibName: "DynamicTableViewCell", Bundle: zer...

cocoa - Swift: Filter a NSSet for class types -

This function to filter NSSet for an array of class types in Objective-C Was: + (NSSet *) Filter SubjectSet: (NSSre *) Classes for Classes: (NSArray *) Class {NSSet * filterSet = [Themes Objects PassingTest: ^ (id obj, BOOL * Stop) {return [include objects: [OBG class]]; }]; Return filter set; } To implement the same function in Swift, I am struggling to find a clean way. This is what I was hoping to do: class func filterSubjectsSet (topics: NSSet, for class classes: [AnyClass]) - & gt; NSSet {set = subjects.objectsPassingTest () (Search (classes, object_getClass ($ 0)) = nil} return set} But I get this error: Type 'AnyObject.Type' does not correspond to the protocol 'Equatable' How should I do this? Find () function is specified as: func find & lt; c : Collections where C. Generator type Element: Equitable> (Domain: C, Value: C. Generator Type Element) -> CIndexType? And in this case your case should be the collection,...

javascript - Looking for if then else pattern with async library -

I'm not a very experienced / elegant programmer. I hope my question comes out. I have used Java / C ++ for most of my life, so my mind is object-oriented. Then I learned the dragon and I enjoyed a very functional mind. Now I'm coming to JS because it's challenging because this function is based (and I like it very much), functional (I have a lot of python [code] etterts with underscores [codes] and asynchronous (this pain it happens). I have a number of back-end sync procedural flows like: if present (user): foo (user) is # OK: add (user ) # User Added Now I have to handle it with the so called callback hell: is present (user, function (userexist) {if (userexist } {FU (user, function (FooResult) {/ * ok * /});} and {add (user, function (addResult) {/ * users Sometimes added controls are nested: check the token, if the token is valid check for the user, if the user exists, So check the valid parameters, then do not check the error on the user in Foo. ?? | | ...