Posts

Showing posts from June, 2012

android - if statement colors in listview -

इस कथन के साथ, सूची दृश्य में डाला, सार्वजनिक दृश्य getView (int pos, बच्चे, ViewGroup पैरेंट देखें) {SharedPreferences prefs = mContext.getSharedPreferences (MY_PREFERENCES, Context.MODE_PRIVATE); स्ट्रिंग ऐनो = प्रीफ़ेक्स .get स्ट्रिंग (एननो, "2014"); स्ट्रिंग मलटाटिया = प्रीफ़्स .get स्ट्रिंग (म्यूटा, "एम"); स्ट्रिंग ferie_1 = prefs.getString (FERIE, "एफ"); स्ट्रिंग par_1 = prefs.getString (PAR, "PAR"); धारक mHolder; लेआउटइनफ्लाटर लेआउटआइफ़्लेटर; // पाठ जिसमें आप "एम" को ढूंढना चाहते हैं यदि (child == null) {layoutInflater = (LayoutInflater) mContext.getSystemService (context.LAYOUT_INFLATER_SERVICE); बच्चा = लेआउटइफलेटर.inफलेट (आर.लेआउट.रो, नल); mHolder = नया होल्डर (); MHolder.txt_notes = (TextView) child.findViewById (R.id.txt_notes); MHolder.txt_mese = (पाठदृश्य) child.findViewById (R.id.txt_mese); MHolder.txt_giorni = (टेक्स्टदृश्य) child.findViewById (R.id.txt_giorni); MHolder.txt_turno = (TextView) child.findViewById (R...

unix - Testing the hostname in a .cshrc -

I would like to fulfill my command .cshrc file on a host basis (.cshrc file is on a disk Which is shared by two different hosts.) Assume that there are two hosts: login1.university.edu and login2.university.edu I try this command Key: if (hostname == 'login1.university.edu')) then from Route R_LIBS_USER /n/Users/me/R.login1 other setenv R_LIBS_USER / n / Users / me / R .login2 "itemprop =" text "> To execute it Batam Toggle the hostname command with and compare the result. if (`hostname` == 'login1.university.edu') then Satellite R_LIBS_USER /n/Users/me/R.login1 and

ios - Dealing with unexpected response content types with AFNetworking / AFHTTPRequestOperation -

I am using AFNetworking to process HTTP requests in my iOS app. I went into a stumbling I can not be sure what the reaction content will be like, but before processing it will have to set up the response serializer. This means that I can request an API, I can expect an image, but there is actually some authentication error, so the server instead returns a JSON-formatted response. Here is my code: AFHTTPRequestOperation * op = [[AFHTTPRequestOperation alloc] initWithRequest: request]; [OPP Set Response Laser: [AFJSNRPpsCensializer Serializer]]; // ??? [op setcompletionBlockWithSuccess: ^ (AFHTTPRequestOperation * Operations, ID response object) {NSDictionary * Result = (NSDictionary *) responseObject; OnSuccess ((NSArray *) results); } Failure: ^ (FHttpOrQuest Operation * Operation, NSERR * Error) {Onfiler (Error); }]; [Op start]; As you can see, I had to set the expected content type contained by setting up the responsiveness serializer to [AFJSONRPSPenceSyriaLizer Serializ...

Difference between _.forEach and _.forOwn in lodash -

एक ऑब्जेक्ट पर फिर से दो तरीकों के बीच अंतर क्या है? अंतर इस बात में निहित है कि अगर जिस संग्रह पर आप फिर से चल रहे हैं वह एक वस्तु है जिसमें एक लंबाई संपत्ति है, फिर _। के लिए () इस पर पुनरावृत्त होगा जैसे कि यह एक सरणी है, जबकि _। ForOwn () एक ऑब्जेक्ट की तरह इसे पुनरावृत्त करेगा। मान लें कि आपके पास वस्तु है: a = {x: 100, y: 200, लंबाई: 2} यदि आप इसे फिर से दोहराते हैं: _। प्रत्येक (ए, फ़ंक्शन (val, key) {console.log ('a [ + कुंजी + '] =' + वैल);}); आपको आउटपुट मिलेगा: एक [0] = अपरिभाषित एक [1] = अपरिभाषित जबकि इसके साथ इसे _ के लिए परोसा जा रहा है () आपको अधिक उचित मिलेगा: a [x] = 100 एक [y] = 200 एक [लंबाई] = 2

html - CSS hover doesn't work -

I am quite new to HTML and CSS and I know that this is probably a very dumb question, but I try I am doing this for a while and solve it and I do not know what is wrong. I want a div to change its backgound color, when the mouse will enter another element which is not related to it (when it is the child of the second component, it works fine) . My HTML: & lt ;; Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "style.css" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; NAV & gt; & Lt; / Neo & gt; & Lt; Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; and CSS: * {margin: 0 pixels; Padding: 0 pixels; } NAV {Width: 100%; Height: 50px; Background color: black; } Div {width: 100%; Height: 40px; Background color: green; Status: Completed; Left: 500 pounds; } Nav: hover divis (...

sql server - powershell sqlbackup and copy file -

I am writing a PS script to back up a database and copy .bak to a different server. However, the backup is being done in asynchronous form. And sometimes it reaches every pre-matureest command I have tried these suggestions but it does not work much. sqlbackup.Wait () ... It looks like what I'm doing (at least on paper) but it's working Does not seem to be. Before the file can be generated now it reaches my copy command to get any idea how to do this work ... here is what I am doing. $ smoBackup = New-item -TypeName Microsoft.SqlServer.Management.Smo.Backup $ smoBackup.Action = "Database" $ smoBackup.BackupSetDescription = + $ dBNAME $ smoBackup.BackupSetName = $ dBNAME + "Backup" $ smoBackup.Database = $ dBNAME $ smoBackup.MediaDescription = "disc" $ smoBackup.Devices.AddDevice ("full backup" $ sourcepath, "file") $ smoBackup.CopyOnly = "true" $ smoBackup.SqlBackup ($ SourceSrv) copy-item-path $ sourcePat...

actionscript 3 - Action Script 3. Platform game physics glitch (gravity) -

When my player touches the floor, he is unable to proceed because he is on the floor and is increasing. I have an agitation in the main category Personal function processation (): zero {if (touching ground) {if (its) is {character.jumpUp (); } If (leftKey) {character.moveLeft (); } if (rightKey) {character.moveRight (); } If (! Left that & amp;; right & amp;; above) {character.dontMove (); }}} Then in the character category you will see this. A public class player spreads onground {public war cannepain: boolean; Public Varun AN: Boolean; Public Wise Judge: Number = 18; Public function player () {addEventListener (Event.ADDED_TO_STAGE, OnAud); } Personal Function OnAd (E: Event): Zero {removeEventListener (Event.ADDED_TO_STAGE, OnAud); } Move Public Function (): Zero {// Decrease VELOCITY xV - = 2; If (xV> -7) {xV = -7; } This.gotoAndStop ("run"); // Add it to MC X position child this.x + = xV; This. ScaleX = -1; CharIsrunning = true; } Public Functio...

javascript - How to convert Date (long type) to the interval (example: 1 year 6 months)? -

Here is my question, I will be long for my date (10024506364) 1 year 3 months ( I want to convert for a long time with round). Is it possible to do this with Date.js ? I can not find any examples how to solve this task. I will see Pillage. var day = moment (1318781876406); Very easy to use and has a ton of other features in it

python - Django 1.6 image upload and media path -

So I have a project on webfaction where I need to create two different environments, one server DNS and one server To static files So when I upload an image from the admin panel, I can see that the image is placed in the root which I define but with the full path. When I return the image in my view, then I have my domain. //////// This generates a broken link - when I go to mydomain.com/uploads/image_name, I can see the image file, even though my link is not in the root_ url Is pointing towards the full path, Can you help me with this? I really do not understand how I can fix this image in my picture & lt; Img src = "{{MEDIA_URL}} {{mymodel.my_image}}" alt = "{{name}}" Width = "150" height = "200" /> I understand that there are so many topics here, even though no one can tell me how to "upload" the way to hide or change the root route. Works fine in my admin class movie (models.model): name = models.CharField...

excel vba - Loop finishing with error -

I need to look for each row that contains the "total" phrase, insert rows above and below , Other formats Delete the "Total" phrase from the cell, and the cell adjacent to the same line, and repeat the process for all the other rows in the report. I have developed the macro, once it got it and all changed to "Total", I get run-time error '91': Object variable or block variable is not set is. I would like to eliminate this error without ending the loop. It has to be executed on many sheets. Here is the code of the flesh: 'EmployersCommissionWorldWorksonTab Macro Dim Call the range, call range, string range with the range as the first grade ("D3: D 3000") range ("D3"). Set with SetCell = Range ("D1: D3000"). (What: = "total", later: = last one, LookIn: = xlValues, LookAt: = xlPart, _SearchOrder: = xlByRows, SearchDirection: = xlNext, MatchCase: = False, SearchFormat: = False) If not found Call an...

if I pass a file as positional parameter, bash complain when I put it in a variable -

It is quite strange: I have a function that takes a file path, read the last line and return values. Now, I would like to call this function with another script; So I just cross the path of the file, and get $ 1 in the function, so I can use it. But it seems that for some reason, Bash does not like the idea of ​​specifying me $ 1 variable printval () {textfile = $ 1 Result = $ (tail N $ $ text file) resonance results $ When do I call function : printval "/ user / admin / test.txt" Now, no matter how I pass the file path (I pass it a trough Can be either variable or string), and no matter if I use $ 1 in the function, or if I explicitly write the file, the result is that I "allow" Rejected "is saying error. Strangely enough, if I function am Printvl () {result = $ (tail-N + 1 "/ user / admin / test.txt") echo The result $ I have not found any errors, and the file has been read correctly. What am I doing wrong? I just want ...

How to upload an HTML file into python? -

I am trying to write a python program that can load a set of HTML files, some variables Find files for and then remove the variable in JSN. Does anyone know where to start from, which commands or modules to import? You may need it to help parsing HTML The built-in python can open the HTML file.

jquery - How To Get ASP.NET MVC Form To do same as button submit -

मेरे पास एक साधारण एएसपी.नेट एमवीसी फॉर्म है जिसके पास कोड निम्न है: @ उपयोग (एचटीएमएल.बीजिनफॉर्म (रिक्त, रिक्त, फॉर्ममैथ.पस्ट, नया {action = "https://secure.authorize.net/gateway/transact.dll", आईडी = "रजिस्टर फॉर्मिड"}}) {@Html छिपे हुए (एक = & gt; a.RegisterUserInfoLoggedIn.AttendeesId) ... मुझे एक JQuery AJAX कॉल मिल गया है और अगर JQuery सफल है, तो मैं अपना फॉर्म पोस्ट करने के लिए चाहता हूं आगे की प्रक्रिया के लिए एक्शन यूआरएल। मेरा JQuery निम्न की तरह दिखता है, लेकिन जो मुझे पता नहीं है वह क्या है जो मेरी JQuery अजाक्स सफलता की घटना में डालता है, जैसे कि मैं वापस कार्रवाई यूआरएल पर पोस्ट करता हूं, पृष्ठ ठीक से जवाब देता है और मुझे अपना नया पृष्ठ दिखाता है सफलता: फ़ंक्शन (डेटा) {यदि (दान राशि & gt; 0.00) {$ .post ("https://secure.authorize.net/gateway/transact.dll", {x_login: 'xxx', x_amount: 1 9। 9 9, x_description: 'नमूना लेनदेन', ...}, फ़ंक्शन (डेटाकैक्स) {this.submit ();}); आप अपने फ़ॉर्म को का उपयोग कर...

c++ - Remove/ignore everything except characters in a Cstring -

I'm trying to read about 100 characters in some text and then it's empty space, numbers, special characters I'm trying to hide from the bar. , e.t.c. I was thinking about ways to go about doing this, but I think I should forget about the seastring I know, so should I forget. I was originally trying to settle in the original characters and trying to copy them into a new string, but 1. I do not know how to write it, so my compiler does not hate me 2. I I'm pretty sure that I do not want to have an empty place in the new, stripped string (I'm pretty sure my code is due to this so far, if it also works). char * userText = ""; Char * justCharTxt; Cout & lt; & Lt; "Enter text:" & lt; & Lt; Endl; Cin.getline (user text, STRING_SIZE); For (Int i = 0; I & lt; strlen (Usertext); I ++) {if (((Usertext [ii]> = 'A') & amp; (Usertext [i] & lt ; = 'Z')) || ((Usertext [ii]> = 'A') & amp; amp; (...

javascript - Cannot reference global function in nested describe function in Jasmine -

I am TDD for a JavaScript app with Jasmine. For some reason I can not reference the declared work in the source portion of the SpecRunner.html file if it is nested inside two functions. Here is the code: ("DidiButton", function () {var didiButtonDiv = document.createElement ("div"); didiButtonDiv.id = "DidiButtonDiv"; ("It should throw an undefined alimentary air if it did not return a DOM", function () {try {var didi button = createDidiButton ();} catches (e) {hope (e.name) .toqual ("undefinedElementError" ("Link functions", function () {var didiButton = createDidiButton (didiButtonDiv); var link = "http: // www" ("link functions", "function ()" ("must be able to associate themselves with a DOM"); .google.com "; (" should be able to set a link ", function () {didiButton.setLink (link);}); ("it should be able to set the link" function () {hope (link) .to...

How does angularJs keep filter so that it is still enable when history back -

Just like an example of angularJs :, the filter can not be placed in angular j, so after receiving filter results , And then click one of the mobile to see in detail and then click behind the browser, the filter will disappear. I am thinking, is there any way we can use to keep the filter? Thank you Jhang, but it seems this is a jQuery method I have found solution using angular JS. Simply put, when you type the search string, you archive the filter in $ Root Scope, and then set it back while loading the view. See the code below: // Controller function xxxController ($ rootScope, $ scope) {// set saved search string back model $ scope.SearchModel = $ rootScope.searchString; $ Scope.saveSearchString () = function () {$ rootScope.searchString = $ scope.SearchModel; } See // & lt; Input type = "text" ng-change = "savesearchstring ()" ng-model = "SearchModel" & gt; Perhaps you want to empty the saved search string when you click on some l...

jquery - Validating Contact Number in javascript -

I have a text box and my form is like this: & lt ; Input type = "text" name = "ncctact" placeholder = "new contact number" id = "txtNewContact" /> & Lt; Div id = "divCheckContact" & gt; Now on every key press of a key in the NCCTact, I have to check whether the value entered is a number or not, and this is also 10 digit number. And display the message in Disease P> How to do this Please help. You do this by doing a pattern and title To: & lt; Input type = "text" pattern = "\ d {10}" title = "type 10 points please" /> will check the number of the above 10 digits and if this is not valid then the title will be displayed. Note: This is part of html5 spec. IE 9 will not work for and below. You can also do this in pure JS: var elem = document.getElementById ('txtNewContact'); Elem.onkeydown = function () {if /! D {10} /. Test (elem.value)) {Wa...

mysql - Why doesnt this SQL trigger work? Selecting Sum and updating -

USE 'DEPT`; DELIMITER $$ create = DEFINER = `Route` @ localhost` trigger 'R3`; Announce the pay difference after updating on' Employee 'for everyday; SET pay = (Select the SUM (pay) from the employee salary, where employee employee, DO = new employee. Employee); Updated department set Total_sal = salary Where Dno = NEW.Dno; END The salary is zero and it is throwing an error because it can not be. The error was due to the conflict in the column name with the variable name salary . It will always be a good practice to use the relevant name, but the name of the column will not be named. And you need to make some logical changes in updating the total salary in the department table. You are only updating the total salary of the department while adding new employees. You should also change which will be the same from the department which has been transferred to this employee. The trigger should work after a change: drop trigger if present then `R3`; DE...

c function calling error in printf() -

contains # lt; Stdio.h & gt; #to & lt include, conio.h & gt; Int Adder (Int, Int); Zero main () {int a, b; Printf ("Enter"); scanf ("% d% d", & amp; one, and b); Connector (A, B); Printf ("zodiac is% d", adder); getch (); } Int adder (int x, int y) {returns x + y; } This program is not working. I think the code is right. Can you tell the error? adder is a function, you printf It should have a return value. And as @ Jonathan Leffler said, if you want to make sure that the output is displayed on time, then adding a new line would be better. Then, change adder (A, B); Printf ("zodiac is% d", adder); to: Full results = adder (A, B); Printf ("zodiac is% d \ n", the result); or: printf ("zodiac is% d \ n", adder (A, B));

linux - Bash script that will execute a program over all files in a directory -

After typing "itemprop =" text "> A bash script will write more than all files in the directory 'allfiles' program 'main'. The main execution is I. Results are then directed to the 'output.dat' file Whenever I run the Bash script, I get "./main: No such file or directory". Bash script, main and 'All files' directory are all in '/ home / directory /' I am not sure why I am getting this error, or if I am correctly writing the Bash script Any help is greatly appreciated. For file in / home / directory / allfiles / * #! / bin / bash ./main $ file & gt; & Gt; Edit.dat done Edit: Must be clear that 'main' is a performance one text made after a makefile If you are not in the / home / directory while running the script, then this key will not be found! & Gt; Try the party for # / bin / into / home / directory / allfiles / * / home / directory / main $ file & gt; Output Deleted Ad...

javascript - addClass() based on the presence of another class? -

I am working on an ecommerce store product page and an "in-stock" graphic and an "out-of- Stock "There are some limitations in the graphic platform but there is a setting to show the stock graphic, but there is no one in the stock What I want to do, this page has a stock graphic on the hardcode by default . Like this: & lt; Div class = "instock" & gt; & Lt; / Div & gt; Below CSS: .inStock {width: 143px; Height: 40px; Background: URL ('../ product_images / uploaded_images / in-stock .jpg'); Margin-left: 60%; Margin-Top: 5%; Status: Completed; } When a product exits from the stock, the platform backend automatically adds the page that appears in that page: & Lt; Div class = "currentlySoldOut" & gt; & Lt; P & gt; & Lt; Span lang = "en" & gt; Sorry, but this item is currently unavailable. & Lt; / Span & gt; & Lt; / P & gt; & Lt; / Div & gt; Line When...

google api - BLOGGER: How to insert data from all posts of a blog -

I have struggled with it for hours and very clearly I'm totally new to the API. I activated Blogger and generated an API key. I then used the following code to get the posts (with my own API-key) as the key I generated: Get https://www.googleapis.com/blogger/v3/blogs/2399953/posts?key=YOUR-API-KEY a) This is absolutely on my site Not even visible. b) Blog posts are currently marked in my site as follows: & lt; Section & gt; & Lt; H2 & gt; Blog TITLE & lt; / H2 & gt; & Lt; Date & gt; The date of the post goes here & lt; / Date & gt; & Lt; P & gt; Blog content here & lt; / P & gt; & Lt; / Section & gt; How can I display positions to add this markup? I hope there will be a ton of tutorials for this, but I am unable to find a brief enough. Because it was the public data I wanted to load the following simplexml_load_file: . I used the following tutorial:

Spring boot does not load beans from groovy bean builder -

I am trying to create a simple springboot program that uses the Groove Bean Builder, but I miss something saying: @EnableAutoConfiguration class MyApplication {public static void main (string [] Arges) {logger.info "Meraalp is starting ..." object [] source = [MyApplication. class, new Wargpath Resources ( "Bibi. groovy")] SpringApplication.run (source, Arges)}} / / MyController.groovy @RestController class MyController {ConfigObject configObject MyService myService @RequestMapping ( "/ home") scheme Ring Home () {myService.getSomeData ()}} // src / main / resources / BB. Groovy beans = {myService (Maiswaiv) {url = "http://www.spring.io"} configObject (ConfigObject) { New ConfigSlurper () Parse ( "Config.groovy")} myController (MyController) {configObject = ref ( 'configObject') myService = ref ( 'myService')}} Springbut starts fine, But I do not see any effort (system out) in the startup to load the beans from...

c# - Extracting field from an XElement -

Image
I have the following information in the XML file () taken from a RestSharp response, and I only care about 5 ID elements I am I want to get these IDs in an array or list. How can I remove them Am I My attempt has been done so far .. var root = XElement.Parse (response.Content); Var number_projects_str = Root. First unbreakable value; Int number_of_project = -1; If (int32.TryParse (number_projects_str, number number_of_projects)) {// size_of_product // ...} You can use the extension method to select the first cell from each line (which is the ID containing the ID): var Ids = root.XPathSelectElements (" / results / Results / rows / row / cell [1] "). Select (o = & gt; (string) o) .oir ();

javascript - How do I append text to my rect in d3? -

This is my code, when I inspect the element but it is not showing, then adding text Miscellaneous data = [0, 1, 2]; Var width = 100; Var Height = 100; Var canvas = D 3.select ("body"). Append ("SVG") .attr ("height", 500) .attr ("width", 500) .attr ("fill", "red") .append "g"); Var someData = canvas.selectAll ("rect"). .attr ("fill", "red") .attr ("conversion" , Function (d) {return "translation (" + height + d + ", 0)";}); Some data Append ("text") .attr ("transform", function (d) {return "translation (" + height * d + ", 0)";}) .attr ("font-size", "2em"). Attr ("color", "black") .text (function (d) {return d;}); What did I do? Problems with your code: a & lt; rectangle & gt; can not go inside The top level is filled with group color, hides ev...

Scala macro to print code? -

I want to do something like this: assuming DIF [A] (condition: = & Gt; boolean) (F: = & gt; A): A = {requirement (condition, / * print source-code condition * /) f} sample usage: def fib (n: int) = n match (yes, yes i know that this is not a smart matter 0 = & gt; 0 matter 1 = & gt; 1 case i = & gt; For example, if you call Phib (-20), then I believe that (i & gt; 0) {fib (i-1) + fib (i-2)}} , I would like to throw an exception with the message like failure has failed: -20 & gt; 0 or Failure to fail: i & gt; 0 Man, this is one of the basic use cases you use Macro is not how to use macros OK, that's what I thought too. In my other answer to "guinea snippets" I mean, what space 2 does. Or, you can represent an arbitrary representation, such as. I thought I would write your example in REPL in two instances. What can be easier? Of course, it is easy People (for example, pallps, etc.) who is Voices PALP...

ios - How to know the previous language used by device -

How can you know the previous language used by the device? Depending on whether the previous and present language is not so, I will update the DB and Vice President Actually if the past and present are not the same, then the table The content must be deleted and updated on the basis of the current language. NSUserDefaults * defs = [NSUserDefaults StandardUserDefaults]; NSERE * languages ​​= [ObjectForchy: defragmented] "Apple language"]; NSString * FavoriteLeg = [languagesObjectIndexX: 0]; Now I suggest that store the current database in your database or NSUser default and check for the current language regularly and match your database. If you have received the change, it means that the existing preferredLang is the current language and the previous database that you can get from your database or NSUser default and whatever you want.

You have an error in your SQL syntax when creating a procedure. MYSQL -

When I try to make a process, I get that error. I do not know whether it has failed and if someone There is a single error in comparison to me, but I make a mistake on the delimiter, and I think I have his right. "There is an error in your SQL syntax, check the manual related to your MySQL server version for the correct syntax for near use ') SELECT SUM (robatori.quantitat_robada) from Robotry WHERE param1 = My question is next: DELIMITER // CREATE PROCEDURE ROBATORY (paragraph 1 at VARARA) SELECT SUM (robatori.quantitat_robada) with robotry WHERE Param1 = jugador_ladre; // DELIMITER; Thank you to all, this is my first question here. : You are missing the length for the input code on VARCHAR Change it like the following: DELIMITER // processing robotir making (at work (255) SELECT SUM (robatori.quantitat_robada) from robotry Where param1 = jugador_ladre; // DELIMITER; As you have the only statement to execute, the BEGIN - END block was optional. ...

ios - How to display images from dropbox in UIImageView -

I am using images in my application to import images from Dropbox; For image dasplay in UIImageView I have the following code UIImageView * imageView = [[UIImageView alloc] initWithFrame: CGRectMake (0, 0, 500, 500)]; Imagaviavkimej = [Uiimage Imagavithdata [Nsdta Duttvitcontentsofurl [Nsurl Urlvithsring: @ "Https://wwwkdropbokskcom/s/7qey2let40eb9je/priliminri_form_2kjpg"]]]; [Self.view addSubview: imageView]; But the picture is not being displayed in the application. Please help me to display a Dropbox image in UIImageView, the issue about it is https or what? try to : + (zero) downloadImage: (NSURL *) URL withCallBack: (DownloadCallbackBlock) callback {NSURLRequest * URLRequest = [NSURLRequest requestWithURL: URL]; NSOperationQueue * queue = [[NSOperationQueue alloc] init]; [NSURLConnection sendAsynchronousRequest: URLRequest Qatar: Qatar completionHandler: ^ (NSURLResponse * reaction, NSData * data, NSError * error) {NSHTTPURLResponse * HttpResponse = (...

javascript - Jquery functions and infinite scroll elements -

I have a script that pops up windows for every link attached to the class JQuery (document) .ready (function () {jQuery ('product-quick-view A'). MagnificPopup ({type: 'ajax', midclick: true, main class: 'mfp-fade'});}); And it works fine but only for those elements which are shown on the first page. When I scroll down the page and add the next products on the infinite scroll page, then the script is used to work (for that product). I think you need to add it: $ (Document) .ajaxSuccess (function () {jQuery ('product-quick-view one'). MagnificPopup ({type: 'ajax', midclick: true, main class: 'mfp-fade'});); The above will be executed whenever an AJAX will be successfully completed.

performance - How can I completely copy a Clojure symbol to a new symbol? -

Image
I have a code that converts a matrix directly to the display. Before I mutate it, I have to get a full copy in a new signal, which is used by the mutation process. Is there anyway that I can copy the content of a closed symbol in a new symbol so that it can be mutated without affecting the other? This is one of my unsuccessful attempts: (Various matte 1 (claytrix / matrix (Claritrix / 2 2)) (Vir Mat 1) Analyzer.core 'matte 1 (claytrix / matrix (claytrix / 2 2) 1 matte (intern' analyzer.core 'matte matte matte 1) matte 2 (claytrix / set matte 1 0 2 2) matte matte And of course, it does not work: (def mat1 (Claritrix / matrix (Claritrix / 2 2) (DIT matte2 matte 1) I also tried (but I am sure if I am doing it anyway): (def matte 1 (claritrix / matrix (Claritrix / 2 2) (DAP Matt 2 'matte 1) and (def matte 1 (claritrix / matrix (chartratrix / ray 2 2)) (deaf matte2 ~ matte 1) and (def matte 1 (clutrix / matrix (clutter / s 2) 2) (def mate 2 (.d...

linux - Is it necessary to run miltiple uWSGI web-sites with different users? -

In this they say: customers ??? Applications can now be run (UWGG is running through the process manager of your choice, such as rc.local, upstart, supervisor, or who attacks your fancy) A different UID And limited (if you want) address space for each socket: Is it really necessary to do this? If yes - why? This is a general security rule, tampering any of your apps, if it is allowed to have the same permissions If it goes along, it will probably harm them too.

asp.net mvc 4 - error on Converting json data to model at controller -

In ASP.NET MVC4, I have to post a JSN data in the controller and change JSON back to the model to use the AJAX method. I am able to get Jasonson from my model, but I can not change it back I found an exception in my controller. Here I make a model object which is called as Jason Type by another AJAX method. Public class LiveController: Controller {// // GET: / Live / public JsonResult myproduct {Product booklet = new product {pId = 1, pName = "novel"}; Jason Returns (Book, Jansenview Behavior, Elou Gate); } Public Activity View Product () {Return View (); } [Hpp post] Public string loadproduct (string book 1) {product value = jscon convert. Directoryal Object & lt; Product & gt; (Book 1); Return "ready"; }} Public class product {public string pName {get; Set; } Public int pId {get; Set; }} $ (Document) .ready (function () {var book; $ ('# searchbtn'). Click (function () {$ .ajax ({url: "/ live / myproduct", type: "GET" "Jason...

java - Return first n elements from a Map using lambdas -

I have a sorted map and have to return the n elements first. Public static map getFirstEntries (last map sorted map, intint altonatorum) {elementsToReturn = (sortedMap.size ()> Reuters for elements)? Element Totron: Sorted map.size (); Return sorted map.entrySet () .stream () .limit (elementsToReturn) .collect (collectors.Toapap (map. Entry :: getKey, map.Entry :: getValue))); } It seems that you have solved at least some of your problems. Suggest some improvements, though You probably want to be the parameter type SortedMap , so that you can accidentally get a plain HashMap for which there is no scheduled order that you return The type should also be in the form of a sorted map . To make this work, you have to collectors. To use the four-azig surcharge of the map, whose fourth ARG is a supplier that lets you control the construction of the map. If you do not do this, you get a plain Hashem . The third ARG merge function, which is called when multiple values ​...

java - spring batch FlatFileItemReader wraps item with square bracket e.g. [item]? -

I have the format below the file. Each line contains a single item. E.g. RIC1RIC2RIC3 . I am using FlatFileItemReader to read these items. This configuration is & lt; Beans: Bean id = "myLineMapper" class = "com.st.batch.foundation.MyLineMapper" /> & Lt; Bean: Bean id = "MyFileMederer" class = "org.springframework.batch.item.file.FlatFileItemReader" p: resource = "file: $ {spring.tmp.batch.dir} / somename - # {JobPermatators [date]} / Items.txt "p: lineMapper-ref =" myLineMapper "scope =" step "/> This is my line mapper, public class MyLineMapper is applicable on LineMon & lt; List & lt; String & gt; & Gt; {Public listing & lt; String & gt; mapLine (string line, intline number) exception {list & lt; String & gt; List = New Arrestist & lt; String & gt; (); List.add (line.trim ()); Return list; }} In my item author, I'm getting wrapped items w...

javascript - Android browsers keyboard opens/closes on last input field focus -

I'm getting some strange behavior in the Chrome browser on HTC One and Galaxy S5. I click on an input field to enter some data and opens the keyboard and immediately closes again. I've found that this is only on the last available input fields on my pages. Has this problem been encountered before? It works fine on the iPhone and desktop browsers Thanks OK ... It seems that with Android Something to do whenever the keyboard appears, then the browser that redesigned the DOM. I have the $ (window) .resize () function that every time the keyboard appears in this case. I can switch it to use $ (window) .load ()

connection of java and R with Rserve -

I have a Java application for analysis, for which R is required to be installed. I have R also installed in my system and I have installed the router library. But when I am trying to implement Command Rework () in my R console, the following error is occurring: SOCK_ERROR: Binding error # 98 (address is already in use) I have installed all the necessary, with Rurav, it is necessary for my Java application and I think it is not good to work except me. Can anyone help me with this weakness? The name of the tool is SiteSap with which I will run the DDD application for which it is throwing the error that you have a running server on the same host and on the same port. This previous execution Could be the reason that never stopped the server. You can try to connect to the server and turn it off, if your customer is, or verify whether the server is running since you are on CentOS You Can be exposed with N are: ps faux | Grep ruerve If you are looking for a line like Rout...

How to Disable Resize in CKEditor and Change Language to English in php? -

Image
I want to disable ckeditor in PHP and its default language in English changes. I load the ckeditor in php below: Try this: $ config ['language'] = 'en'; $ Config ['removePlugins'] = 'resize'; // Change the image size $ config ['resize_enabled'] = Wrong; Start the CKeditor like: // deny size and like: $ CKeditor-> editor ("editor1", "', $ config);

android - How to know that the library is compiled with no particular entries defined? -

In the documentation of sqlite about foreign keys, it is said that using For foreign key constraints in SQLite, the library should be compiled with SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER not defined. How to find out if SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER are defined or not? Well I used the foreign key constraint to start the database, following the following in my DB assistant class I use - Public Class DataService Extended SQLiteOpenHelper {Personal SQLiteDatabase DB; .. public zero init () {if (db == null) {db = getWritableDatabase (); Db.execSQL ("PRAGMA foreign_keys = current;"); }}

Load new page when succesfully logged in "JSP java" -

We created a login page, where the user can enter a username and password, while clicking on the login, When clicking on the "Nominated" button you can use some advice about loading a new page. My code is now from "validatelogin" & lt;% @ page language = "java" contentType = "Text / html; charset = ISO-8859-1" page encoding = "ISO-8859-1" import = "Java.O., Java.uppress. *"% "& Lt ;! DOCTYPE HTML PUBLIC" - / / W3C // DTD HTML 4.01 transcription // n "" http://www.w3.org/TR/html4/loose.dtd">" gt; gt; top & gt; & lt; Meta http-equiv = "content-type" content = "text / html; Charset = ISO-885 9 -1 "& gt; & gt; title & gt; insert the title here & lt; / title & gt; & lt; / head & gt; & lt; body & gt; & lt;% String UID, pass; Uid = request.getParameter ("userid"); pass = request.getParameter ("pas...

Redis in Ubuntu -

I'm running radis on Ubuntu when I run Redis commands, I'm not in "redis / redis / src" Finding an error is a telling server. I have copied the copy to the redis-server.exe files on the Ubuntu machine. Can be the reason for this? Copy-paste does not work. Just follow this link and install Redis. Then simply change the redis-2.8.9 folder name to redis . Should be simple and work in your case.

c - Average of an array displays correctly only if casted to float -

So I have a beautiful Nobis Question though I declare the average as a float, when I call it Avg = sum / counter; I calculate , where counter is the number of elements greater than 0 in an array, and then print it, after me only 0 decimal point However if I calculate it by casting it on float, avg = (float) yoga / counter; , the average is properly printed. Should not the first one be correct? If I declare a float as a float, then why should I put it in a float later? when you declare int sum; Int counter; ... then sum / counter divides an integer, which results in an integer value. You can still specify that result in the float variable, but the value will remain only integer part. To solve this, you have to put sum or counter in a float - you are getting it As a result the float value too: float result = (float) sum / counter; By the way, as (float) amount) / counter - means that, as you type, that is on Applies yoga .

iOS In-App subscriptions : Test User Purchase History -

I have successfully acquired all in-app purchase logic for working. I have a test in iTunesconnect.apple.com User created and created a test purchase (one-month auto renewal subscription) on a real device with that test user. Where to view the list of web interface all active subscriptions? That is, I want to make many test users and see what happens when we go for production. One way to see me is how many total active subscriptions we have, which are going to end users, estimated revenue for the month That is, a business person wants to see a good report. I looked at the iTunes connector and did not see it anywhere. Is it in existence? If I understand your question and you want to be as if I asked in the comment, You should see the idea from this link and in this link you should check this out. - (int) daylight on membership {// 1 NSDT * expiration date = [[NSUIER Defaults standard user defaults] ObjectForisky's Assessment Expiration Date]; // 2 NSTimeInterval ti...

math - Strange behavior when implementing Back propagation in DBN -

Currently I'm trying to implement Deep Trust Network. But I have met a very strange problem. My source code can be found here: I first applied RBM using CD and it works perfectly (using Gong's concurrency feature is very fast). Then I start implementing a normal feed forward network with diffusion and then it is strange. It looks very unstable when I run it with the Ether gate test, it sometimes fails, when I set the hidden layer nodes of 10 or more, it never fails. Step 2: Calculate all activations with bias Step 2: Calculate the output error Step 3: Promote the back error of each node Step 4: Calculate Delta weight and bias with speed for each node Step 1 to step 4 I make a full batch and these delta weight and bias Yoga Step 5: Apply on the average delta weight and bias I have found the tutorial And this usually works if I give it more hidden layer nodes. My test code is here So I think this should work and RMB and DBN should be implemented by adding ...

asp.net - Using @Html.DropDownList with ViewModel -

मेरे पास एक व्यू मॉडेल है: सार्वजनिक वर्ग WhItemForm {सार्वजनिक आभासी WhItem WhItem { प्राप्त; सेट; } सार्वजनिक आभासी WhItemStock WhItemStock {get; सेट; }} और मेरे नियंत्रक में, मैं नीचे के रूप में चयन सूची को भरने के लिए ViewBag का उपयोग करता हूं: सार्वजनिक कार्यवाही बनाएँ () {ViewBag.WhBrandId = new चयन सूची (डीबी। वाफब्रांड, "आईडी", "नाम"); ViewBag.WhStockCardId = नया चयनसूची (डीबी। वास्टॉककार्ड, "आईडी", "नाम"); देखेंबैग। वाद्य स्थान आईडी = नया चयन सूची (डीबी। वाहिलन, "आईडी", "नाम"); वापसी देखें (); } मेरे पास मेरे WHITEM मॉडल में BrandID संपत्ति है, यहां मेरा WHITEM मॉडल है सार्वजनिक वर्ग WhItem {सार्वजनिक इन्ट आईडी (प्राप्त करें; सेट; } सार्वजनिक आशय WhBrandId {get; सेट; } सार्वजनिक आभासी WhBrand WhBrand {get; सेट; }} जब मैं दृश्य से डेटा पोस्ट करता हूं, तो मैं नीचे WhbrRandID सेट करने में सक्षम नहीं हूं, मेरा विचार: & lt; div class = " फार्म समूह "& gt; @ एचटीएमएल। लेबेलफोर (मॉड...

mysql - Headers already sent error in PHP -

इस सवाल का पहले से ही एक उत्तर है: 11 जवाब & lt ;? PHP यदि ($ _FILES ["फ़ाइल"] ["त्रुटि"]> gt;) {गूंज "त्रुटि:"। $ _FILES ["फ़ाइल"] ["त्रुटि"]। "& Lt; br & gt;"; $ Error = "त्रुटि"; } else {गूंजना "अपलोड करें:" $ _FILES ["फ़ाइल"] ["नाम"] "& Lt; br & gt;"; गूंज "प्रकार:" $ _FILES ["फ़ाइल"] ["प्रकार"] "& Lt; br & gt;"; "आकार:" गूंज ($ _FILES ["फ़ाइल"] ["आकार"] / 2024)। "केबी & lt; br & gt;"; गूंज "में संग्रहित:" $ _FILES [ "फाइल"] [ "tmp_name"]; }? & Gt; & lt;? php $ अनुमततक = सरणी ("जीआईएफ", "जेपीजी", "जेपीजी", "पीएनजी"); $ temp = विस्फोट ("।", $ _FILES ["फ़ाइल"] ["नाम"]); $ नया = "अपलोड /" $ _FILES [ "फाइल"] [ "नाम...

objective c - How to keep subview's position relative to its parent view? -

Image
I have a parent view (UIView), which has 2 buttons (UIButton), these buttons are always under the original view Now, when I do an animation to see the parents (as it increases its height), I want these 2 buttons to maintain their last relative position (should be below). In the shape inspector, I set the origin of the button like However, does it not work, is there a simple solution for this? I do not want to write it in the code, because I have so many sub thoughts, and want to maintain their relative position compared to the parents' view. It's hard work to do this manually in code. Note: I am using encoded 5, iOS 7 if If you are using Xcode 5, you can use the new auto-layout button in the IB: Then you can pin your thoughts in the bottom of the original view in the same way as you would in the size inspector, you may have to add extra constraints, But Xcode do this for you Could.

mediarecorder - How to use different audio encoding bitrate for media recorder android -

In my application I am using the media recorder for audio recording. I use different bit rate 32,64,128,160 etc. Want to do recorder = new MediaRecorder (); / ****** Audio source ****** / try {if (audio_source.equals ("camcorder") recorder.setAdosource (MediaRecorder.AudioSource.CAMCORDER); Otherwise if (audio_source.qual ("MIC")) recorder.SetAudio Source (Media Records. AudioSOS.MIC); Other recorders.SetAudio Source (MediaRecorder.AudioSource.DEFAULT); } Hold (exception e) {recorder.setAudioSource (MediaRecorder.AudioSource.MIC); } / ****** Audio channel ****** / try {if (audio_channel.equalsIgnoreCase ("mono")) {recorder.setAudioChannels (1); } And if (audio_channel.equalsIgnoreCase ("stereo")) {recorder.setAudioChannels (2); }} Hold (exception e) {recorder.setAudioChannels (1); } System.out.println ("bitrate -" + bit_rate); If (Build.VERSION.SDK_INT> = 10) {recorder.setAudioSamplingRate (44100); // 44100} and {recorder.setA...

php - CakePHP :: Adding a default date into a DOB field with the form helper? -

This can be a very simple answer, but so far all of my research is not coming up with a reply! I am using CakePHP 2.4. I have set up a form using KPHHP assistant, with a dub field within the list $ DOBOps = array ('label' = & gt; 'DOB', 'div' = & Gt; False, 'Type' = & gt; 'Date', 'Date Format' = & gt; DMY, 'Maxier' = & gt; Date ('Y') - 100, 'Miner' => ; Date ('Y'), 'Default' => UserDOB;); $ This- & gt; Form- & gt; Input ('dobra', $ DOBOps); Now it is called dobrud, so it is not listed as a dub in my $ this-> data because I want to convert it to 1 . So I take days, months and years, and I use PHP to convert it to a simple timestamp, which I call $ this-> Request-> Data was set as DOB by using . All this works, my code fixes it and saves the data in the database, but when I go back to the User Profile / Settings page, I will update it...

java - How to get the table name in OrmLite -

The name of a table is either the name of the class that is based on it or that is defined in @ database table ( Tablename = "...") Explain that class. Is there an easy way to get the name of a table on runtime ? Depending on those cases, I need the names of all the cases when updating the database to trigger the database. I have already checked but I do not know what the ID is supposed to be. You can use the method from the DatabaseTableConfig class. Remove and return the table name to a class. test for the public class {public static zero main (string [] args) {string name = databasetableconfiff.txt.txtname (AQUARE); Println (name); // TableA}} @ DatabaseTable (table name = "Table A") class A {}

sql - Order important update mysql query -

I have a table in which the primary key is "P", and a unique key "U" say "u" There are no rows with value 35, and due to the business rule, all the "u" & gt; Need to update is "35" from 35 i.e. My question is: If I update, during the update, there may be a value equal to "u" during two rows. Is this a problem? I mean that the MySQL checks the unique obstacle at the end of the update or during the update? If this update may fail, then I can do it as follows: UPDATE `Table` y 'Inner Join (` Select' from 'Table' `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` ` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` "Itemprop =" text "> During my updating, mysql will check the unique obligation and will not allow any duplication in single update command to update several rows. You can check the table.

Show gradient image over another image with css and html -

I want to show a gradient image on another image but the gradient image is not shown on the second image. My code is as follows: & lt; Style & gt; .splash-gradient {background-image: url ('images / gradient.png'); Background-position: left; Double-repeat: repeat-y; float right; Height: 300px; Width: 362px; } & Lt; / Style & gt; & Lt; div class = "col-md-6" & gt; & Lt; img src = "images1.jpg" /> & Lt; / Div & gt; & Lt; Div id = "gradient-background" class = "splash-gradient" & gt; & Lt; / Div & gt; Avoid using empty markup only for style purposes. You can simply add a class to the existing markup & Lt; / Div & gt; And then use this style: .splash-gradient {position: relative; } .splash-gradient: {content: ""; Status: Completed; Top: 0; Left: 0; Background: url ('images / gradient.png') Top left repeats- y; Height: 300px; Width: 362px; } ...

java - Why does Maven choose version 1.0.b2 over 1.3.03 -

I have a project with dependency on the HTTP Builder, it gives me a dependency dependency tree: [INFO] + - org.codehaus.groovy.modules.http- Builder: http-Builder: Jar: 0.5.1: Compiled [INFO] | + - org.apache.httpcomponents: httpclient: jar: 4.3.2: compiled [INFO] | | \ - Commons-Codec: Commons-Codec: Jar: 1.6: Compiled [INFO] | + - net.sf.json-lib: json-lib: jar: jdk15: 2.3: compiled [INFO] | | + - Commons-Binutillas: Commons-Binutils: Jar: 1.8.0: Compiled [INFO] | | + - Commons-collection: Commons Collection: Jar: 3.2.1: Compiled [INFO] | | + - Commons-Lang: Commons-Lang: Jar: 2.4: Compiled [INFO] | | \ - net.sf.ezmorph: ezmorph: jar: 1.0.6: compilation [INFO] | + - net.sourceforge.nekohtml: nekohtml: jar: 1.9.9: compiled [INFO] | | \ - Excerpts: Xiris Implex: Jar: 2.8.1: Compile [INFO] | | \ - xml-apis: xml-apis: jar: 1.3.03: compiled [INFO] | After adding the hibernate-unit manager, xml-apis: aml-apis - Version change of Suddenly, Maven likes to use version 1.0b2 which ...

sql - MYSQL - How to let 3 row data become 1 row data -

Now I select to be union 3 table and under the show. | Comment | Total A | Total B TatalC | ----------------------------- | One | 123 | Faucet Faucet | One | Faucet 123 | Faucet | One | Faucet Faucet 123 | How should this line 1 to be shown? | Comment | TotalA | TotalB | TatalC | ----------------------------- | One | 123 | 123 | 123 | I am trying to group and separate it but it is shown below. | Remark | TotalA | TotalB | TatalC | ----------------------------- | One | 123 | Faucet Faucet Select the sum, sum (total B), sum (total B), sum (total A), (total B) Div class = "post-text" itemprop = "text"> In the form of total B, the sum in the form of a sum as C in total (total C) by comment

awk - How to cat or echo everything between two words in a file -

How to cat or echo in a file between two words? Example Class = "post-text" itemprop = "text"> This can work for you (GNU sed): sed -n '/ ^ instance /, / ^ end / {// D; P} 'file or as stated by Glenn: sed -n' / ^ instance /, / ^ end / {/! p} 'file

matlab - generate rectangle annotation in the current figure -

I would like to insert a rectangle in my matlab shape to highlight a specific area: X = [0 1 2 2 3 4 5 6 7 8 9 10]; Y = [0 1 2 4 3 4 5 6 7 8 9 10]; FH = shape (1); Plot (x, y) xlim ([0 10]); Ylim ([0 10]); I can define the height of the width of the rectangular oblique by using the annotation function. I am thinking, can this question figure be done according to x and y values? For example, for example, I want to draw a rectangle of x = 1.5 y = 1.5 with the height of 3 x and the width of two. This is my endeavor: In the case of% x and y, determine the position of the lbwh l = 1.5; B = 1.5; w = 2; H = 3; Convert Factor of% 1 xx = xlim; L = l./xx (2); B = B / X (2); W = w./xx (2); H = h. / X (2); Annotation ('rectangle', 'position', [L, B, W, H]); The problem is that the situation I am providing is in the context of the position (0,0) in the plot and the shape is not in the lower left hand side of the window. How can I correct this? In a way, just ...

Find the index of a value (with approximation) in Python list -

I have a python list and I want to find an approximation of the value in it. What have I done so far: value = 3.5 Myलिस्ट = [1,2,3,4,5,6,7,8,9,10] In the category I (0, Lane (my list) +2): If the value & gt; The list [i] and the price & lt; MyList [i + 1]: If the stomach (Myलिस्ट [i] -value) & lt; abs (MyList [i + 1] - value): myindex = mylist.index (i) Other: myindex = mylist.index (i + 1) break sorted without software So, if I get an index, then it will be right. Do you know whether there is a build-in method to do this or a library that will do it faster than my code? Since your list has been sorted, you can use the bisect module function Can be used, such as 2, 3, 4, 5, 6, 7, 8, 9, 10], diplomatic imports from Bicect Print Biscata (MeriList, Value) # 3 MyList = 3.5, This will give you an index in which the element will fit in the list and it will be faster (OLG N) than liner search (O).