Posts

Showing posts from June, 2013

wordpress - How to require more than one cookie htaccess -

I would like to know more than one cookie EG To reach example.com/protected you need both of cookie1 and cookie 2 Here's my current HTACCESS: rewriteigninauthenticationbutton / cookietext / restarted% {HTTP_COOKIE}! AuthCookie = OpenSystems [NC] REVERE TANK% {HTTP_COOKIE}! ^. * WordPress_logge_in * $ [NC] rewrite. * Http://example.com.com/wp-login.php [L] Why do I need both cookies? Use or flag: to re-write / rewrite / requestcut% {HTTP_COOKIE} to rewrite! AuthCookie = OpenSesame [NC, OR] RewriteCond% {HTTP_COOKIE}! ^. * WordPress_logge_in * $ [Nc] rewriter * Http://example.com.com/wp-login.php [L] If either AuthCookie or wordpress_logged_in is unavailable, then wp-login Redirect to .php If both cookies are present, then both the positions will not be completed and thus you will not be redirected

Extracting text from XML file via batch file -

I have to remove some text from an XML file through a batch file, one of the parts I need to remove The string is between the tag ( & lt; string & gt; example1 & lt; / string & gt; ) and the second data tag ( & lt; data & gt; example2 & lt; / Data & gt; ). Any idea how? thank you in advanced! @echo OFF for output.txt / f "delims =" job "% % I "Goto: EOF: Job Set Line =% 1 Set Line =% Row: / = %% i ('findstr / i / c:' & lt; string & gt;" xml_file.xml ') Call: % Set line =% line: & lt; = +% set line =% line: & gt; = +% set line =% line: * + string + =% set row =% row: + = & amp; rim % Echo.% OP with the input file - D: \> Draft.bat D: \> gt; & gt; Output. Txt: eof ; Type Output.TT000000000@gmail.com Default Web For The password www.instagram.com (000000000@gmail.com) www.instagram.com Cheers, G

javascript - How to fix errant orientation and points in an elliptical particle cloud? -

Image
I am making the oval cloud of numbers in three.js and there are two problems that appear straight ahead, but I have a few days Still stuck for: Cloud should be oval shaped with the longest axis on the axis on the x Currently oriented with the x axis at least axis, while for me the cloud looks exactly elliptic, working in my file There are some points in the le code: y = 0 on the x axis that moves up to the green of their drummer - they have soldiers on y = 0 Stand like. To measure the code> length on either side of the oval (see screenshot below). Both files are in the same math for the ellipse - what's going on here? Thank you! Code for the oval cloud of digits: particleCount = 300; For (var p = 0; p & lt; particleCount; p ++) {// ELLIPTICAL var length = 200; // X (major axis) var width = 75; // y (small axis) var px = (math.rendum () * length); // Solution for length of vertical wire on PX: var wire; Var right entrepreneur = Math Box ((leng...

linux - Cannot connect to google compute engine virtual machine by vnc -

Text after "div class =" itemprop = "text"> I have made a calculation engine of a Debian Boiling Virtual Machine in Google, but I am unable to connect it to VNC. Here I have Installed Gnome and VM What is the tightvncserver installed in reboot and it has started I do Try using a stable IP that I have attached to VM but I am getting the error: "The connection to the host computer was rejected". I thought it was a firewall that was a problem, so I disabled iptable using the following command $ sudo iptables-save & gt; /root/firewall.rules iptables f iptables -x iptables -t net f iptables -t net -x iptables -t slaughter f iptables -t slaughter -X iptables -p input iptables accept -p output forward -p iptables accept ACCEPT And I have made rules in Google firewall to allow port 0-65535 for TCP and udp but it still does not work. Does anyone know how to do this? Thanks in advance VNC uses the default port 5901. In the 'VNC Serve...

javascript - How do I get this class name via jQuery? -

Image
Trying to create an Ariane, but I do not have to find out if the wrapper has an active class or not. My jQuery: $ ('.faq_wrap span.plus'). (Clickclick, function (e) {var topEl = $ (this) .closest ('.FAQ_wrap' '(TopEl.hasClass (' active ')) (topEl.removeClass (' active '); topEl.find (' Reply ') .SlideUp (' sharp '); return false;} topEl.each (function (index, L) {topEl.removeClass (' active '); topEl.find (' reply '). SlideUp (' sharp ' );); TopEl.find ('reply'), slide down ('sharp'); TopEl.addClass ('active'); console.log (topEl);}); Here is the output from console.log : I'm trying to check that Or .faq_wrap.active already exists or not. If this happens then slide the arrondissement before sliding down a new one. As of now, this check is ignored and I can open several accordions as many times as I like? Use topEl.get (0) .className

java - NullPointException error in Book object program -

For my life I could not find this logical error in my code ... the error says: I have a code that comments the part of the larger program that I am attempting to create, but do not pay attention to this issue for now. Exception in the thread "main" on java.lang.NullPointerException SchoolTextBookSort.main (SchoolTextBookSort.java18) And here is my code and thank you in advance !: import java.util.Arrays; Import javax.swing *; Public class school textbook {public stationary zero main (string [] Args) // Tudo auto-generated method stub //javax.swing.SwingUtilities.invokeLater (new runall) (// public zero run () {// CreateAndShowGUI ();}}}; School Textbook [] theBooks = New School Textbook [5]; JoppenPan. Show Message Dialeg (empty, books); The book [0] .setAuthor ("Ernest Hemingway"); The Book [1] .setAuthor ("Mark Twain"); The Book [2] .setAuthor ("William Shakespeare"); The Book [3] .setAuthor ("St The Book [4] .setAuthor (...

python - Regex that matches a word bound by start and end of a string or non-word characters -

मेरा पहला प्रयास है: [\ ए \ बी] + (शब्द) [ \ Z \ b] + लेकिन किसी कारण से यह काम नहीं कर रहा है। पायथन / पर्ल रीजजेक्स का उपयोग करके। रीजक्स को ऐसे स्ट्रिंग में एक शब्द लेना चाहिए: , शब्द शब्द,, शब्द, शब्द शून्य-चौड़ाई वाले एन्कर्स जैसे \ A और \ b नहीं कर सकते चरित्र वर्गों के भीतर इस्तेमाल किया जा सकता है, न ही उनमें से एक से अधिक एक दूसरे के आस-पास हो सकते हैं, इसलिए + अर्थहीन है। हालांकि, \ b पहले से ही स्ट्रिंग के प्रारंभ या अंत में सीमा से मेल खाएगा, इसलिए यह कार्य करना चाहिए: \ b ( शब्द) \ b

memory - Importing large amount of data into MATLAB? -

I have a text file which is ~ 80MB, it has 2 columns and approximately 6A6 rows. I import the data into MATLAB I want to do it, but there is too much data to do with the load function. I'm playing with the popen function, but nothing can do to work Ideally I want to import and import the first call of data and finally put it in a large array in MATLAB . If this is not possible, then I would like to divide it into the arrays of 34,013 in length. I would like to do the same for the second column of data. fileID = fopen ('yourfilename.txt'); FormatSpec = '% f% f'; Whereas ~ feof (fileID) c = textscan (fileID, formatSpec, 34013); Edit: You are getting an error, because there are two columns in C. I need you to take the column individually and handle them. For example: column1data = reshape (c (:, 1), 301113); Column2data = reshape (C (:, 2), 301113);

Sitecore 7 Analytics increase engagement value programatically -

I am working to implement Cycorecore DMS in 7.2 and I have been a main issue for which I find it difficult Have time to get an answer I have some goals and events set up and I am trying to set one through the Analytics API. The event is being logged after the page event ID is set in the database, but what I am trying to add adds the engagement value to the current visit / visitor. I want to update the value field in the Visitors database for the current visit. What I'm currently doing: Public static zero trigger target (id target) {if (Tracker.IsActive & Tracker.CurrentPage! = Null) {Sitecore.Data.Items. Item TargetTotrigger = Siter.Contax.DatabaseBattle (target); If (goalToTrigger! = Null) {Sitecore.Analytics.Data.Items.PageEventItem reg = New Sitecore.Analytics.Data.Items.PageEventItem (goalToTrigger); Sitecore.Analytics.Data.DataAccess.DataSets.VisitorDataSet.PageEventsRow eventData = tracker.CurrentPage.Register (reg); EventData.Data = goalToTrigger ["Descript...

c# - Cancelling thread in async/await -

I'm trying to test a small app that is using ASC / using the transaction process More A waiting / async polling feature My test setup: [TestMethod] Public Zero TestProcessTimerOnly () {// This initializes and voting Up tp = The introduction of new TransactionProcessor (); Try {Thread. Sleep (5000); Tp.CancelProcessing (); } Hold (Exception Pre) {LogErrors (Ref TP, East); } Finally {DisplayLog (TP); }} [Testimede] Public Zero Test Process TimerOnly Forward Concern () {// It Introduces Pulling Verte TP = New Transaction Processor (1); Try {Thread. Sleep (5000); Tp.CancelProcessing (); } Hold (Exception Pre) {LogErrors (Ref TP, East); } Finally {DisplayLog (TP); }} My code (all in a class): // Producer Public TransactionProcessor (integer debugForcedCancellationDelay = null?) {// & gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; Cancel Setup & lt; & Lt; & Lt; & Lt; & Lt; & Lt; & Lt; & Lt; If (debugForcedCan...

apache pig - how to convert tuple to comma seperated string in pig -

How do I convert the string pig a tuple? For example, {( "Lost"), ( "Law and Order")} The "Lost, law & order" generated FOREACH my_programs ... If your my_programs can contain only two fields, you can use CONCAT. Otherwise you should make a custom UDF. FORAECH my_programs generated CONCAT ($ 0, CONCAT (',', $ 1));

kendo ui - How can I use javascript to create a string consisting of every ISO/IEC 8859-1 character possible? -

I want to create a string that makes every letter possible and see if any popular QR readers from each and every four My problem is that I do not know how to make the object as a byte so that it appears as an IEC 8859 character. I have tried type array, but unable to assign each character to print and assign it to Telekk / Kendo control I would like to make a string of ISO / IEC 885- How do i use Assign it to 1 character and above linked control? I have written this function and takes a javascript number and determines whether Use it in ISO / IEC 8859-1 codepace, which String.fromCharCode allows you to create the string that you are looking at. function inIsoIec8859_1 (code) {if (codeof code! == "number" || code% 1! == 0) {throw error ("code supplied is not an integer type." )} If (code & gt; 255 || code & lt; 32 || (code & amp; 12; & amp; amp; amp; & amp; amp; amp; code & lt; 160)) {return false; } Back true; } Var isoLatinC...

ios - making a circular sprite -

I have a small and simple spritekit game that is based on little animation. Basically, the screen gets tapped every time, I want to go out of the place of a circular shape. I now have the following code: - (zero) touches: (NSSET *) touches the event: (UEIVEMENT *) event is called when the event is open. / NSLog (@ "touch screen"); (UIT Touch * to touch in touch) {CG point location = [touch space inode: self]; /// NSLog (@ "Location is X% F", location.x); // NSLog (@ "Location is Y% F", location.a); SKSpriteNode * sprite = [SKSpriteNode spriteNodeWithColor: [SKColor purpleColor] Size: CGSizeMake (25, 25)]; Sprite.position = location; SKAction * Action = [SKAK Scale: 10 Duration: 0.5]; SKAction * newaction = [SKAction fadeAlphaTo: 0 Duration: 0.5]; [Phantom run action: Action]; [Phantom Run Action: New Action]; [Add soul to child: phantom]; }} This thing is that the shape that is formed when tapping is a square, is there any way i can make it a cir...

c# - Hide Elements in DockPanel & Resize -

इस सवाल का पहले से ही एक उत्तर है: 1 उत्तर & lt; डॉकपैनेल & gt ; & Lt; ट्रीदृश्य डॉकपैनेल.डॉक = "निचला" / & gt; & Lt; DataGrid DockPanel.Dock = "नीचे" दृश्यता = "संक्षिप्त" / & gt; & Lt; / DockPanel & gt; असल में मैं चाहता हूं कि पहले TreeView को शेष स्थान को भरने के लिए करना चाहिए जो कि दूसरा "" ढंका हुआ "डेटाग्रिड ऊपर ले जाता है। और अगर मैं "टकराया हुआ" के लिए पहला ट्रीव्यू सेट करना चाहता हूं, तो मैं चाहता हूं कि दूसरे को ऊँचाई में बढ़ने के लिए दिखता है जब इसके सेट से दृश्यमान हो। यह अंतिम चाइल्डफिल के कारण काम नहीं करता है। लेकिन यहां तक ​​कि अगर मैं इसे गलत पर सेट करता हूं, तो मैं एक तत्व गिरने के लिए सही तरीके से फिट होने में कठिनाई नहीं कर सकता। मैं यहां एक स्टैकपैनल का उपयोग नहीं कर सकता, क्योंकि स्टैकपैनल पूरी तरह से नियंत्रण में नि: शुल्क अंतरिक्ष की उपेक्षा करता है, इसलिए यह मेरी खिड़की को कभी भी भर नहीं लेता! मैंने इस्तेमाल किया & lt; डॉकपैनेल & gt; ...

Default form size for WTForms -

मुझे कम से कम आकार = 50 होना चाहिए, और मेरे पास html में है: {{form.name (size = 50)}} हालांकि, प्रत्येक पृष्ठ के लिए मेरे पास 10 फ़ॉर्म हैं, क्या यह किसी भी तरह से है कि मैं इस बेमानी को अनदेखा कर सकता हूं रास्ता और आसपास काम? (बिना आकार = 50) धन्यवाद कई तरीके हैं यह पूरा कर लें कि आप अपनी चेन में कहां से निपटना चाहते हैं। लेकिन मुझे लगता है कि टेम्पलेटिंग परत है, जहां आपको इसे हल करना चाहिए, क्योंकि आप जो चाहते हैं वह शुद्ध प्रस्तुति है। मान लें कि आप जिन्जा 2 का प्रयोग कर रहे हैं, आप एक छोटा मैक्रो लिख सकते हैं जो आकार प्रत्येक क्षेत्र का कीवर्ड तर्क जो आप रेंडर करना चाहते हैं: मैक्रो: {% macro render_field (फ़ील्ड) -%} {% if field.type! = ' HiddenField '%} & lt; = "{{field.id}}" के लिए लेबल & gt; {{field.label}} & lt; / label & gt; {{फ़ील्ड (आकार = 50, ** kwargs)}} {% endif%} {% - endmacro%} फ़ील्ड कॉल में नोट करें मैं इसे आकार से 50 । अगला, क्षेत्र को प्रस्तुत करने के लिए, आप इस मैक्रो को फ़ील्ड नाम (इस कोड में s...

Custom start index in Julia array? -

How do you declare an array with a custom start index in Julia? In other words, when I declare an array in special circumstances, then instead of 1 , the index of first element 0 or 2 How Can I Make It? . Short answer: Julia has no inherent way of doing this. Long answer: You can create a custom ARA type that will support it easily, and will be a good solution for this problem.

ios - Different layout for iPhone and iPad in the same Storyboard -

Image
Xcode 6 supports "universal" storyboard. It is very convenient, it means that we only use one for iPhone and iPad The storyboard needs iPhone and iPad layout same.But here comes a question: What is the same, most of the iPhone and iPad layouts are only a few or two differences in UIViewControllers ? How can we add different UIViewControllers to the same storyboard for iPhone and iPad here's what I have done ?: (yellow part) storyboard My code: (in iPad if you add to the navigation bar And add container and also the constraint of the obstacle for 0 Magistrate) class ViewController: UIViewController {var segmentControl: UISegmentedControl! @IBotlett Weak St Sententner: UIUV! @IBOutlet Weak height height: NSLUT console! Override function viewDidLoad () {super.viewDidLoad () self.segmentControl = UISegmentedControl (item: ["personnal", "department", "company"]). UISegmentedControl as if UIDevice.currentDevice () userInter...

java - returning values of computation as String -

Total calculation of total area integer = (( Width Feet * 12+ Width Inches * * (Length Feet * 12+ Length Inches) + 2 * ((HeightFeet * 12 + heightInches) * (WidthFight * 12 + width Inches)) + 2 * ((HeightFeet * 12+ heightInches ) * (LengthFeet * 12 + lengthInches)); // The amount of paint needed is double totalpaint = (Kulareira / Aragridan); Int. Kulpant 2 = (Int) (Kulareira / Aragragridon); Double totalprice = 0; Int pygolonaded = 0; Int onegallonneeded = 0; Intestine halfgallonneeded = 0; Int quartneeded = 0; Int pintneeded = 0; Int halfpintneeded = 0; If (Kulpant> gt; [5] multiplication equals = (int) five galonne + + vulpant 2/5; Totalpaint = totalpaint - (parser * 5); Total Paint 2 = Chancellor 2 - (5th current * 5); Ekglonended = (Int) AglONaned + Vulpant 2/1; Kulpanj = Chancellor - (Ekglonitated * 1); Totalpaint2 = COP2 - (One Gloninated * 1); Half-glonided = (int (half-voltage + parent / 0.5); Totalpaint = Vulpant - Semicirolite * 0.5; Quartanad = (int) (quartaned ...

php - Laravel DB::transaction not rolling back on exception -

I have this small problem with Laravel 4.2 and DB :: transactions. I had a problem with the transaction which was not being brought back, so I tried to snippet the code the easiest and put it in the routes for testing purposes. Php: routes.php: DB :: transaction (task () ($ user = app :: build ("user"); $ user-> gt; ; Save (); Throw a new exception ("Do not create user");}); ... ... ... some other code here Just within the closing of the transaction Trying to create a user and after creating the user, I make an exception to force the rollback of the transaction. My problem is that you throw exceptions, I do not roll, whenever I refresh the app, every time I am getting a new user in the database, the same code works for the purpose of a local machine, but I am planning to use it for production on the server Do not roll back the transaction. Do you have any ideas? Edit: Server MySql: 5.1.73-cll - MySQL Community Server (GPLv2) Server PHP: PHP 5.4....

javascript - select2 add option values on opening and refresh -

I have a select2 element that I need to add elements to when the user clicks on it. , I listen to the select2-opening event and add elements. ('Selection 2-Inauguration', function (avt) {$ ('# select2-elem'). APPEND ('& lt; Option value =' 1 "& gt; val1 ... & lt; / option & gt; ');}); This works fine (i.e. adds option to dome) except that I do not see the appended option immediately (Information) What is a way to refresh ? Get a reference of current selection element using $ $) . $ ('# select2_elem'). ('Select2-opening', function (evt) {$ (this) .append ('& lt; v Lp value = "1" & gt; Vale 1 ... & lt; / Options & gt; ');});

calling private methods for class method: python -

I'm trying to implement several constructors in Python and one of the suggestions (via online search) classmethod Was to use. However, using it, I have problems with code reuse and modularity. Here is an example where I can create an object based on a supplied file or through another medium: def (__init __ (self, filename): self.image = lib.load filename) self.init_others () @ data_class_de_tata (cls, data, header) from def: cls.image = Lib.from_data (data, header) cls.init_others () return cos def init_others (self): # some other variables themselves start. Some = numpy.matrix (4,4) now Like this So that I can not do that. Cls.init_others () call fails by saying that I have not provided the object to call it. I think I can start these things in an in-data function but then I repeat the code in the init method and the other "constructor". Does anyone know how I can call these other initial methods with these @ classmethod works? Or maybe someone knows a better ...

php - CakePHP : Saving Multiple Checkbox Associated Data -

I am searching through other tutorials and guides, but whatever I am doing is not found anywhere. I have a form that has multiple selection fields which gives an array. This array (space-object) I'm looking for to insert in the related fields and other models that reference the place. This is where I go into problems. I get the array given below by my form but in all instances I have to add field and location_id with each data entry because I do not know how many Array ( [Name] = & gt; [type] => [specialties] => array ( [location] => phone] = [Address_num] = & gt; [address_street] => [address_suffix] => [address_state] => [address_suburb] => [address_postcode] => [NUM_DOCS] = & gt; Gt; [additional_services] => [Money] => [created_by] => 1 [assigned_to] => 1) [hour] => array ([mon_active] => 0 [Mon_open] = & gt; 10:00 [m On_close] => 10:00 [tues_active] => [[tues_open] => 10:00 [tues_close] => 10:00...

Vb.net two Times togeather HH:MM from to text boxes -

So I have two labels, which I have to change, they have to add them together, they will not be the same, but I have one of the ways to add them right to them. Dim time 1, string as the time 2 is eligible for the integer time as the total time in hours and minutes. Example 'example 13: 13 minute example' 1:45 is 1 hour and 45 minutes time 1 = convert ToInt32 (lblTime1) Time2 = Convert.ToInt32 (lblTime2) Total time = time 1 + time 2 closing sub parse outside your label ???? text s: dim time 1 = the timepan. Purse Axact (Elblic Time 1. Text, "H \: mm", Culture Infoc. ​​Contentculture) Dim Time 2 = Timespan Purse AXact (LLL Time 2. Text, "H \: mm", CultureInfoCurrentCulture), Tim TimeTime = Time 1 + Time 2

Find similar items in list of lists using Python -

I am trying to do something like this, but I am using lists of lists. However, gives me a TypeError. list1 = [[a, a], [b, b], [c, c]] list2 = [[c, c], [d, d], [e, e ]] Same = set (list 1) & amp; Set (list2) I am also trying to find: different = not set (list1) & amp; Set (list2) There are no types of lists, so they can not be set You can convert a list to a tube with Tupl (MyList) . The following codes assume that a, b, c, d and e are positive types. list1 = [(a, a), (b, b), (c, c)] list2 = [(c, c), (d, d), (e, e )] Equal = set (list 1) & amp; Set (list2)

web services - How do I call perl cgi script from another perl cgi script -

I have a CGI script that takes some parameters like the following. testScript.cgi? Arg = 1 & amp; Arg2 = some ting else and amp3; Other The above script works well and fully. Now I have another Pearl CGI script mySecondScript.cgi It does its work, but with the arguments I have computed in this script, textScript.cgi . How do I do that? Any elegant solution will be appreciated. You probably want to use another program to call. You'll need something like this: $ my output = get ("http: //someserver.somedomain/testScript.cgi? Argument = 1 & arg2 = SomeThingElse and arg3 = second thing" ); This will return the output from the CGI program (i.e., it generates ja html pages). If you want more control to get back, then you need to use it. my $ ua = LWP :: UserAgent-> new; My $ resp = $ ua- & gt; Receive ("http: //someserver.somedomain/testScript.cgi? Argument = 1 and arg2 = SomeThingElse and arg3 = otherThing"); $ resp wi...

xml - Push nested tag value into PHP array -

How can you press sample_id value by using the PHP DOM and together before and samples ? I have tried to add another forward loop, but I am getting various notices like trying to get non-object property XML & lt ;? Xml version = "1.0" encoding = "ISO-8,859-1" & gt; & Lt; Maintable & gt; & Lt; Groups & gt; & Lt; First & gt; Text 1 & lt; / First & gt; & Lt; Second & gt; Text 2 & lt; / Second & gt; & Lt; Samples a = "link" b = "link" & gt; & Lt; Sample_id & gt; 000,555 & lt; / Sample_id & gt; & Lt; / Samples & gt; & Lt; / Groups & gt; & Lt; Groups & gt; & Lt; First & gt; Text 3 & lt; / First & gt; & Lt; Second & gt; Text 4 & lt; / Second & gt; & Lt; Samples a = "link" b = "link" & gt; & Lt; Sample_id & gt; 111,000 & lt; / Sample_id & gt; & Lt; / S...

Apache is blocking tomcat's ROOT? -

OK, so I installed apache and tomcat in a machine. I remember when I had just installed a new tank, this route was posted on mydomain.com, but now it's Apache running, this is Apache page which shows me phpmyadmin and it works fine What I have to do, I would like to replace the original app page with ROOT.war, which I had placed on my TomCase webapp folder. As I think Apache does not serve files, just how do I configure Tomcat so that they can stay together on one machine? Both port 80 are running? Apache 80 is by default and tomak is 8080. If you want Apache to be served with some property (such as images) and some paths (like war) by Tomcat - then you need to use Mod_jk or mod_proxy inside the Apache tomak To forward the requests to when a fixed url pattern is matched. If your question is different, then you just want to keep Apache and Tomc in co-existence and on your own web page server - then the port should be separated

c++ - Warning Anonymous namespace inside struct using function pointer -

In my program: // Place this code in a separate header file. Structure _S1; Typedef Structure {int unused;} * RETVAL; TypeFF REV (* MyFunc) (Zero * result, zero * CTX, straightp1 = S); Typedef Structure _S1 {struct _S1 * Parents; MyFunc f1; } S1; // In the CPP file, include the above header file I get the following warning: WARNING: A ???? _s1a ???? Is a field ???? _ S1 :: F1A, which uses anonymous namespace [enabled by default] typedef struct _S1 {^ What does this warning mean? What is the result of this warning in my code? How to get rid of this warning? I am compiling Linux on GCC. The fact is that you had put your definitions in one header, strongly suggest that you Use multiple headers to use that header, and use those types. But if there are headers in many source files, they get their own version of RETVAL due to the anonymous structure you are using, even though It is not possible to have the same type in all the source files in the _S1 time. Trad...

Login and session management in Asp.net Mvc 4 -

I want to create an application in which different user login functionality such as administrator, coach and student each have their own work So here I want to deal with the session and I am new to asp.net mvc. Here's an example, let's say that we want to manage the session after verifying user verification, Therefore, it is difficult to check the valid user only for this demo account login public performance login (login model model) {if (model.UserName == "xyz" & model.Password == "xyz") {session ["uname"] = model User name; Session Timeout = 10; Return Redirect Action ("Index"); } {If the session ["uname"] == faucet) {return redirection ("/" /> Account access "); } And {return content ("welcome" + session ["anonymous"]); }} On the signature button session. Remove ("uname"); Redirect Return ("~ / Account / Login");

ios - Response failure when using AFHTTPRequestOperationManager -

When I tried to call the API (FHTPPRVAST Operation Manager) for authentication method with the exact username and password, the exact Received feedback and the method was successful. Then I tried with an invalid username and password, I'm getting a response. I tried ASIHTTPEEEEEPP AP for the same method, so please check the request and feedback given below and advise me how to resolve this issue. But there is an invalid user feedback failure in AFHTTPRequestOperationManager. ASIHTTPRequest call sample: ]; Request.shouldAttemptPersistentConnection = No; [Request Security Mode: @ "Post"]; [Request addRequestHeader: @ "Encrypted" value: @ "app / x-www-form-URLXeded"]; [RequestRequestHeader Request: @ "Authority" Value: [ShareUtil Authorization Header]]; [Request addRequestHeader: @ "Accept" value: @ "Application / Jason"]; [Request setValidatesSecureCertificate: no]; [Request setPostValue: @ "pa" forKey: @ ...

node.js - In passportjs deserialization, store sesssion data in browser cookie -

In the ordering and deserialization of passports, how do I store browser cookies instead of storage (I am constantly submitting session data on browser cookies ) How to use the database in If you have correctly configured passport middleware Passport session data will be passed as the passport parameter of the method. DeserializeUser. Ensure that the passport is set correctly in Express: app.us (express.cookieParser ()); App. (Express: (secret: 'your secret phrase'})); App.use (passport.initialize ()); App.use (passport.session ()); implementation passport. Cyrilize user and passport.deserializeUser : // User includes user passport by data validation strategy Cyrilize user (function (user, done) {done (tap, user);}); // obj passport session data passport.deserializeUser (function (obj, done) {// use obj to get user information or include it directly in the requested object (empty, obj);}); User data will be available in req.user .

Using the Paypal Mobile SDK UI in the REST API -

I was trying to get you a PayPal Rest API: In the third step, given a link The link that takes you to PayPal's login screen looks like this: I saw the login screen in the iOS Mobile SDK here, which has a very good UI, is there any way in which the mobile SDK Can URS be used in the REST API? The first (and second) link in the example is to create a web app on the top of the SED The news is that mobile SDKs are also built on the top of the REST API. However, examples for mobile are not perfect but there is one. It should play well or with the payment setting by Pay.intent = PayPalPaymentIntentAuthorize .

android - Button Zoom on a table layout -

I want to implement the button on this table layout or kissing the zoom. how to do this? Anyone who is easy to implement, has to do it. & lt; Horizontal scalve xmlns: android = "http://schemas.android.com/apk/res/android" Android: padding = "10dp" Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; End left; Android: ScrollView Android: Layout_blo = "@ + ID / Table Header" Android: layout_width = "match_parent" android: layout_height = "match_parent" android: id = "@ + ID / scroll zoomview" & gt; & Lt; TableLayout: Android: id = "@ + id / main_table" Android: layout_height = "wrap_content" Android: layout_width = "match_parent" /> & Lt; / Scrollview & gt; & Lt; / HorizontalScrollView & gt; Edit to add Java code: zoomIn.setOnClickListener (New OnClickListener () {@Override Click ...

javascript - Regex for finding a specific pattern in a string -

I want to write a regex if a string has ]] [[ . For pre: [[T]] [[T]] . But if I try to use the pattern: RegExp (/] \] \ [? = \ [\ [] /) for testing [[t]] [[t]] , console displays unknown ')': Why do you have a syntax error: You can call ( to \ ( , so you have unmatched '' '' in the error \ (? = \ [\ [] How to fix it: The best way to do this really depends on you. If you just want to check that In the string, ]] [[[/ code>, do not use a regex: if (yourString.indexOf (')] [[' ']] == -1 ) {// do something} If you really want to use a regex, you can [ s but ] to avoid s: if (/ $] If you really Want to use regex and [[ : do not want to capture, then (/]] (? = \ [\ [] / Test (yourString)) {// do something} If you select [[ and ]] (like [[ T]] ): if (/ \ [[[[[[[[\\]] *]] /. Test (your string)} {// do something} If you want to check two [[..]] string back-to-back: if (/ [SA ...

java - ImageView post rotate fling cannot generate random number -

I am creating a Dialer Fling that can change the wheels, I am facing a problem, which I The number of dialer post method I want to generate random float so that each time the button is clicked so that they can velocity differently. When I was about to complete, I found it in the post method: Can not reference a non-final variable within an internal range defined in a different method I hope that something in the code You can make changes when the number given by post method each time I click on the button. Button Dialer. Post (New Runnabel) {Float I = (Float) Math.Rendam (); // Last Float Suppose to be i = (float) Math.Rendam () @ Override Public Video Run () {Dialer Post (New Flingnerable (I))}}}); Public FlingRunnable (float velocity) {this.velocity = velocity; } @ Override Public Wide Run (If (Math.Abus (velocity)> 5 & amp; amp;; Rotating;) {rotateDialer (velocity / 75); velocity / = 1.0666F; // Post Dialer From (this);}} Problem: float I = (float)...

javascript - jquery ajax not submitting -

मेरे पास यह कोड है: & lt; script & gt; क्लिक करें (फ़ंक्शन () {$ ("# my-username")। Html ('& lt; input type = "text" $ (दस्तावेज़) .ready (function () {$ ("# edit-my-username" Id = "new-username" value = "& lt;? Php echo $ my_username;? & Gt;" gt; & lt; बटन class = "my-button small-btn" id = "सबमिट-मेरे-उपयोगकर्ता नाम" & gt; सबमिट करें & lt; क्लिक करें (फ़ंक्शन () {var user = "& lt;? Php echo $ userid;? & Gt;" var edit_field = "उपयोगकर्ता नाम" ; Var edit_content = $ ("# new-username")। Val (); अगर (edit_content! == '') {$ .ajax ({प्रकार: "POST", url: "edit-user.php", डेटा : {उपयोगकर्ता: उपयोगकर्ता, फ़ील्ड: edit_field, सामग्री: edit_content}, कैश: गलत, सफलता: फ़ंक्शन (html) {$ ("# my-username")। Html (html);}});} वापसी झूठी;} );}); & Lt; / स्क्रिप्ट & gt; मुझे समझ में नहीं आ रहा है कि वह क्...

c# - get data of checked row from 1 dataGrid to another datagrid, delete unchecked row from other datagrid -

I 2 DataGridView in WinForms dgv1 dgv2 dgv1 1 CheckBoxColumn, dgv2 few columns but no CheckBoxColumn. I need functionality that enables me, when I check the checkbox column, the data for that particular line should be selected and should go to DG2 2. This is how I put selected rows from dgv1 to dgv2. But if I cancel check (or uncock), then check the check box in DGV1 that the special line should be removed from DGV2. Help me fix this. I would be grateful to u friends, looking forward to this. :) The idea here is my code datagridview6 = dgv1 and datagridview10 = dgv2 private void DataGridView6_CellContentClick (object sender, DataGridViewCellEventArgs e) {dataGridView10.Visible = true if ( dataGridView6.CurrentCell.ColumnIndex == 7) {if (dataGridView6.CurrentCell.Value = null!) {bool checkstate = (bool) dataGridView6.CurrentCell.Value; If (checkset == incorrect) {dataGridView6.CurrentCell.Value = true; } Else {// here helps logic to delete unwanted lines of data; GridView6.Curr...

php - How to merge JSON two indexes and then Parse information -

I'm trying to iterate both JSON (player and building), so that I I can do jQuery I have two indexes: JSON is information about the player and there is information about the player building related to being related to another Indian. I want to parse it so that I can get the player and its building name. My actual JSON result {"player": "[35]" "building": "8", "room_name": "" "Id": "36", "building_id": "9", "38", "building_id": "10", "room_num": "103",}, "id": " 38 "," building_id ":" 11 "," room_num ":" 104 ",}]," building ": [{" id ":" 8 "," name ":" ABC "}, {" id " "9", "name": "id": "id": "10", "name": "ghi"}, {"id"...

sql - date format picture ends before converting entire input string error -

itemprop = "text"> I have this process: after creating or modifying the function_back_here_selected_out_data (in date , Date out SYS_REFCURSOR) * from COURSE_LECTURE WHERE LECT_DATE_TIME_START & gt; = To_timestamp (in_date, 'dd-mm-yyyy') and LECT_DATE_TIME_START & lt; To_timestamp (in_date + 1, 'dd-mm-yyyy') ORDER BY LECT_DATE_TIME_START; End; Input: Date, Output: Lecture on this date. The date in the table (see) is TIMESTAMP. I want to run this process. I tried to do this: k SYS_REFCURSOR declared; --t Date: = to_date ('2010-12-14: 09: 56: 53', 'YYY-MM-DD: HH 24: MI: SS'); Res COURSE_LECTURE% rowtype; Return_rows_locure_vidadet (to begin ('2010-12-14', 'YYYY-MM-DD', K); Loop Fate Res in K; Exit K when not k%; DBMS_OUTPUT.PUT_LINE (res.COURSE_NAME); End loop; End; But I get this error: Error Report - ORA-0130: Date format picture ending before converting full input string ORA-06512 Occurs: "hr...

postgresql - Reuse persistent dblink connection -

We have a function that is often triggered and makes remote DB a query. If I am not wrong then the connection work is in the current call / session. Is it possible to make a global connection in a remote DB and reuse this connection on each connection call? The person we are facing takes a query more than 1 to transfer only 3 records. say: until the connection has closed or continues The database session has expired. Then this function is designed to be reused in calls. Just reuse it.

sql - Return the maximum of all groups? -

Consider a simple table like the following table: create table example example_groups ( Id SERIAL primary key is not value1 INT, value is not 2 INT, not user_name text tap); with some lines in it: Example group_subjects (value1, value2, user_name) values ​​(3, 1, 'Tom'); Examples include example_groups (value1, value2, user_name) in values ​​(5, 2, 'tom'); Example in the example group (value 1, value2, user_name) value (1, 3, 'tom'); Example in the example group (value 1, value2, user_name) value (40, 10, 'john'); Example - include in groups (value 1, value2, username_name) (1, 11, 'John'); I have the following query for the group in the table by SELECT SUM (value1), user_name column: Value 2), maximum (value 2) example_groups GROUP by user_name; Return of the result I'm going to put it in another table (the query is INSERT SELECT ) I get my code named I want to return to the maximum value of all the rows in the MAX...

c++builder - Paradox DB: how to change database path programmatically -

I want to change my database paths programmatically. I have a folder with several tables, and my users can change from one database to another. For example: Active DB: D: \ APDDB \ DB can convert to 1D: \ APIID \ dB2 clean (); Sprintf (c, "path =% s", dir.c_str ()); List-> Couples (c); Session-> ModifyAlias ​​(dbalias, list); Delete list; Table 1- & gt; Database name = dbias; } When I run the routines above the tables, then there is still the old path! Table1-> database-> Directory = c; I set the directory to the new directory, but my application still uses the old tables. What's wrong with this? Thanks for using TDatabase component with TTB or TQuery . Do not use aliases. Set TDatabase.DatabaseName You want to link TTable and TQuery components to the TDatabase component For the use of this name, their respective DatabaseName properties should be set to the same name as TDatabase components. Set TDatabase.DriverName ...

Django print in template all arugment passed from view -

I would like to quickly debug the purpose that to be able to print all the logic passed from the scene, there are some magic templatetag Is it possible that my time can be saved for writing my job clearly in the curly bracket for all the names? UPDATE: I found {% debug%} but print is not necessary that it can be filtered in some way? Did you see Django Debug Toolbar? You can set it up for development and see template references which will tell you what you want. There are also many other useful tools.

java - Is there any way to retrieve the records from database in bunches rather than whole? -

My code receives a huge amount of records that exits memory error, I I'm exploring the way that I want to get data, clean the memory, retrieve the rest .. I can use Rownum, but I do not know for sure Next recovery, this only remaining, non-recoverable Rick Will consider the card. Can anyone help me? In advance thanks I see to split that way I am having to retrieve and process the data, clean the memory, retrieve the rest. You can use The JDBC driver gives a signal as the number of rows that should be obtained from the database when this ResultSet object Requires more rows. posted here on a tutorial spectacle.

Android : destroy activity before intent to another activity -

I have two activities in my Android application: 1. Login Activation: By using a user member Login / Password & Email or as guest 2. Main Activity: Showing the user's current location on the map Scenario: 1. User login guest. 2. Go to main activity as guest (no NPE is not here) User Ta said that some action was required to login 4. intent log entry 5. The user is required to destroy the main activity before giving instructions to login. 6. User input username and password on login activity 7. If the user exists and passwords really go to MainActivity 8. NPE (or tap pointer exception) happened here. So, in my case, I need it to destroy the main activity (point number 5) before directing the user to log-in activity. I have tried to: Final AlertDialog Builder Builder = New AlertDialog Builder (reference); Last string message = getResources (). GetString (R.string.NCI); Builder.setMessage (Html.fromHtml () "To do your work, we need you to log into our ser...

python - How to append to a list only the first time a prime is encountered -

I have written this python code, unless all the major numbers print to 1000: For prime in primes = xrange (1, 1000) []: For x in the xchange (2, prime): if (prime% b == 0): brakes and: primes.print (prime) print primes However, if a number is prime, then it adds several times before moving to the next number. Tried to use continue instead of br but it does not work I added some more code to that (which works) just to output the output array in a text file so large that I can not even paste it here here . How often can I add the prime minister only to the list? There is a feature in Python that you can use here quite effectively. Just change your indentation in this way: For the prime minister in the xrange (1, 1000) primes = []: For x in the xchange (2, prime) for b: if (prime% b = = 0): Brake Braz: Primes.Append (Prime) Print Primes That is, the d-indent to else is the same as else if not , but for for loop, for a loop in a else branch Which can...

.htaccess - CodeIgniter 2.1.4 - Routing don't work in server -

I know there are many such issues but I have applied everything and I can not find the right way to do this Used to be. / P> .htaccess is:! (. *) RewriteBase / NewWebsite RewriteCond% {REQUEST_FILENAME} RewriteEngine on -f RewriteCond% {REQUEST_FILENAME} -d RewriteRule ^ $ / Index.php / $ 1 [L] & lt; / IfModule & gt; & Lt; IfModule! Mod_rewrite.c & gt; ErrorDocument 404 / NewWebsite / terror.php & lt; / IfModule & gt; in config / config.php: $ config ['base_url'] = 'https://mydomain.com/NewWebsite/'; $ Config ['index_page'] = ''; $ Config ['uri_protocol'] = 'auto'; // I change it with REQUEST_URI and PATH_INFO but it does not work In the server, mod_rewrite has been enabled. In localhost, everything is fine, but when I do it on the server went uploaded, the only index work (the first page you see), but when I move "around the web "If I want, I get a 404 error, no page found. I'...

c# - Return File not returning pdf correctly MVC 5 -

I am currently using a PDF server side PDF library. When this is done I try to return this PDF to the user. Every time I try to fail to open PDF, or if I run it down as a download, it downloads as a corrupted file. If I type the physical address of the PDF in the browser, it loads properly. In my Controller: Return file (nfilePath, "application / pdf"); In this example, nfilePath = ~ / PdfStore / CurRep103323842.pdf This is something stumped on this simple, any advice would be great. Thank you. See part of that load @modelprintShiftHandover. Model ShiftHandOver @ {ViewBag.Title = "ShiftHandOver"; } & Lt; Div id = "updateRegion" & gt; @ {Html.RenderAction ("_ ReportDetails");} & lt; / Div & gt; See partial @Model PrintShiftHandover Models. Main report: DEFET @ {layout = string Empty; } & Lt; Div id = "PartialView" & gt; @ Use (Html.BeginForm ()) { ............. here a form } &...

php - How can i programmatically change magento media storage? -

How can I change magenta media storage programmatically? Hi, I want to change Magenta Media Storage Clear Script: I'm trying to set the configuration like IM to do this: mage :: app () - & gt; GetConfig () - & gt; SetNode Mage_Core_Model_File_Storage :: XML_PATH_STORAGE_MEDIA, 1); It converts mediastyle from file system to database, but it does not work. Can anyone help me? Am I just to change the media storage system to ah? I just do not want to synchronize files to change it. Wardius, you can do it with code below $ Config = new Mage_Core_Model_Config (); / * * Notice * / $ config - & gt; Save config ('default / system / media_storage_configuration / media_storage', "1", 'default', 0);

How do I convert a mercurial queue patch to uncomitted changes in my working copy? -

I have an applied patch in my horoscope queue, how do I convert this patch into irregular changes in the copy of my work (Although I have not created a patch using QNE)? Specify the mercurial to refresh the patch, but leave all the files. This will leave all the changes without patch in your working folder. You are left with an empty patch which can be closed and removed. hg qref -X * hg qpop -f hg qdel & lt; Patch & gt;

javascript - select specific element using jQuery attr() Method -

If I have 5 images on a page, then all of them are exactly the same image as seen below & lt; Body & gt; & Lt; Img src = "http://httpJunkie.com/1st/jQ02/orangeCat.jpg" & gt; & Lt; Img src = "http://httpJunkie.com/1st/jQ02/orangeCat.jpg" & gt; & Lt; Img src = "http://httpJunkie.com/1st/jQ02/orangeCat.jpg" & gt; & Lt; Img src = "http://httpJunkie.com/1st/jQ02/orangeCat.jpg" & gt; & Lt; Img src = "http://httpJunkie.com/1st/jQ02/orangeCat.jpg" & gt; & Lt; / Body & gt; I just have to use javascript and I must use jQuery to modify height of each one, assuming that the first 10px x 10px and each continuous image should be increased from 10px I know that I can select one by using the first one: $ ("body img: first"). Attr ({width: 10, height: 10,}); The last one using and $ ("body img: last") Attr ({width: 60, height: 60,}); My primary questi...

c# - Use namespace to distinguish between two IUnitOfWork implementation -

I'm developing C #, .NET Framework 4.0 with an ASP.NET MVC 4 mesh API, the unit code code first 6.0 and Nunzek I would like to have two separate DbContext custom assignments because I have to connect to two separate databases. This is my custom DbContext class implementation public class EFDbContext:. DbContext, IUnitOfWork {public EFDbContext (): base ("name = EFDbContext") {// Exit, then there is no database, do not create database.SetInitializer & LT; EFDbContext & gt; (Zero); } Protected Override Zero OnModelCreating (DbModelBuilder modelBuilder) {modelBuilder.Configurations.Add (new CONFIGURATIONSConfiguration ()); Modlbilder Configuration. Add (new code configuration ()); Modlbilder Configuration. Add (new AGGREGATION_CHILDS configuration ()); Modlbilder Configuration. Add (new AGGREGATIONSConfiguration ()); Base.OnModelCreating (modelBuilder); }} Both DbContext custom classes IUnitOfWork and my problem is that if I get from them how d...