Posts

Showing posts from March, 2012

asp.net mvc - Cookie expires or session timeout too soon -

I have code that is run when user is authorized: FormsAuthenticationTicket authTicket = New form authenticationTicket (1, email, date time.Now, date time.Now additional minutes (120), true, userdata); String Encaket = Formatting. Encrypt (authTicket); HttpCookie faCookie = New HttpCookie (form authentication.formcookname, encrypt); FaCookie.Expires = authTicket.Expiration; Response.Cookies.Add (faCookie); Then I redirect to an Administrator / Action that has the Authorization feature: [Authorized] Public class Product Controller: Controller { I have the web The config has the following: & lt; Authentication mode = "form" & gt; & Lt; Form log in url = "~ / home / unauthorized" timeout = "2880" /> & Lt; / Authentication & gt; & Lt; sessionState timeout = "120" & gt; & Lt; / SessionState & gt; Although the users are complaining of the session deadline or after a few minutes of inactivity,

c# - Take a ScreenShot of my Control - Winform -

I want to take a screenshot of your control Winform I am using this function - Search this site: Public Zero GetImage () {var bm = new bitmap (display1.Width, display1.Height); Display1.DrawToBitmap (BM, display1.ClientRectangle); BM. Save (@ "C: \ Whatever Jeff", image format.GF); } But when I am using it, then system me There is an error about System.Drawing.dll in System.Runtime.InteropServices.ExternalException '': A common error occurred in GDI +. Do you have any ideas? Thanks! ---------------------- Edit ------------------ - -------- Well I have your function is altered in this way: public void GetImage () {var bm = new bitmap (display1 .Width, Display 1.High); Display1.DrawToBitmap (BM, display1.ClientRectangle); Var dlg = new SaveFileDialog {DefaultExt = "png", filter = "Png files. * .png"}; var res = dlg.ShowDialog (); If (res == DialogResult.OK) BM Save (dlg.FileName, ImageFormat.Png); } And it works but I now have a

sql - Command DELETE dont work in vba -

I have a project that adds and removes the date, the following code in the paragraph: Set DBS = Enter the current DB DBS.exe "TMP" _E "(Diamonds) values ​​(" _ and "'' and Tmp7 & amp;" ') " Delete the type of tmp7 date type such as dd-mm-yyyy and completely delete the following code: set dbs = CurrentDb dbs. Execute "DELETE * FROM TMP" _ and "where DIIMES = #" A "???? & Amp; Tmp7 & amp; "#"; The problem is that only remove more than 12 days, I think, if the day is less than 12, then it is defined as mm-dd-yy. the tmp7 is a string contatination string. How can I do a SQL Pass DD-MM-YYY? Uses the US date format, so when you pass DD / MM / YYYY If you do, then it will apply MM / DD / YYYY. As you clearly understand more than 12 dates, the example 13/10/2014 will be deemed as 13 October 2014. But in our eyes 7/10/2014 is the 7th of October 2014, but is married to entry,

xaml - Image translation is clipped (how to prevent) -

How can I not clear a UI object when I am partially out of the screen? I have an image that is not completely fit inside the screen when I pull it (translated), it seems that it seems but the problem is that the part which was outside the screen does not appear, so The picture is suddenly cut off, the only part of the image that looks appearing is that part which is basically fit on the screen. Ps. Please do not recommend scall-vivener because it is about gesture for doing a specific thing on the UI and ScrollViewer. Not good for this. It is basically XAML (image is twice the height of the display) & Lt; / Grid & gt; This is C # (not really relevant, but still) zero gestureirimannipulation delta (object sender, manipulation deltaArvant ARGS e) {move .Y + = Delta.Translation.Y; } Specify a line and column for the image that directly auto < For both the / code> the size of this image will not be the size of the size of its size to the size of the * def

javascript - Convert a decimal number represented as a string to its hex format still representing it as a string -

I am trying to work in the 160 bit integer using the bigInteger.js library, but I make a representation I want them to be in hex format, so I can transmit them and use them as IDs. var git_sha1 = require ('git-sha1'); Var bigInt = is required ("big-integer"); Var uuid = git_sha1 ((~~ (math.rendum) * 1e9)). ToString (36) + date.non ()); Console.log ('hex \ t', in uuid); // see UIId I console.log ('in dec \ t', bigInt (uuid, 16) .toString ()); // Change it to bigInt and then display it as string console.log ('hex \ t', bigInt (uuid, 16) .toString (16)); // Try it back to Hex Here's my output: In Hex 4044654fce69424a651af2825b37124c25094658 December 366900685503779409298642816707647664013657589336 Hex 366900685503779409298642816707647664013657589336 I should be like hex for hex . Any suggestions? Thanks! it was fixed with PR

playframework - Play Framework config value in JavaScript -

Is it possible to access play config value in JavaScript? Especially the current lang has been selected to know? (V2.2.3) Edit: More specifically, I want to localize the components on the client side, and let me know Required Lang is used to render the page in that Drama Javascript file. : On the first request of a new user, the default language will be estimated to use Play. This does this by parse HTTP accept-language header, it will then save the chosen language in the PLAY_LANG cookie, then the next request will use the same language. For some reason I do not see this cookie in the customer side. My question is) Is there any other way to know Play's lang on the client side? B) Why is this cookie not working? Take a look at . Application Configuration () .asMap () or configuration is one of the other methods of the class. You can read about this about After getting the settings you are interested in them, you can serve them via HTML / JS, but you hav

python - Django 1.7 is dumping all print statements at server start but nothing when the application runs -

I'm having some problems that are wrong here. I am trying to set up logging for my Django project, but as soon as I start ./change.py runerver , all the debug messages are sent as soon as possible. Nothing happens when navigating I have tried to isolate the logging problem by setting it in a very simple app. same problem. So I have also tried a very basic print statement, and I see the same behavior ... This is my views.py : render django.shortcuts import django.views.generic.edit import CreateView, UpdateView, DeleteView of Django from django.views.generic Import ListView. Corner. Import from reverse_labies import from ArlSolarServices. Models Import Architect # Make your thoughts here Class ArchitectList (ListView): print ( "Architect list ') model = architect TEMPLATE_NAME =' backend / architects.html 'class ArchitectCreate (CreateView): make print (" architect View) model = architect TEMPLATE_NAME =' backend / architect_form. html '

r - Resampling overlap between two lists -

I have two .txt files. Both files are a list of strings, like one with a string per line. GRIM1 PHOXA2 SLITRK4 Both text files are ~ 20,000 rows long I randomly want to sample file 2 to 500 string with file 1 and 700 string Am Then I want to calculate the number of stars that overlap these subsets. Then I repeat this process 100 times and want to calculate the minimum, the maximum and the number of strings which means that 100 recompiling overlaps these subsets. I was trying to customize some code that used to work for similar tasks but I get an error: sample.int (length (x), size, replace , Pro): When the 'replacement = false' was the code: CSV (file = "file1wt", header = F) list B & lt; - read.csv (file = "file2.txt", header = F) list A & lt; - as.character (listA) # To check that you actually have a vector of gene names # that is, you must do: List A & L; - as.character (listA) listB & lt; - as.character (listB) res &am

PHP uploader only uploads Small files -

My PHP code uploads only a small file, such as 20 MB, when I try to upload that file which It does not return anything more than that, but it will insert the database anyway. I have tried to enter the upload size but it does nothing; the script should upload an SDF file and an image while inserting information into the database to use. Why can not it upload more than 20MB? & lt ;? Php $ link = $ _POST ['link']; If (isset ($ _ POST ['Upload'])) {$ permission_file-type = array ('.sff'); $ Max_filesize = 99999999999999999999999999999999999999999; $ Upload_path = 'swf /'; $ Game = $ _POST ['sports']; $ Range = $ _POST ['category']; $ Swf = $ _POST ['swf']; $ Height = $ _POST ['height']; $ Width = $ _POST ['width']; ".swf" $ radio =; $ Letters = '0123456789 ABCDEFGHIKLMOPQRSTUVWXAZDDGGLMNOPCrustWwox'; $ Done = ''; ($ I = 0; $ i & lt; 25; $ i ++) $. = $ Letters [mt_rand (0, 61)];

css - Media object & position: absolute -

Image
I am trying to recreate an image to show an image next to the media object formatting a new block Uses overflow: hidden to create references. This ensures that the text does not wrap around the image. However, when my media object is positioned exactly, then Firefox renders separate text from Chrome and Internet Explorer. Firefox seems to be based on the breadth width of the media box rather than the width of the image and width of the text altogether. Chrome and Internet Explorer (Icho Expected behavior) Firefox . Media: After {content: ''; Display area; Clean both; } .media .img {float: left; Margin-right: 8px; } .media .img img {display: block; }. Media. BB {Overflow: Hidden; } See this for an extended example. I was wondering if anyone knew that there is an alternative solution for this and probably why Firefox presents it differently. Absolutely deployed elements are removed from the normal document flow, so they are 100% of their parents

angularjs - pure javascript method to set x scroll position in a div with overflow-x -

How to set a Java scrolls x-potion with horizontal / overflow-x with pure JavaScript or angulars? Important: I'm not looking for jquery solutions - using angularis, jquery works immediately without any work. $ anchorScroll () in a vertical position, but horizontal position is not afaik $ Window.scroll to or window.scrollTo (x, y) does not scroll in an overflow-x div if someone is certified here I have tried to work under certain methods, so I would like to know. You can use $ (selector) .scrollLeft (amountToMove); On jQuery document.getElementById (containerId) .scrollLeft = amountToMove; Pure JavaScript or Angular Element (selector) .scrollLeft (Amount Toowov); using angularjs.

ibm mobilefirst - worklight v6.2 console to use LDAP authentication -

How to configure v6.2 for LDAP to authenticate on any console (localhost: 10080 / worklightconsole /) . On v6.1, this is done in the authentication Config.xml but to migrate the v6.2 process, with this comment to automatically remove the configuration configured to use LDAP to secure the console It was given: "IBM Migration was removed, a worksheet console named Custom SecurityTeam.About the area called IBM Migration Vertical Console, this variant v6.2 I have already tried to follow this PDF and still not working - thank you In previous versions of Warkelite, Wearlight Console security was controlled by the Vertical Security Framework. After launching V6.2, it is now controlled by the underlying application server, it may be WAS, Liberty Profile or Tomcat. In Warkelite Studio, Liberty Profile is used, so you will need to follow these instructions: Follow the instructions related to other application servers here:

vba move email to folder if subject is like? -

I am using the following code to move emails from my inbox to a folder called Supplier in another folder. It currently works if the subject is' Introduction ', but not, if the subject is' My Introduction', I what I want to do is add a line which says that the topic or body like 'introduction 'Or' like 'or' supply 'etc. ... In addition, I have many accounts in my view, at the moment, this code only works for my default account, but I want to do this for my account 'Purchasing@Hewden.co.uk', why Is there a way that I can change? My 'Supplier' folder is within the inbox of my purchasing@hewden.co.uk account and I want to take the email from the supplier folder this inbox. sub MoveItems () Dim MyNamespace MyNamespace = Application.GetNamespace ( "MAPI") myInbox = myNameSpace.GetDefaultFolder set (olFolderInbox) Outlook.NameSpace dim myInbox Outlook.Folder dim myDestFolder Outlook.Folder dim myItems Outlook.Items s

html - Google Tag Manager Link Click Event Listener Triggering on Page Load -

Image
I am having a problem that my link link event audience is being triggered every time the page is loading Click the user link. Here is the setup for the listener: This is the code of the link I am trying to track. A number of these are generated in the WordPress query loop: & lt; A class = "bookButton" target = "_ blank" href = "http://testlink.com" & gt; & Lt; span id = "3BDCNH" & gt; Book now & lt; / Span & gt; & Lt; / A & gt; I have moved the ID to wrap the text instead of the attempted link to see if it will change the problem. & lt; A & gt; tag or & lt; Span & gt; There is no difference between being on the tag. Both users still load the page while clicking. gtm.linkClick listener should be configured in their own tag to load on each page He could listen to each and every click on a link. Your event should then be configured in fire when the event is gtm.linkCLick. This

Netsuite transaction column field recalculate -

I have created a new transaction column field called margin and I added it in the sales order. I have written a script to calculate margin based on item fields, however if you go back to editing the values, the script does not recalculate when a user edits the values, how do I recover it Can i do Function post sourcing (type, name) {if (name == 'item') {var unitPrice = nlapiGetCurrentLineItemValue ('item', 'evaluate'); NlapiLogExecution ('DEBUG', 'value', + unitPrice); Var item id = nlapiGetCurrentLineItemValue ('item', 'item'); Var avgCost = nlapiGetCurrentLineItemValue ('item', 'lastpiecepice'); NlapiLogExecution ('DEBUG', 'Cost', + avgCost); Var marginkkalek = monastery (((UnitPrice - Agcost) / UnitPrice) * 100) * 10) / 10; NlapiLogExecution ('DEBUG', 'Margin', + MarginCalak); NlapiSetCurrentLineItemValue ('item', 'custcol9', margin); AvgCost = Math Plane (a

css - Getting jQuery to make item "selected" -

I'm new to jQuery and I'm looking to use it to select the current menu item (because it's your Looks in hover position.) My alert is firing, so the function is starting. When this comment is not made, the first description, the background color works yellow. However, I can not find others in influencing the menu "selected" class does not seem to work. In other words, the item that I select in the menu is highlighted in yellow until the page changes, then it goes back to the default color. I have tried several combinations to select, including the Sylhet class is. Only selected. jQuery & lt; Script & gt; $ (Document) .ready (function () {$ ('. Nav ul li'). (Function () {Warning ("go!"); / * $ ('A', this) .css (" Background $ ('A', this) .addClass ('selected');})}}; & lt; / scripts & gt; HTML ; A href = "index.php" & gt; HOME & lt; / a & gt; & lt; / li &

Javascript/Jquery export to Excel in Internet Explorer 10+ -

I have done a lot of research and have come to a conclusion that it is possible to export data only to use Excel Is not the client side through javascript / junkie for internet explorer 10+ because it does not support Yuri's object. By using only client side, does anyone provide the option to manage such a situation in IE? Any help would be greatly appreciated thanks! If Yuri is not working, then use blob . Its work is fine, but in IE 10, its functioning is fine instead of URI usage. Use code CSV is your data var blob = new blob ([CSV], {type: 'text / csv'}); If (navigator.msSaveBlob) {// IE 10+ navigator.msSaveOrOpenBlob (Blob, filename + '.csv'); }

java - Android: changing colors gradually for multiple imageview backgrounds using seekbar -

I am using background color to make a rectangular color and I want to gradually convert How can I do this without writing a million links code to remove RG or B from a hex color? This is an example of what I want to do, though experimenting with a box. seekBar.setOnSeekBarChangeListener (New SeekBar.OnSeekBarChangeListener () {@Override Public Zero onProgressChanged (seekbar seekbar, j i, boolean b) {if (i> = 25 & amp; amp; ; I & lt; 50) {imageView.setBackgroundColor (Color.BLUE);} else if (i> = 50 & amp; I & lt; 75) {imageView.setBackgroundColor (Color.GREEN); } Else if (i> = 75 & amp; amp; i & lt; = 100) {imageView.setBackgroundColor (Color.YELLOW);} and {imageView.setBackgroundColor (Color.WHITE);}} < / code> Answer found: seekBar.setOnSeekBarChangeListener (New SeekBar.OnSeekBarChangeListener () {@Override Public Zero onProgressChanged (seekbar seekbar, j i, boolean b) { Iv1.setBackgroundColor (Color.argb (0xFF, I, I, 200));} Th

java - Is there any built in class with HTTP response codes and its categories? -

When I'm one of the code's success codes (2xx), I usually make an integer array and its For example, look for the medium, for example, public static final integer [] SUCCESS_STATUS_CODES = new int [] {200, 201, 202, 203, 204, 205, 206, 207, 208, 226} ; I do the same for other feedback codes. I was wondering if there is an underlying object that already keeps all of these codes and regularly updates what I can use? For example, // pseudo code if (responsecode is from success 2xx category) do something else (the response code is from the error 4xx category As far as I know, there is no such class in the standard library. That's if is java.net.HttpURLConnection , which provides constant constants for different codes. But you feel that you need to do more work HTTP response code categories are created in their values, you should be able to do something with these lines: / p> switch (response code / 100) {Case 1: / * Informational response * / Case 2:

sql - SQLPlus How to print the MAX of COUNT(*)? -

I need help printing the highest number of employees, because Max (COUNT (*)) is actually Does not work, can anyone help me in this? Say that I have two table names which are department and ampe, each of which is deptno and empdeptno respectively. I need to calculate each department in each employee: SELECT dept.dptname "Department", (SELECT COUNT (*) emp WHERE emp.empdeptno = dept.deptno) "employees Number "from DEP order to COUNT (*) DESC; How do you print the department with the highest employee number without using LIMIT with ORDER BY? SELECT dept.dptname "Department", as COUNT (emp.empdeptno) " Number of Employees "from DEPT DEPTNO = emp.empdeptNO GROUP BY DEPT.Deptname ORDER BY COUNT (emp.empdeptno) DESC You can write by Group by DEPTUniqueDepartmentKey, dept.dptname If the dept.dptname key is unlikely you mention the alias by the name of your SQL taste: Group "Department" May be needed.

ruby on rails - Uniqueness with scope in migration -

I'm trying to find a way to get it but I'm not getting any effort, so I think I've been thinking that my attitude is completely wrong, he said, if I want to make the combination of two areas unique, then what should I do in my migration ? Please note that I do not want them to be indexed, just the database field. For example, for the down migration, I unique: true on the field, combo? class CreateSomething & lt; ActiveRecord :: Migration Change Diff change_table: do something | T | T.date: datestamp, cord = & gt; Wrong t.integer: some_number ,: null = & gt; Wrong t.timestamps end end I'm not sure that you Please note that I do not want them to be indexed, just the database field. There are additional pieces on the index information that store the database about the column. More importantly, an index is exactly what you need! class CreateSomething & lt; ActiveRecord :: Migration Change Diff change_table: do something | T | T.d

matlab - How to store variable length arrays? -

I want to store an array that changes its shape in every move of the loop. For example, y = 1: 100 for x = 1: 50 MS (:, X, Y) = ans; . . End end 'ans' is a line vector that changes its size in every move of y. I have these variable lengths 'ans' to MS? When I try to start 'MS' as a cell, then there is an error by saying that "it is not possible to repeat the conversion from cell." How can I fix this? Thanks regards The only way I can actually think Using a cell array, start a 2D cell array like this: MS = Cell (50,100); After this, you create indexes in cells using curly braces ( {} ). Therefore, your loop will look like this: y = 1: 100 for x = 1: 50 MS {x, y} = ans; . . After you've finished, you can index the cell array by selecting the row and column location: Vec = ms {row, column}; BTW, I do not recommend using ans as a variable ans is a default variable that you use In MATLAB execute a statement tha

Cannot print out integer in MIPS Assembly program -

I am using QTSpim as my MIPS simulator and I find it difficult to find out that user input . So far, my code is: .data prompt: .asciiz "Please enter an integer:" .text main: li $ v0, 4 la $ a0, prompt solicitor $ v0, 5 moves $ s0, $ v0 syscall li $ v0, 5 steps $ s1, $ v0 syscall li $ v0, 5 steps $ s2, $ v0 syscall jal order 3 li $ v0, move $ a0, $ s0 syscall li $ v0 , 10 Syscall Swap: Take $ T, Move $ a0 moves $ a0, $ a1 move $ a1, $ t0 jr $ ra Swap 1: $ $ move, $ a1 move $ a1, $ a2 moves $ a2, $ t0 Jr $ ra order 3: bgt $ a0, $ a1, swap bgt $ a1, $ a2, swap 1 bgt $ a0, $ a1, swap jr $ ra Try to print the first integer So I, so it prints a 5 out who should do it. I do not know why this is happening if someone can point out the flaw in my code which is great. Thank you. before you syscall the result of syscall Trying to use: li $ v0, 5 $ S0, $ v0 syscall should be taken: < Pre> li $ v0, 5 syscall $ s0 moves, $ v0 for the other two read_in

objective c - Is there a difference between viewDidAppear in iOS 7.1 and iOS 8 that would effect setting up a variable? -

In iOS 7.1 I set an integer variable in my viewDidAppear method. It works before, but after navigating to another view controller and navigating back to my integer variable, it is now set to zero. If I deloadload to see the integer variable setup, then works every time. In iOS 8, this works every time in the ViewedPayr method. Why would this work in 8, but not 7.1? I can not talk to the question of difference between iOS 7 and iOS 8 Viewedapper < / Code>, here is something that I hope they are useful links to see. There was an answer to a question that addresses the call / event cycle in which there is a graphic that you can find useful: And In this link, there is a reference to a UINavigationController by using the UIViewController , which turns it, manages the other UIViewControllers and ViewAdpair was lost in the message hierarchy, it was, of course, to ensure that the Navigation Controller Is clearly stated Drishydiaidapeepr , so it will be sent to

java - Why my variables cannot receive a value (interface) -

I have a problem sending values ​​to variables. Why when my input is in value, why can not my variable get the value? I have no idea of ​​doing this ... import java.io. *; Public class student app {public static zero main (string [] args throws IOException {student student object = new grade result}; studentObject.getName (); Student StudentObject 2 = New grade Resolve (); StudentObject2.getIdNum (); Student student object 3 = new grade resal (); studentObject3.getMark (); Student student object 4 = new grade resal (); studentObject4.setName (); Student studentObanks 5 = new grade Ristil (); StudentObject5.setIdNum (); Student student object 6 = new grade resal (); studentObject6.setMark (); Student StudentObject 7 = New grade Result (); StudentObject7.showGrade (); Student Student Object 8 = New grade Resolve (); StudentObject8.showResult (); } Interface student interface {zero getName () throws IOException; Zero getIdNum () throws IOException; Zero setname (); Zero set idnam (

c# - How to add value to each item in array inline style -

आइये कि मेरे पास एक सरणी है string [] arr = new string [] { "1", "2", "3"}; मैं मूल्य के अंत में एक स्ट्रिंग जोड़ना चाहूंगा, ऐसा कुछ: arr.appendToEnd ("test"); वापसी arr; // रिटर्न {"1 टेस्ट", "2 टेस्ट", "3 टेस्ट"} मैं सोच रहा था कि इसमें कुछ अंतर्निहित है जो ऐसा कर सकते हैं, निर्माण करने के बजाय मेरी खुद की विस्तार विधि। इसमें कुछ भी अंतर्निहित नहीं है आप आसानी से एक नया सरणी बनाने के लिए LINQ का उपयोग कर सकते हैं: arr = arr। चयन करें (x = & gt; x + "test")। ToArray (); ... लेकिन वह मूल सरणी को संशोधित नहीं करने जा रहा है। यदि कुछ और मूल सरणी के संदर्भ में है, तो वे परिवर्तन नहीं देखेंगे। आम तौर पर यह वास्तव में एक अच्छी चीज आईएमओ है, लेकिन कभी-कभी आप मौजूदा संग्रह को संशोधित कर सकते हैं। इसके लिए, आप मौजूदा सरणी (या कोई अन्य IList & lt ; T & gt; कार्यान्वयन): सार्वजनिक स्थिर शून्य ModifyAll & lt; T & gt; (यह IList & lt; T & gt; स्रोत, Func &a

Sharing Google Calendar's in an Organization -

Question: Is it easy to share a calendar automatically The way is the users present in the Google organization Current Technology: I am looking to organize our calendar within our organization. We are using a Google business account for our calendar, email, contacts, and we sync it at all of our Macs. Current method: When we add a new calendar for each office location, (1) we have to create a calendar on the super admin account, (2) share it With each person, (3) each user should accept calendar, (4) Then we use Google Sync to add calendar to our list, and (5) finally we sync it with iCal . Problems with the current method: - Many more steps for a large group of users - - robbers calendar (since we all share calendars based on an offline location ) Difficult to assign specific events Thank you in advance if you need any more information to tell me! Step 1-3 Google Calendar can be automated through APIv3 You can get a service account You can create dom

matlab - Calculate a "running" maximum of a vector -

I have the following metrics that keep track of the start and end points of the data categories (first column "" < / Code> and represents the second column "end" ): myMatrix = [162 199; % // This range is 162: 199 166 199; % // This range is 166: 199 180 187; % // and so on ... 314 326; 323 326; 397 39 9; 41 9 420; 433 436; 576757; 57 9 630; 634 757; 663 757; 668 757; 676 714; 722 757; 746 757; 79 9 806; 951 953; 1271 1272]; I need to eliminate all the categories (i.e. rows) which are present within a large range present in the matrix. For example the limits are contained within the [166: 199] and [180: 187] [162: 199] and thus, Rows 2 and 3 will need to be removed. What I thought I thought was to calculate "running" max on the second column, for which the value after the column was to decide that Need to remove or not. I used it for the loop as follows: currentMax = myMatrix (1,2); % // Maximum value size [size of matrix, ~

Python reference with Tkinter label change text -

I am trying to replace my tanker label text with another function. Somehow I can not reference the label and therefore do not change the label, just add a new one over the old. works within the init-function of the self.errorLabel ['text'] = 'second' window, but I should be able to do it with any other function, Therefore, in some way a reference mistake This is my code: tkinter import import system import * import ttk class window (frame): def __init __ (self, master = none): Frame .__ init __ (self, master) self.master = master self.errorLabel = Label (self, text = "some text"). Grid (line = 0) self.init_window () def init_window (self): self.master.title ("example") self.pack (fill = both, extension = 1) goButton = button (auto, text = "go! ", Command = self.client_go) .grid (line = 1, column = 1) quitButton = button (auto, text =" off ", command = self.client_exit) .grid (line = 1, column = 0) def client_exit (

excel - How to get VBA hyperlinks working? -

I tried to use hyperlink but it is not doing anything. I would like to know why I need to change to use hyperlinks. sub RDB_Worksheet_To_PDF () String dim FolderPath string as string dim pom as slow filename PONumber = Sheets ("Buy Order with Sales Tax"). Room (8, 6). Value FolderPath = "Z: \ 1.PRODUCTION 1. Buying \ pH H 2012 \" if ActiveWindow SelectedSetts.Data & gt; 1 then "selection of one sheet is more, MSBBC" & amp; VbNewLine & amp; _ "Keep in mind that every selected sheet will be published in the" end if "function with the correct arguments Call FileName = RDB_Create_PDF (ActiveSheet, FolderPath & PONumber, True, true) If the file name is & lt; & Gt; Folderpath & amp; PONumber is 'OK, you get the PDF where you saved it' You can call the mail macro here if you want "MSBbox" sweet! The PO is saved as a PDF. To see "& Amp; VbNewLine & amp; _", click PO number in PO

postgresql - Multiple pgpool-II on same Postgres instances -

Can you run multiple examples of pgpool-II on the same postgres database? My view is that I really want to be redundant, so if the Spiral II goes down, then I can easily use any other data without any downtime, because the data is lost, the database will still be running. Did you know that you can: 1) Is a Pegul-II active and the second is in standby mode? 2) Both spiders are active (SQL queries can come to any of them) The database has been replicated (their entire data). In the case of many pegals, will we face a replica? Many thanks. You must have an active and a passive pegul. If both are active then they can choose different masters in case of DB failover and can cause a disturbance. Pgpool is ready for this architecture with it.

javascript - How do I implement a cancellable editable field in Angular? -

In my model, I have an area for which I need many controls to force. One of these controls is a text box. The text box should not directly edit the field, but rather the user should be allowed to type and then either change or cancel. If any other operation occurs, then any changes in the text field should be overwritten. One obstacle is that there are other UI components which change values ​​and do not reach the local area. I have applied the desired behavior with the instruction: It works, but I think there should be a better way of doing this. Any ideas? & lt; div ng-app = "app" ng-controller = "controller" & gt; & Lt; Div & gt; {{Foo}} & lt; / Div & gt; & Lt; Button ng-click = "increment ()" & gt; Increment & lt; / Button & gt; & Lt; Button ng-click = "decrease ()" & gt; Subtraction & lt; / Button & gt; & Lt; Br / & gt; & Lt; Div shadow = "foo" & gt;

Developing iOS apps in JavaScript - How far can it go? -

I am a JavaScript developer and I have heard that it is possible to develop an iOS application in JavaScript via some "mobile app framework" . Although I can lose access to some functionality which is otherwise available for the original application. What are these functions, and now what is the best mobile webapp solution that enables webapp as a native app? ? Does any of them provide access to the latest features in iOS 8.0, such as the Healthcare? see phonegap and Apache Cordova It will not be able to do original apps that can make a native app, but you can do 80-90% and then fill the empty space with the original plugin.

groovy - Initial data for grails application -

I am developing a small grille application from a book and feeding the database with initial data. Using GroovyConsole , executes the script but does not release the data. DataSource.groovy Environmental settings are as follows: 'Predefined', '' URL = '' JDBC: H2: DIDB; MVCC = 1's' Make ',' Make-Drop ',' Update ',' TRUE; LOCK_TIMEOUT = 10000; DB_CLOSE_ON_EXIT = FALSE "}} When I run the script in the console, results returns NULL . I use GGTS for application But I do not know how to continue the initial data from GGTS, so I have run the grails console command from the command prompt for it. Is this the right way? Is it a straightforward way to do GGTS The way? PS: I have seen this question, but it seems That's where I am now and what I want. Thanks Create a SQL file with you need BootStrap.groovy : class bootstrap {df datasource DRIT init = {servletContext -> gt; ; SQL SQL = New SQL (Dat

Why doesn't this code work in C++? -

#include & lt; math.h & gt; # शामिल करें & lt; iostream & gt; नेमस्पेस एसटीडी का उपयोग करना; Int मुख्य (शून्य) {एक एक [5]; Int foo, i, संख्या, परिणाम, बार; जबकि (1) {cin & gt; & gt; ए; Int z = a [3] - '0'; Int y = a [1] - '0'; Int x = a [0] - '0'; यदि (एक्स == 0 & amp; y == 0 & amp; amp; z == 0) तोड़; i = z; Num = y * पाउ (10, आई); i ++; Num = num + pow (10, i) * x; बार = num; जबकि (बार% 2! = 0) बार -; अदालत के & lt; & lt; संख्या से & lt; & lt; "\ t" & lt; & lt; बार के & lt; & lt; "\ n"; } वापसी 0; } मेरे पास यह कोड है जो इनपुट के रूप में xyez के स्ट्रिंग को स्वीकार करता है, जहां यह स्ट्रिंग संख्या को दर्शाता है जिसे निम्न प्रकार से समझाया गया है: संख्याओं का पहला अंक x है, इसका दूसरा अंक y है , और उसके बाद z zeros का पालन करें। अब, मैं जो करने की कोशिश कर रहा हूं, वह संख्या को आउटपुट कर रहा है और एक नंबर की तुलना में कम मान है जो 2 की शक्ति है। इसके अलावा, मैं लॉग इन क

python - Find the total number of triplets when summed are less than a given threshold -

So I'm working on some practice problems and there is a problem in reducing the complexity of different integers An array is given [a] and a threshold value T. Me number of triple i , j , k is such that A [i] & lt; One [ja] and a [i] + a [j] + a [k] & lt; = t . I have found it with the following Python script from O (n ^ 3) to O (n ^ 2 log n) I am thinking that I would not have it adapted any more I can do import import import bisect first_line = sys.stdin.readline (). Strip () Split ('') num_numbers = int (first_line [0]) threshold = int (first_line [1]) count = 0 if num_numbers & lt; 3: print number other: numbers = sys.stdin.readline (). Strip (). For the split ('') number = map (int, numbers) numbers.sort () I in xrange (num_numbers - 2): j in xrange (i + 1, num_numbers - 1): k_1 = threshold - (number [i ] + Number [j]) if k_1 & lt; Numbers [J]: Break Other: cross_thresh = bisect.bisect (numbers, k_1) - (J + 1) if cross_threatag

parsing - Retrieve parsed data from CSV in Javascript object (using Papa Parse) -

I am ashamed of this question because it seems that it should be so obvious, but I am very weak dealing with Async problems But, and I'm confused on how to proceed. I am using Papa Pars () to parse a remote CSV. I want to hide the result of parse in an object for later use. Here's my code: var dataset = {}; dad. Parse ("http: //path/to/some.csv", {download: true, dynamic typing: true, complete: function (result) {dataset = results.data;}}); Console.log (dataset); This, of course, resulted in being logged in the empty object in the console. Any effort to use a dataset does not work, of course, the dataset object is not actually received by the time the code is executed. Can anyone help me in a reseller or explain how I work with it? Do the dataset variables need to be used outside of the function? The easiest way to ensure that the dataset population is in the 'complete' function is to manipulate datasets right after that, well, the population

excel - Reset Numbered List with Text Style VBA macro MS Word -

I'm trying to create a VBA macro to create Word documents from Excel ... I currently have problems listing Setting up correctly I need the list serial number listed with 2 headers types. This is the same: 1 top 1.1 Header 2 2. Header 1 2.1 Header 2 The problem is that my level 2 list is not being reset, although I have included it .ResetOnHigher property means that I do this Finding results that looks like this: 1 top 1.1 Header2 2. Header1.2 Header2 Can anyone tell me what I am doing and what can I do to resolve this issue? Here's a part of the code I'm using: (...) with ListGalleries (wdOutlineNumberGallery) .ListTemplates (1) .ListLevels (1 ) .NumberFormat = "% 1." .terringcutor = wdTrailingTab .NumberStyle = wdListNumberStyleArabic.NumberPosition = CentimetersToPoints (0) .Element = wdListLevelAlignLeft .extPosition = CentimetersToPoints (0.63). Tabpoint = wdUndefined .STATAUT = 1 With End Date Galleries (wdOutlineNumberGallery) .list temp

mp3 - How to translate heartbeat to soundwaves -

My son's beats have been recorded on my phone. How can I translate it into a physical sound bar, Can I use for art? It's so cute. I do not think this is a question for stack overflow, but I will answer it anyway. What you want is a visual representation of the audio, not physical. A physical represantation will hold in his hand, which will be made of a case. You need to open audio file in audio editing software to a visual represntation of woul'd audio. Audacity is a simple and free tool: Just load the audio file in the audio which you like, then press the print screen on your keyboard (or ProtecRN or something like that), then Go to Paint or similar image-editing software, go to Edit / Paste, and then cut the fragment of the picture you want, and then save it to an image file. Hope that helps.

How can i make regex with exclude certain words -

मैं regex बनाना चाहता हूं जो यूआरएल के साथ मेल खाता है http: // example / web -डिजाइन / उपयोगकर्ता / बहुत-खराब-उपयोगकर्ता-423512 / शीर्ष http: // उदाहरण / वेब-डिजाइन / उपयोगकर्ता / बहुत-बुरा-उपयोगकर्ता-423512 लेकिन मेल नहीं खाते < / p> http: // example / web-design / users / very-bad-user-423512 / left http: // उदाहरण / वेब-डिजाइन / उपयोगकर्ता / बहुत बुरा-उपयोगकर्ता-423512 / मैंने अभी तक यह कोशिश की है / http: // example / web-design / users / बहुत-बुरा-उपयोगकर्ता-423512 / नीचे / /> आपका प्रयास लगभग ठीक था। निम्नलिखित काम करेगा: / उपयोगकर्ता / [^ /] * (?: / | $) (?! left | right | bottom) आपका regex काम नहीं कर रहा था क्योंकि अंतिम / वैकल्पिक था, और लुकआहेड ​​ कोड> / । मैंने एक ऐसी शर्त डाल दी है जो या तो एक / या स्ट्रिंग / लाइन का अंत: (?: / | $) को लागू करती है।

php - Show the posts under the same category -

I am quite new to WordPress and blogging. I am working on a blog portal that has many blogs, but they use all general categories that are listed on the main page of the website. The problem is that whatever category I select on the main page shows me the page with exactly the same post. Here is my code: & Lt ;? Php $ site_url = get_bloginfo ('wpurl'); ? & Gt; & Lt; A target = "_ blank" href = " Can you suggest some PHP functions or give me a tip, what should I do, should I find a solution to this problem? I hope you understand that I'm just getting started and I would like to know more about programming Thank you in advance! Update: I also have a functions.php file, which can be part of the code that is relevant: function tag_posts () {global $ wpdb; $ Tag = $ _GET ['avain']; $ Taxarr = array (); $ Postarr = array (); $ Blogs = $ wpdb- & gt; Get_results ("Blog select blog_ id FROM {$ wpdb-> blogs} WHERE blog_id!

Working with lists (Python) some easy questions -

This question is a bit difficult, at least for me I want to get all the names in a text, I'm easy, or? ; -) Let's start with a simple code: for m in re.finditer ("(?:: | | Med. Family) S * ([AZ] [az] + (?: [AZ] [az] +)?) ", My_text): Print '% 02d-% 02d:% s'% (m.start), M.end (), M.group (1)) Now let me get the name of their index like this: 74090-74112: Johannes Restonon ### This New list 87125-87138 should have two different names: Matheus Now I want to put all those names in a list, and check with my_text in the list and create A new list, such as: namecheck = set (that_list_i_created). Built-in (my_text) Is this any way possible, or? How can I make that list (Johannes, Restanan, Matthews) with names? And is it possible to get an indicator of words in that last list? I did it: list = [] and Thn: list.append ((m.start (), m.end (), m.group (1)))

c++ - How can I define a function that takes as a parameter a pointer value of any kind? -

I am implementing a smart pointer class practice. I have already defined the assignment operator overload, taking one more example of the same class. Now I want to define the surcharge of this operator, which takes any indicator. That's why I got the smartPointer = & amp; SomeObject; or smartPointer = NULL; , etc. How can I do that? Do I pass in void * ? Some more questions? As another general question (and I know that it is rarely desired): What type of parameter tells the compiler that any indicators can be passed? Using a template function to allow you to assign your object to a pointer Can. template & lt; Type name T & gt; Zero operator = (T * oBJ) {// your code here} However, this is not a smart pointer if you can provide it as any raw pointers because it There will be one problem with more than one smart pointer object and then deleting the pointer.

javascript - Defining constants in Google Apps Script that can be used across multiple projects. -

Image
I have around 15-20 Google Apps Script projects that use the same list of all constants. Everything that I have done is defined in the project above all the constants on the first script file, and then copied and pasted the block of code at the same place in each project. So if I make changes in one, then I am copying and pasting that item in the rest of the thing, it becomes time consuming. Is it a better way to do this? Is it using? Does anyone use libraries to define constants in projects? Using a library for a shared compiler is the most effective way to keep continuous objects between Google Apps scripts Some warnings to share: All scripts using ConstLib will need to do this with "development mode", otherwise you will have to manually update each of them Needed (risk: save a buggy version of the castlib And all your scripts will break immediately.) Properties of the static library Therefore, it will be necessary to refer to using the library name, for e

class - creating array of objects from array of arrays, using static method call (PHP) -

मेरे पास इस तरह एक सरणी है: // परिभाषित पृष्ठों $ pages = array ( "घर" = & gt; सरणी ("शीर्षक" = & gt; "मुखपृष्ठ", "आइकन" = & gt; "घर"), "रचनाएं" = & gt; सरणी ("शीर्षक" = & gt; "रचना पृष्ठ", " आइकन "= & gt;" संगीत "),); और जो मैं पूरा करने की कोशिश कर रहा हूं वह है: $ navigation = Utils :: makeNavigation ($ pages); , वस्तुओं की एक सरणी के रूप में $ नेविगेशन बनाएँ, ताकि मैं इसे इस तरह मेरे विचार में पार्स कर सकूं: विदेशी मुद्रा ($ nav_item के रूप में $ नेविगेशन) {echo $ nav_item- & gt; पृष्ठ; // घर (1 होता है।), रचनाएं (द्वितीयतर।) $ Nav_item- & gt; शीर्षक; // होम पेज, संरचना पृष्ठ $ nav_item- & gt; आइकन; // घर, संगीत} क्या इस तरह की समस्या के लिए स्थिर यूटील-जैसी श्रेणी दृष्टिकोण अच्छा है? संपादित करें मैं इस तरह से कुछ के साथ आया था, क्या यह ठीक लगता है? & lt;? Php class Utils {protected protected $ _navigation;

javascript - What's the best way to control the speed of a loop? -

I am using Google's GeoCoder API and I'm killing rate limits using the Loop below. What is the best way to slow down? Result The length of the array varies, but does not exceed 50 items data for {var results = data [key]; Var address = result ['address']; // test if (geocoder) {geocoder.geocode ({'address': address}, function (result, condition) {if (status == google.maps.GeocoderStatus.OK) {if (status! = Google.maps GeocodrastStats .ZERO_RESULTS) {map.setCenters (Results [0] .geometry.location); var infowindow = new google.maps.InfoWindow ({content: '& lt; b & gt;' + + + + + + '& lt; / b & Gt; ', size: new google.maps.size (150,50)} var marker = new google.maps.marker ({status: result [0] .geometry.location, map: map, title: address} ); Google.maps Event.addListener (marker, 'click', function () {infowindow.open (map, marker);});} and {warning ("no results found");}} else {alert ( "Geocode was not

c++ - Why do we use function prototypes? -

I am working with functions for the first time, and I'm curious why we use the function prototype. Why do we use them? Do we have to give them & gt; Need to use There is a difference between the need for full requirement and practice. Technically, we do not need much more than necessary, for the creation of the loop of the language for , do and while Practically it is different, you do not want to reduce the use of goto and longjmp . Technical recurring are only required for recurring tasks, and for function pointer to use. In practice, you need to divide them into bigger source code into manageable fragments, modules, and see things to look more faulty. An alternative to functioning prototypes in the form of an abstract view of a class, there may be something that is automatically seen as a summary of the complete source code. One option for a recursive set of tasks is to nest them, function functions inside the functions definitions. It is easy in C ++

How to get the keys and values of an associative array indirectly in Bash? -

In the Bash, only one variable is given in which the name of an associative array is, < Code> $ declare -A dict = ([abc] = 125 [def] = 456) $ dictvar = "dict" How can we get keys and values ​​of associative array? In the Bash, to get the keys of an associative array via induction, the variable or local (): $ declare -a 'keys = ("$ { $ {Key [@]}; $ value_var = "$ {dictvar} [$ key]" resonate $ "$ key = $ {value_var}" $ done < Optional has been suggested using code> eval . According to , this function completed thanks to a new declare -n in Bash 4.3+ Easy to do That variable can solve a variable name in the variable.

c# - Latitude isn't accurately but Long is accurately - Android device -

I try to get my lat long from Android device with GPS. My code is: Location Manager LM, Location Manager; Location L; TextView LT, LN; LM = (LocationManager) this.getSystemService (Context.LOCATION_SERVICE); Lm.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, this); L = lm.getLastKnownLocation (LocationManager.GPS_PROVIDER); UpdateWithNewLocation (L); Private zeros update with new location (location location) {string latLongString = "unknown"; String address string = "no address found"; Decimalf df = new passphrase ("## 00"); If (place! = Null) {double lat = location.getLatitude (); Double LNG = location.getLongitude (); LatLongString = "Lat:" + df.format (lat) + "\ n Long:" + df.format (lng); Geocoder GC = new GeoCoder (main activity. This, local.get default ()); {List & lt; Address & gt; Addresses = gc.getFromLocation (lat, lng, 1); If (addresses.size () == 1) {addressString = ""; Address address

PHP MySQL search with multiple criteria -

I have a search form in a website and there are several search terms that the user has input to do DB search The following terms in the form: Keywords for property (sales, fare ...) Type of property (apartment, roof) Maximum value is the script to search with the input of the above word < Pre> public function Do not get_property_list_by_search ($ start, $ per_page, $ keyword, $ prop_for, $ min, $ state, $ ptype, $ max, $ mysqli) {if (empty ($ start) & empty ($ per_page)) {return 0;} $ Start = preg_replace ('/ [^ 0-9] /', '', $ mysqli- & gt; real_cape_string ($ start)); $ Per_page = preg_replace ('/ [^ 0-9] /' , '', $ Mysqli- & gt; real_cape_string ($ per_page)); $ keyword = $ mysqli- & gt; real_escape_string (stripslash (keyword $)); $ prop_for = $ mysqli- & gt; real_escape_string (stripsSash ($ prop_for )); $ State = $ mysqli- & gt; Real_space_string (stripsashash ($ state)); $ ptype = $ mysqli- & gt;