Saturday 15 May 2010

C string array sizeof() changes -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 7 जवाब
      शून्य फ़ंक्शन ( Char * s []) {printf ("s:% d \ n", आकारफ (एस)); } शून्य कॉलर () {चार * एक [2]; के लिए (इंट I = 0; i & lt; 2; i ++) {a [i] = (चार *) मॉलोक (50 * आकार (चार)); } Strcpy (एक [0], "कुछ"); स्ट्रक्पी (ए [1], "एमेल्स"); Printf ("a:% d \ n", आकार (ए)); समारोह (क); } <  

    इस आउटपुट

      a: 16 s: 8   

    का आकार क्यों है sizeof () भिन्न कॉलर () और func () ? इसके अलावा, func के लिए char * की संख्या को पाने के लिए sizeof के माध्यम से संभव है?

    एक दो अक्षर संकेतों की एक सरणी है अन्य पॉइंटर्स की एक सरणी के लिए एक सूचक है वे समान आकार नहीं हैं।

sql - ORA-00979: not a GROUP BY expression error -


I have the error that i! Got not understand

The number of employees and conferences to demonstrate my question is I name which he had worked and that employees not directly working on any conference, so that staff Must have to display 0. The tables associated with this query are:

Employee_C Table:

  EID name salary middle ---------------- - ----- ----- E01 Wilson 53000 E02 Smith 48000 E01 E03 Jones 38000 E01 E04 Loftus 41000 E05 Fox 54000 E04 E06 Smith 45,000 E04 E07 Green 48000 E08 Fox 49000 E04 E09 Wolf 41000 E04 E10 Wang 32000 E01 E11 Philips 33000 E07 E12 Liu 27000 E07   

Deals_C table:

  EID Confid --- ------ E02 C0000l C0000l E03 E05 E06 C0000l C0000l E03 c00002 E08 c00002 E09 c00002 E10 c00002 E03 c00003 E05 c00003 E06 c00004 E08 c00005 E09 c00005 E10 c00005 E06 c00005 E11 c00006 E12 c00006 E05 c00007 E06 c00007 E08 c00007 E09 c00008 E10 c00008 E11 c00008 E02 c00009 E12 c00009 E10 c0001 0 E02 c00011 E03 c00011 E05 c00011 E12 c00012 E06 c00012   

SQL statements to me

  as the number of "conference" E.Name, D .Confid selection is included in the left externally from Employee_C E.Eid at Deals_C D = Eid Group by Ded Group; Error:  

Error:

E.Name, D.ConfID Selection * Error on Line 1: ORA-00979: A Group by Expression No

Please help! Thank you

You are not doing an overall job and you are using GROUP BY is not sELECT list on a column you need GROUP bY E.Name because it is in the selection column:

 < code> select E.Name, count (D.ConfID) "number of conferences" as E.eid = Dikid group Deals_C outer left side of Employee_C by e E.Name D;   

View

Hosting powershell import-module failure -


I'm trying to host PowerShell and the "ServerAdmin" module is required to run the Get-Windowsfeature OS server 2008 R2 is I can successfully run "import-module serverAdmin" on PS comamnd signal, so I know the machine config is good. However, I can not get it to work in my custom C # host. I've tried two approaches, first shown below, using the import-module command, the error says "specified module 'server admin 'Was not loaded because any module file was not found in any module directory. " The second approach, using InitialSessionState.ImportModule (), also fails. No error has been reported from that method, but the get-windowsfeature command is ignorant.

The first method:

  var ps = PowerShell.Create (); Var cmd = ps.AddCommand ("import-module"); Cmd.AddArgument ("ServerManager"); Ps.Invoke (); Console.WriteLine ("Errors"); // produces "the specified module 'ServerAdmin' was not loaded because no valid module file was found in any module directory" foreach (var error in ps.streams.Error) {Console.WriteLine (error.ToString ( )); }   

The second approach:

  var ps = PowerShell.Create (); Var initial = InitialSessionState.CreateDefault (); Initial.ImportPSModule (new [] {"ServerManager"}); Var Ranspace = Ranspace Factor. Criterion (initial); Runspace.Open (); Ps.Runspace = Ranspace; Ps.AddCommand ("Nights - WindowsFeature"); Var result = ps.Invoke (); // throws an exception because Get-WindowsFeature is not a foreach (result as a result of result) {Console.WriteLine (results); }    

found the problem I was creating x86 or x64 or any Was obviously x86 default and of course server-2008 was happy to run it in wow, but the server admin module is not available in that context.

android - How can I test timed Notification? Or is my code somehow wrong? -


I want to distribute timed notifications (everyday, 5:00 AM), and this is the alarm code Tries to use:

  Intent to appIntent = new intent (this, NotificationService.class); AlarmManager AlarmManager = (AlarmManager) getSystemService (ALARM_SERVICE); Pending Internet Penientent = Pending.text (this, 0, appointe, 0); AlarmManager.cancel (penIntent); Calendar cal = calendar.justinstance (); Cal.set (calendar.HOUR_OF_DAY, 5); Cal.set (calendar.min, 00); Cal.set (calendar. SECOND, 00); AlarmManager.Settering (alarmman.rtc, cal.getTimeInMillis (), alarmManager.INVAL_DAY, Penentent);   

NotificationService.class looks like this (least important part):

  int id = 001; Information Manager mNotifyMng = (Notification Manager) getSystemService (NOTIFICATION_SERVICE); NotificationCompat.Builder mBuilder = New Notification Builder (main activity.) .setSmallIcon (R.drawable.icon) .setContentTitle ("Test") .setContentText ("Test!"); MNotifyMng.notify (id, mbuilder.build ()); StopSelf ();   

I can not seem to do this work. When I set the emulator clock to 4:59 or something else and wait to change at 5:00, no information is seen and I have no other way to test it. I hope you know a way to check it or find a bug in my code.

I believe the problem is that you cancel pending , But then you have to recreate it before setting it to alarmManager .

  // Pending pending AlarmManager AlarmManager = (AlarmManager) getSystemService (ALARM_SERVICE); Pending Internet Penientent = Pending.text (this, 0, appointe, 0); AlarmManager.cancel (penIntent); // Repeated pending attendant app entity = new intent (this, NotificationService.class); AlarmManager AlarmManager = (AlarmManager) getSystemService (ALARM_SERVICE); Pending Internet Penientent = Pending.text (this, 0, appointe, 0); Calendar cal = calendar.justinstance (); Cal.set (calendar.HOUR_OF_DAY, 5); Cal.set (calendar.min, 00); Cal.set (calendar. SECOND, 00); AlarmManager.Settering (alarmman.rtc, cal.getTimeInMillis (), alarmManager.INVAL_DAY, Penentent); To cancel   

pending you need to create it exactly as you do for the first time, then AlarmManager s Cancel () as you like but then you need to make it again to set an alarm to pending

** I hope you know some ways to test ...

may be a better way, but for testing purposes For, I will occasionally set up a global debug flag is changed between the testing and production. Then say it can be 4 hours and 2 minutes, it can be a bit more difficult during the day, but you can change the time, time, hours, minutes or whatever. Once you know that this is triggering at the right time, you can change it back and still test it when the time comes for that day but now you know that it should be done.

In C#, how do I initialize an Object with key/value from an Collection -


I am very lazy to type all the properties of my object, so instead:

  myObj.property1 = value1; MyObj.property2 = Value2; MyObj.property3 = Value3; MyObj.property4 = value4; MyObj.property5 = value5; ...   

Is there any way to do this?

  object myObj = new object (); Foreign currency (string quaprint in myCollection.AllKeys) {var curValue = collection [curProperty]; MyObj [curProperty] = ON; // ???????????? }    

Yes, you will need to use the system. Reflection to work:

 For  (int i = 1; i & lt; 6; i ++) {PropertyInfo prop = myObj.GetType (). GetProperty (string.Format ("property {0}", i); if (prop == null) {continue;} prop.SetValue (myObj, collection [prop.Name], null);}   

In this example, I'm assuming that there is a string indexer on the name of the property in the store (you may need to recover it in a different way). I also agree I have only 5 attributes ( i <6>), you have to set accordingly. But you get this idea.


Commented by Gimshikhel In spirit The ordering is also an option. 'I'm not working here as an example because I'm not 100% on code, but consider web services. Web Services (D) do their work with serialization.

So, you technically distribute an XML file to the object and you get all the benefits of Deserialization - and there are quite a few which I can think from the top of my head that the values ​​of propertiesA new example of the object did not > - I do not believe how it outlines - but I know that this is because I have once Followed the bug !

ios - iPad app not laying out properly -


I have an iPad app for which I received the code.

I am relatively new for the development of the iPad, please bear with me ...

The app was compiled by the contractor in off-site in 2010. Since then, my company has been acquired and we are in the process of re-branding. I seem to have a simple task in this app to replace our logo with a new logo. It should take a few minutes - just drop a new logo into code, compile it, and bam! was done.

There is a problem compiling the code ... The working app launches in landscape mode and fills the entire screen with its interface when I compile the app in the simulator or use my iPad Run on USB cable via my Mac), the screen launches in landscape mode, but the view is in the picture mode, in intermittent locations during the app, from the scene landscape to the por Visit trait layout.

This is driving me crazy because I do not even know what to see. I need some references to AutoRotateToInterfaceOrientation - I think it has been deprecated. Can this cause problems?

I know that a lot has changed since 2010. I am currently running the latest version of XCode on a new Mac. (Which I think, my predecessor had never compiled the app here, but fully trusted the contractor ... what I can see, this can be a problem that is with everyone, but No one knew)

UPDATE

I have to test with an old Mac (with an earlier version of XCode). I moved the app code to the old Mac, changed some settings, and it works correctly.

I have also found that the layout is not perfect on any app on my new Mac. For example, leaving a button near the top of the form can be scrolled from above, so it is not visible either.

Is there a setting in XCode that defines this behavior?

The view controller turns into an iOS 6.0 probe for orientation position.

// Override to allow Orientation other than the default portrait orientation.

  - (BOOL) should require aerotatetoInterfaceAuthentication: (UINterface orientation) Interface Orientation {// Return Yes, Supported Orientation if (Interface Orientation ==UINFterfaceOrmentation LandscapeLIFF || Interface Orientation == UINPference Orientation Landscape Right) {Yes Return; } And {not return; }}    

ember.js - Is Ember really a single page app? -


I am studying emberjs for almost a week and I have studied the examples That was a single page app. I have been asked to work on a project which extends more than 30 pages and I do not know what the directory structure will be and if Amber is the best tool, as I have never seen an application which is the other Links to pages?

Any help or suggestions will be beneficial. Thanks in advance

Yes, amber is a page app, because you only go to a page, this Loading the app, you no longer need to get more pages from the server that the amber app handles everything. Large apps such as you are suggesting, you put each object type (model, controller, route, template, scene, etc ...) in the own directory for the organization.

linux - cut matched and put in another location -


How can I cut numbers that are in the square brackets and put them at the beginning of the text? For example:

  some_text123_ [12345] after _some_text: 12345_some_text123 _ [] _ ​​some_text    < P> 

I tried to use perl .

This Pearl should work a liner. $ echoing some Atekote 123_ [123] _some_text | Perl -ne 'print "$ 1_", "$` "," $' \ '\ \ "if / \ [(\ d +?) \] /; $ <->

$ `-

Just to explain the special variable from perl regex engine:

$ 1 - How do I protect it on mail Want to

$ `-

$ '- after everything after match

git - How do I overwrite my local repo with the one on github? -


I got an out-of-date repo with nothing to add on my machine. I got the latest stable branch from Gitub I want to draw

Should I Clone It? I'm not sure.

I think you should be able to fetch all the files, then reset them to the original :

  git fetch --all git reset - hard root / master   

You can probably do it in any order, too.

If you added any files that have not been tracked, clear:

  git clean -f   

The advantage of this approach when cloning a new directory is that you still have some history / if you do not care about that data exactly, then the approach is okay.

codea - How can I build an IOS app on IOS? -


I have created an app with Coda and exported the encoded project. Is there a way to create it on iOS (or Windows)?

Definitely.

Some people on Ininjas have successfully ported the CLAG-LLV Toolchain to run on iOS - Install DEB on your iOS device. You can access your desktop from your computer on the development surrogate ( iPhoneOSX. Y.sdk folder). The device also has to jailbrack.

(I do not remember there is any other package to install, but perhaps from Audiq. To Sidia, etc., just google it)

After this, you Compile and link all files Of course, Xcode uses a proprietary format for project files, so you can not go ahead and expect to build compiler from Xcode project, but for example, all < Code> to specify Write a Mekfail. M files to be compiled. After this you will have an executable file, which you may or may not need to coding.

javascript - Why use === instead of == when comparing a String -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 48 जवाब

    एक स्ट्रिंग मान की जांच करते समय मैं '==' का उपयोग करता हूँ लेकिन मैंने ऐसे उदाहरणों को देखा है जहां '===' उपयोग किया जाता है उदाहरण के लिए,

      के बजाय यदि ("true" == "true") {चेतावनी ('सच'); }   

    इसका प्रयोग किया जाता है:

      यदि ("true" === "true") {चेतावनी ('सच'); }   

    इस के पीछे तर्क क्या है? दोनों का उपयोग मामलों की अपेक्षा के अनुरूप काम करने लगते हैं।

    === ऑपरेटर यह सुनिश्चित करता है कि न केवल मूल्य समान हैं, लेकिन तुलना की जा रही दो वस्तुओं का एक ही प्रकार है; जबकि == ऑपरेटर केवल जांचता है कि दो वस्तुओं के मूल्य बराबर हैं

    जैसा कि टिप्पणी में उल्लेखित @ मैनोोटियम, आप भी इसकी जांच कर सकते हैं

reporting services - Editing RDL Reports with SSDT (SQL Server Data Tools) -


I have some RDL reports that are hosted on my SharePoint 2010 website. I recently installed SSDT device for VS 2012, and I can create a new reporting project to revolve some reports with data sources, but what I really want to do is edit my existing reports on SharePoint Are hosted if I try to "open" the RDL file, then only I get the schema information of the "behind the scenes" report, Ain does not currently support.

I am running SharePoint 2010, with SQL Server Reporting Services 2012, SQL Server 2012 works best with SSRs 'Business Intelligence Development Studio', any assistance that is appreciated.

When you have bids, you can only keep your 'RDL' files in the place you save. Then say: "Add existing" and point to the location and get all the data from the code if you are familiar with the Report Builder, which is basically a water-down version of the bid BIDS, however, make the memory better Because it is an IDE created specifically to design SSIS, SSRS or SSAS applications.

So if you do not have any solutions, then create a 'Report Project', make a datasource (you need to know the database and how to connect it or other datasource) then go to the report folder and Select 'Add existing' and I mentioned above. You can only find your RDL files and they will be visible there.

java - Login with htmlunit and javascript -


I have a quick question about htmlUnit, I hope someone can help me how to access this site Please ?? I have no problem with static pages but I do not like JavaScript popup here, what to do? I use Java HtmlUnit very much thanks

This is the "basic http authentication" mechanism (if you Do not know if google for it) what it is) It is not Javascript HtmlUnit provides something for this, start appearing here:

Neo4j linked list - multiple nodes -


I am working on understanding how to improve performance and use linked lists to create activity feeds on Neo4j I'm still working on learning cipher, so I have a question. I have found an example of some linked lists, but I need a large number of lists so that in the end all the pieces together in my head

I used it The code is found to be more useful than the example of Neo 4G manual. Still I'm a bit confused ... Does anyone modify it so that seven nodes can speak seven items in the link list, and then insert a node in front of it?

Yes, I am trying to add the latest status update at the top of the linked list. This example does not really do this, but it is closed .. Then looking for some models .. No, I'm not really coding yet, Still trying to master Cypher for the first time - For the next two weeks, it will continue to study. There is Ruby on the Railways side work. Just need to understand the linked lists used with the SIEF / Neo.


  create zero = {name: 0, value: 0}, two = {value: 2, name: 2}, zero - [: LINK] -> Two - [: LINK] - & gt; Zero ==== Zero ==== MATCH Zero - [: LINK * 0] - & gt; Before, after - [: LINK * 0 ..] - & gt; Zero, first- [old: LINK] - & gt; Before that WHERE.value? & Lt; = 1 and 1 & lt; = After.value? Dellie Old ==== Zero ==== MATCH P = Zero-New = Create = {Name: 1, Value: 1}, First - [: LINK] - & gt; New Value, New Valley - [: LINK] - & gt; [: Link * 1 ..] - & gt; List_length as zero return length (P)   

Whatever I'm trying to do in my mind, it understands first and zero data sets - I approx. is it, but to see that it has been done with more than two early nodes on one set so that to clear any confusion,

thanks!

The front node is special because there are no link links in it, usually you are concerned with the head node , So it's about taking this node on the head node and removing the head node one step further. Something like this:

  user = node: connect to node_auto_index (user = "me") user [old: MESSAGES] - & gt; Make head old - new_heads = {title: "title", date: 2348972389, text: "text"}, user - [: MESSAGES] - & gt; New_head - [: LINK] - & gt; Head    

r - Select list element based on their name -


I have a named list of vectors that represents events occurring from 2 samples, "A" and "B" ":

  l.temp & lt; - List (SF1_T_A = C (Representative (1:10), SF2_ T_A = C (Representative (9:15)), SF1_ T_b = C (Representative (8:12)) L.temp $ SF1_t_A [1] 1 2 3 4 5 6 7 8 9 10 $ SF2_t_A [1] 9 10 11 12 13 14 15 $ SF1_t_B [1] 8 9 10 11 12   

Now I only I want to select the elements of the list which were from the sample "A" or "B", I could go about doing this with a loop, but on the basis of using this type of list around the ply It depends, and the variations that I have yet to do Has tried:

  llply (l.temp, function (l) {if ((unlist (strsplit (names (l), "_")) [3]) == " A (error) (List (L (L), A () (return (L)}})   

This error I am receiving:

  "_") In error (Stripspit (name (LLS), "_"): Error in evaluating argument 'x' in choosing a method for function 'unlist': character logic   

Help is appreciated on what I am doing wrong.

You list You can find patterns in names that give you an index:

  grep ("_ A $", name (l.temp))   

And then use it in the subset:

  l.temp [grep ("_ A $", name (l.temp))]    

javascript - parent.document gives undefined in Chrome -


In my HTML pages, I have two-level child-to-haveifame hierarchy. I would like to have some manipulation in my hair document I want to get an object of the original window document. I work with Google Chrome.

The parent document 'undefined' in Google Chrome, while it works fine in Mozilla. What's the catch?

First of all, file: 'one.html'

For reference, please find the content of three files that display this problem below, / P>

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input type = "hidden" id = "one_1" name = "a_1" /> & Lt; Iframe id = "one" name = "one" src = "two.html" & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

Other files: 'two.html'

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input type = "hidden" id = "2_1" name = "2_1" /> & lt; Iframe id = "two" name = "two" src = "three.html" & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

Third file: 'three.html'

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Function column () {warning (original document) warning (top.document)} & lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input type = "hidden" id = "three_1" name = "three_1" /> & Lt; Button id = "click" name = "click" onclick = "return callme ()"> Click me & lt; / Button & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

The 'one.html' has been opened with Google Chrome, assuming that when I click on the 'Click Meet' button, two alert alert box 'undefined' value Appear with. When I open 'one.html' in Mozilla, two 'Object HTML Document' Valuable Alert Box appears.

Please find console messages below when clicking on the 'Click Meet' button,

  Try to reach the frame with an unsafe JavaScript URL file: /// C. : / Users / User / Descope / two.html With Frame With URL File: /// C: / Users / User / Desktop / Three Html Domains, protocols and ports must match. Trying to use the frame with three html.html columns: html: 6 onclick three.html: 13 unprotected Javascript url file: /// c: / Users / User / Desktop / From a frame with a URL file: // /C:/Users/user/Desktop/three.html. Domains, protocols and ports must match. 3.html: 7 ColMom three.html: 7 onclick three.html: 13   

Thanks in advance.

In contrast to reaching the bottom-up, I will inject from the top-bottom I select it in an iframe I'll set a variable and store it in a variable like this:

  var frame = document.getElementById ('one');   

And then enter a reference for parents:

  frame.contentWindow.frame_parent_reference = window;   

And then replace it with "two" in the next child iFrame, by the third, we do not ask for the parent or above, but the following tasks Can:

  Warning (frame_parent_reference document); Warning (frame_parent_reference.frame_parent_reference.document);   

is probably not super elegant but it certainly gives you a lot of control (and you can check whether custom reference is present for security or not).

Good luck!

wpf - Translating numeric value in DataTable for editing without marking as Modified -


I have a SQL table that I have read in a DataTable one of the columns I Ratio, but I'd like the value displayed as a percentage of user editing ( ie. multiplied by 100). Is there an easy way to do this translation in DataGrid (or elsewhere?) So that I do not have to repeat every record to multiply by 100, then display it, then all to 100 Split over at all?

Not sure what this will do for you, but you string format - In this way a ...

  & lt; Text box text = "{binding path = percentage, string format = {} {0: P2}}" />   


Note: it really works :) - and e.g. It translates 85.55% to 0.8555 (increase the percentage on wish)

Edit:
Two Actually editing for the keys - you will need a converter

You can use it here

php - How to use multiple languages in one view in CodeIgniter? -


For example, I would load it as language (BTW. I think only the first of these two, the other in English Will be ignored):

  $ this-> lang- & gt; Load ('module_messages', 'english'); $ This- & gt; Lungs-> Load ('module_message', 'check');   

But I can only use something like this:

  this $ $ echo-> lang- & gt; Line ('language_key');   

This does not work:

  $ echo-> lang-> line ('language_key', 'english');   

Any ideas how to resonate both of the language translations in one view at the same time:

  this $ echo-> lang- & gt; ; Line ('language_key', 'english'); Copy $ this- & gt; Lang- & gt; Line ('language_key', 'check');   

How to get such a thing? Unfortunately there is no way to do this because the key is loaded for a language file.

is. This is not specific to loading multiple files.

However, there is a way around it and it is to use a prefix like this:

  $ this-> lang - & gt; Load ('en_module_messages', 'english'); $ This- & gt; Lang- & gt; Load ('cs_module_messages', 'check'); Transcript $ this- & gt; Lang- & gt; Line ('en_language_key'); Transcript $ this- & gt; Lang- & gt; Line ('cs_language_key');   

If you name the language files and keys, then they will definitely fight. Therefore, we add the ISO language prefix for language files and line keys. So that both languages ​​should be allowed to use them both at the same time.

show new info on list click PHP -


I have a PHP page, which creates list-items when a form is submitted, form 5 in the form text If the value sends, two first values ​​of the form are sent back and are displayed in the list element, it looks like:

  $ myFile = 'demo.txt'; $ Content = file ($ myFile); $ Content_array = Explosion ("/ n", $ content); & Lt; Ul id = "list" & gt; & Lt ;? For php ($ i = 0; $ i & lt; count ($ content_array); $ i ++) {$ value = explosion (';', $ content_array [$ i]); $ Heading = $ value [0]; $ Grade = $ value [1]; $ Link = $ value [2]; $ Pic = $ value [3]; $ Desc = $ value [4]; & Lt; Li '& gt;' $ Titel '& Lt; Span & gt; ' $ Grade '& Lt; / Span & gt; & Lt; / Li & gt; ';}? & Gt; & Lt; / Ul & gt;   

I do not know that to make the list element clickable and when you click all the values ​​in the content_ar, it should be displayed and the list should be missing, Still the same page (index.php) but if you click on the first list-element then it is index.php? Page = First and second list-element index.php? Page = second and should be the same .. I think I should use the $ _ GET ['page'] in any way but I do not know much PHP, if If someone knows me in the right direction or knows any online manual for this then I will be happy! <

$ I & lt; Count ($ content_array); $ I ++) {$ value = explosion (';', $ content_array [$ i]); $ Heading = $ value [0]; $ Grade = $ value [1]; $ Link = $ value [2]; $ Pic = $ value [3]; $ Desc = $ value [4]; Echo '& lt; Li & gt; Echo '& lt; A href = "index.ph p? Page = '$ I. & lt; / li & gt;'}}? & Gt;; & gt; 'echo $ title'. & Lt; span & gt; $ Grade. '& Lt; / span & gt; Echo '& lt; / a & gt; & lt; / ul & gt;

Use this to use this page:

  & Lt ;? php $ page = $ _GET ['page']; if ($ page === '0') {// do you want to first page}? & Gt;    

System.ArgumentNullException error with MonoDevelop compiling a c# code -


I have another simple question: I have a C # program which CC file has been written as MonoDevelop (Improved by Xamarin) managed to create this project. However, when I try to run it, I get an error:

  System.ArgumentNullException: the argument can not be zero. Parameter Name: On System.Double.Press (System.String S, Number Style Style, Imageform Provider Provider) [0x00012] In / Private / TMP / Monobild / Build / Build / Mono- 2.10.9 / MCS / Class / Coribib / System on /Double.csumer29 system.double.paras (system.restrictions) [0x00000] /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Double.cs: Sample Namespace at 200. Sample Class.mine () [0x00049] In / Inu / User / Ninaakulisova / Thoughtworks / Sales Inpu With Taxes Ts.cs: 42   

which indicates the following line of code: value [item number, 2] = double. Purse (quantity);

I find mysterious that there is no private / TMP / mobile / build / bootel / MO-2/10/9 / MCS / class / correlate / system / folder on my Mac And when I compiled this code on the online compiler, all went well. Do you know what can be wrong?

Thanks a lot!

    <
  1. This folder is probably present on a machine compiling mono.

  2. Check to see if quant is zero.

php - Do I use a function here? -


I currently have two php files which are set to equal 20 or more similar variables. What is the best way to strengthen it to follow the drought principle? Can I create a function in a third file? Or a class? What is the best practice in this situation?

Thank you!

You should create a square and then create many examples.

javascript - HTML select box with blank to be displayed until you select any of them -


नीचे एक चुनें HTML तत्व की कल्पना करें:

  & lt; id = "myselect" & gt चुनें ; & LT; विकल्प & gt; एप्पल & lt; / विकल्प & gt; & LT; विकल्प & gt; ऑरेंज & lt; / विकल्प & gt; & LT; विकल्प & gt; अनानस & lt; / विकल्प & gt; & LT; विकल्प & gt; केले & lt; / विकल्प & gt; & Lt; / चयन & gt;   

मैं चाहता हूं कि जब यह DOM तत्व प्रस्तुत किया जाए, तो चयनित मान रिक्त और 4 फ़्रेमों में से नहीं होना चाहिए।
मुझे रिक्त को दूसरे विकल्प के रूप में शामिल नहीं करना है।
क्या यह संभव है?

यही मैं किसी अन्य आइटम को इस तरह जोड़ना नहीं चाहता हूं:

  & lt; select id = "myselect" & gt; & Lt; विकल्प & gt; एक आइटम चुनें & lt; / विकल्प & gt; & LT; विकल्प & gt; एप्पल & lt; / विकल्प & gt; & LT; विकल्प & gt; ऑरेंज & lt; / विकल्प & gt; & LT; विकल्प & gt; अनानस & lt; / विकल्प & gt; & LT; विकल्प & gt; केले & lt; / विकल्प & gt; & Lt; / चयन & gt;   

OR

  & lt; चुनें आईडी = "myselect" & gt; & LT; विकल्प & gt; & lt; / विकल्प & gt; & LT; विकल्प & gt; एप्पल & lt; / विकल्प & gt; & LT; विकल्प & gt; ऑरेंज & lt; / विकल्प & gt; & LT; विकल्प & gt; अनानस & lt; / विकल्प & gt; & LT; विकल्प & gt; केले & lt; / विकल्प & gt; & Lt; / चयन & gt;    

यह आपके लिए ठीक काम करेगा

इस HTML का उपयोग < / P>

  & lt; चुनें id = "myselect" & gt; & LT; विकल्प & gt; एप्पल & lt; / विकल्प & gt; & LT; विकल्प & gt; ऑरेंज & lt; / विकल्प & gt; & LT; विकल्प & gt; अनानस & lt; / विकल्प & gt; & LT; विकल्प & gt; केले & lt; / विकल्प & gt; & Lt; / चयन & gt;   

और jQuery के उपयोग में

  $ ('# mySelect')। Prop ('selectedIndex', -1);   

जावास्क्रिप्ट संस्करण (नवीनतम क्रोम, फ़ायरफ़ॉक्स और आईई 11 पर परीक्षण)

  document.getElementById ("myselect")। SelectedIndex = -1         



css - How do i Center this Simple Slideshow? -


I am trying to bring this slide show to the center without success:

It looks like is the situation: absolute which is actually messing with me ...

How do I focus this slide show so that the page's Change the shape, it looks correct, and the slideshow still works correctly?

Please help!

status: full like this:

 < Code> .elem {status: absolute; Width: 200px; Height: 200px; Left: 50%; Margin-left: -100px; / * You can reduce the width by halfway margin byte * /}   



math function in javascript exponentiation -


I have some calculations in JavaScript that contain exponentiation

Do any of you say this This sentence can return 1 1

  warning (0.03 + 1) ^ (271/365) -1;   

thanks

^ You have a Math.pow () :

  WARNING (math.pau ((0.03 + 1), (271/365)) - 1) Are in;    

javascript - does this variable get hoisted no matter what? -


What is the code inside the false block, even if var foo is hoisted on top of the stack Can not be executed at any time?

  function foo () {if (false) {var foo = 'bar'; // Will it never be executed, even if it is hoisted? }}   

I see that this is and it's just confused ... I did not expect that it would be wrapped in false cases.

Yes; The code is hosting before the code runs, so if statement comes out or not true or false is not yet known.

python - filter_interface = models.HORIZONTAL --- 'module' object has no attribute 'HORIZONTAL' -


I keep getting the error:

There is no attribute in the 'module' object ' Horizontal '

Some of my models filter_interface = models.HORIZONTAL .

are defined with filter_interface = models.HORIZONTAL and why am I remembering this feature?

More information: The code was written for the version '0.97-Pre-SVN-Unknown'

and I'm using version 1.4. 1 '

Perhaps this error is because I am using a newer version of the degego

are not specified on the filter parameter model, but without confusing the code on the ModelAdmin objects in 0.97 code, I suspect that the interface has changed. Filtering is part of the django.contrib.admin application, so I recommend reading the documentation.

You may need to factorize the filter_interface parameter to use the attribute.

android - How can I auto-pause the audio player in my app when another app starts to play audio? -


My app runs audio file I want my app to stop audio playback if another app audio starts playing I do not want two audio to interrupt each other. After the second app is playing audio, my app will start playing the audio again. How can I create it? Thank you.

Depending on how your app is running. While the application is running in the foreground (users are considering your screen) or if you have a "service" that is currently in the background and you want to continue the music (Ganga, Lazy Radio etc.) How are you going to handle these things different? Android uses internal system states, to determine which apps should put audio on the speaker. All these audio-manager requests are handled by Audio Focus () Release Audio Focus (), System Call would like to see you the most. For more detailed explanation see the Android Developer API, where you can explain it and document it quite well

python - sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver -


I'm trying to run the alembic migration and when I run < Pre> alembic revision --autogenerate -m "Added initial tables"

This fails to say

  sqlalchemy.exc.ArgumentError : Plugin can not be loaded: Sqlalchemy.dialects: driver   

is the database url

  postgresql + psycopg2: // dev: passwd @ localhost / Db   

and I have psycopg2 installed in my VirtualWhen

  $ yolk -l flask-login - 0.1.3 - Active Flask-SQLLame - 0.16 - Active Flask - 0.9 - Active Ginja 2 - 2.6 - Active Mac - 0.7.3 - Active Markup - 0.15 - Active Python - 2.7.2 - Active Development (/ System / Library / Framework / Python Framework / Version -2.7 / lib / dynload) 7 / lib-dynload SQLAlchemy - 0.8.0 - Active Werkzeug - 0.8.3 - Active alabic - 0.4.2 - active antiorm - 1.1.1 - Active apps - 1.0.1 - active Distribution - 0.6.27 - Active Messenger - 0.0.2 - Active OSScript - 0.0.4 - AC Tive pep8 - 1.4.5 - Active Pipe - 1.1 - Active psycopg2 - 2.4.6 - Active wsgiref - 0.1.2 - Active Development (/ System / Library / Framework / Python.framework / Versions / 2.7 / lib / python2.7) Yolk - 0.4.3 - Active   

Could this cause the problem?

Here's how to generate an error:

  & Gt; & Gt; & Gt; Secularic import * * & Gt; & Gt; Traceback (most recent call final): ... etc sqlalchemy.exc.ArgumentError: plugin can not be loaded: sqlalchemy.dialects: driver   

I can say that you In fact, you are not using postgrascape URLs, you think you are - you're probably calling a default-generated alembic.ini.

c++ - Redefinition of class error -


I calculate the fourth to make'm designing a program that takes three points and parallel chart I By what I'm doing:

  struct Smantrlogram public polygon {Smantrbhuj (Point TL, Point Trash, Point blocks) Point bar; Int number = tr.y-tl.y; Int denom = tr.x-tl.x; Br.x = denom + bl.x; Br.y = number + bl.y; }}; Paralegal :: Paralegal (Point TL, Point Tr, Point Blow) {Joint (TL); (Tr); (BL); (Br); };   

While compiling I get the following error:

  hw6pr2.cpp: 15: 1: error: Parallagrag re-definition :: Paralelogram (Point, Point, Point) Ã ¢ hw6pr2.cpp: 6: 2: error: a Smantrlelagra :: Paralelogram (Point, Point, Point) is defined before   

My question is: If The way I am right from the polygon class? If so, why am I getting this error?

You Parallelogram :: There are two definitions of Parallelogram (Point, Point, Point) < / Code>; One out of the class and one out You can not have several definitions of the function.

Let's assume that addition adds a dot to your polygon , it seems that you really want just to be a part of the definition first you can define it in your class:

  struct Smantrlogram public polygon {Smantrbhuj (Point TL, Point Trash, Point blocks) {Point bar; Int number = tr.y-tl.y; Int denom = tr.x-tl.x; Br.x = denom + bl.x; Br.y = number + bl.y; (TL); (Tr); (BL); (Br); }}; Alternatively, you can declare it inside your class and then define it:  
  struct parallelogram: public polygon {parallelogram (point tl, point tr, point bl) ; }; Parallelogram :: Parallel Clause (Point TL, Point Tr, Point Blow) {Point Br. Int number = tr.y-tl.y; Int denom = tr.x-tl.x; Br.x = denom + bl.x; Br.y = number + bl.y; (TL); (Tr); (BL); (Br); }    

Erlang: Storing data in a record properly and retrieving it? -


मैं आउटपुट के साथ निम्नलिखित कोड चलाया

  एरलांग R16B (erts-5.10.1 ) [एसपीपी: 8: 8] [एएससीएनसी-थ्रेड्सः 10] एशेल वी 5 .10.1 (एग्रोटेस ^ जी) 1 & gt; RR (record_io)। [स्मृति] 2 & gt; record_io: दुकान (99)। संग्रहित: 2 ठीक 3 & gt; record_io: प्रिंट ()। संग्रहीत: 2 ठीक 4 & gt;   

मैं क्या जानना चाहता हूं कि मैं कैसे ठीक से एक रिकॉर्ड को रिकॉर्ड में रखूँगा, जाहिर है कि record_io: print () के लिए आउटपुट। कोड> 99 और नहीं 2 । कोड है Heres।

  -module (record_io) -आयात ([स्टोर / 1, प्रिंट / 0]) -रेकॉर्ड (स्मृति, {value})। स्टोर (मूल्य) - & gt; # स्मृति {मान = मान}, आइओ: प्रारूप ("संग्रहीत: ~ पी ~ एन", [# memory.value])। प्रिंट () - & gt; Io: प्रारूप ("संग्रहीत: ~ पी ~ एन", [# memory.value])।   

मैंने यह एक और तरीका कोशिश की है और वह भी काम नहीं कर रहा है।

  4 & gt; ग (record_io)। Record_io.erl: 6: चेतावनी: एक शब्द का निर्माण किया गया है, लेकिन कभी भी इसका उपयोग नहीं किया गया {ok, record_io} 5 & gt; RR (record_io)। [स्मृति] 6 & gt; record_io: दुकान (एस, 10)। * 1: चर 'एस' अनबाउंड 7 & gt;   

संशोधित record_io के लिए कोड।

  -मॉड्यूल (रिकॉर्ड_ओ) -आयात ([स्टोर / 2, प्रिंट / 1]) -रेकॉर्ड (स्मृति, {value})। स्टोर (एस, मूल्य) - & gt; एस # मेमोरी {मान = मान}, आइओ: प्रारूप ("संग्रहीत: ~ पी ~ एन", [एस # मेमोरी.वल्यू]), एस प्रिंट (एस) - & gt; Io: प्रारूप ("संग्रहीत: ~ पी ~ एन", [S # memory.value])।   

संपादित करें: समाधान।

कोड

  -module (record_io) -आयात ([स्टोर / 1, प्रिंट / 1]) -रेकॉर्ड (स्मृति, {value})। स्टोर (मूल्य) - & gt; Rec2 = # स्मृति {मान = मान}, आइओ: प्रारूप ("संग्रहीत: ~ पी ~ एन", [रिक 2 # मेमोरी.वल्यूए]), रिक 2 प्रिंट (एस) - & gt; Io: प्रारूप ("संग्रहीत: ~ पी ~ एन", [S # memory.value])।   

कमांड लाइन।

  रिक = रिकॉर्ड_ओ: स्टोर (99) record_io: प्रिंट (आरईसी)। संग्रहीत: 99 {स्मृति, 99} संग्रहीत: 99 ओके    

आप रिकॉर्ड को संशोधित नहीं कर सकते Erlang। केवल नए लोग बना रहे हैं देखें

Sorting a text file in Java -


I have a word that requires sorting in alphabetical order using java. The words are located on different lines.

How would I go about this, read them in an array list and then sort it out?

Post-text "itemproc =" text ">

This is a simple four-stage process, which includes three steps in three steps: Stackworflow Question:

  1. Store each Java string in an array (does not appear to require you to reference it.)


java - Optimize calculation of prime numbers -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 2 जवाब
  • 8 जवाब

    मैं प्रोजेक्ट ऑलर से कोशिश कर रहा हूं और मेरा एल्गोरिथ्म बहुत धीमा है। क्या किसी को पता है कि यह कैसे अनुकूलित करें? वह संख्या जिसका मैं गणना कर रहा हूं 600851475143 एल है यह गणना करने के लिए हमेशा लेता है इसलिए मुझे गणना की गति बढ़ाने के लिए एक तरीका चाहिए

    LOGIC:

    • 3 से सभी नंबरों तक उस नंबर -1 तक कॉल करें
    • इनमें से प्रत्येक नंबर के लिए जांचें कि क्या वे विभाजित करके प्रधान हैं उनमें से सभी नंबरों के बीच और यदि उनमें से किसी के द्वारा विभाजित न हो तो वे प्रधान हैं।
    • यदि प्रधानमंत्री तब उन्हें सरणी में जोड़ते हैं, <पूर्व> सार्वजनिक स्थिर शून्य समस्या 3 (लंबी संख्या) {लंबी संख्या 2 = संख्या; लंबा sqrtNumber = (लंबा) गणित। वर्ग (संख्या 2); Int indexNum = 1; बूलियन isPrime = गलत; इंट प्राइमनाम [] = नया इंट [2]; प्राइमनाम [0] = 2; // के लिए एक सरणी में डालता है (int y = 3; y & lt; sqrtNumber; y ++) {isPrime = true; के लिए (इंट न्यूम = 2; एनएएम & lt; y; द न्यू ++) {// यदि y किसी भी संख्या से समान रूप से बांटता है तो यह प्रधान नहीं है अगर (y% theN == 0) {// सरणी में स्टोर नहीं हैप्रति = गलत; टूटना; }} यदि (isPrime == सच) {// सरणी में जोड़ें system.out.println (y); // डाल y सरणी में और सरणी // सिस्टम system.out.println (): "+ y" exapnd; प्राइमैनम्स [सूचकांक] = y; Int [] newArray = नए int [primeNums.length + 1]; सिस्टम। अर्रेकॉपी (प्राइमैनम्स, 0, न्यूअरे, 0, प्राइमैनम्स. लैंप); प्रधानमंत्री = नयाअरेरे; indexNum ++; }}

      ********** UPDATE **************

      मैं वर्गमूल की गणना करता हूं जो गणनाओं को बहुत बढ़ा देता था, लेकिन मैंने कुछ और किया जो कि एक बार तोड़ने के लिए तोड़ने वाला वक्तव्य जोड़ना था, जब मैंने पाया कि यह संख्या प्रधानमंत्री नहीं थी। मैंने इन परिवर्तनों को प्रदर्शित करने के लिए उपरोक्त कोड को संपादित किया है।

      मेरा एल्गोरिदम अभी भी प्रमुख कारकों की गणना करने के लिए गलत है, हालांकि मुझे इसके बारे में एक नज़र रखना होगा और शायद एक नया प्रश्न उठाए। < एचआर>

      आपको हर नंबर से विभाजित करने की जरूरत नहीं है। आपको केवल प्रत्येक प्रधान संख्या से 2 के बीच और आपके नंबर का वर्गमूल विभाजित करना होगा।

jpa - Java Apache Derby Database Restoration Error -


I am developing a JSF + JPA application that includes Netbeans & amp; JavaDB I have copied the entire database folder when the database is offline as it has been instructed. When I copied the specific database sub-folder to another derby location or created the entire database folder as a new java database location in the Netbeans Java database, it returns the following error.

  Unable to connect to jdbc: derby: // localhost: 1527 / hr org.apache.derby.jdbc.ClientDriver (DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040 SQLERRMC: The connection can not be established to fail to initialize the database 'HR', see the next exception for the details: SXLSTAT: XSDatabaseTice D: \ Data \ PDHS \ HR in an incompatible format with the current version of the software Database was created or upgraded by version 10.8 Ia was.).   

How can I resolve this error?

Thanks in advance.

Message says:

  Created by database version 10.8 or Was upgraded.   

Which version of the derby is running?

java - org.codehaus.jackson.map.JsonMappingException using ObjectMapper -


I am trying to call my REST service using an object mapper.

  url = new URL ("http://phx5qa01c-8539.host.com:8080/bservice/BService/v1/getSimpleString"); String str = mapper.readValue (url, String.class);   

and the URL will give me this string back -

{attributes: [{nm: "sellers2" vt: "java.util.Map" status "Success": jsonValue: "{vv": {"regSiteId": null, "userstate": null, "userId": 609}, "cn": 1}], "LMD": 20130206211109} "}]} < / P>

When I'm trying that URL on the browser, I am withdrawing the string above. But as soon as I do the same thing in code I am getting this exception -

org.codehaus.jackson.map.JsonMappingException: can not deserialize the example of java.lang.START_OBJECTBen from the token

Trying to deserialize Jackson, your JSON as a new string object, but can not find the attribute eg a method String.setAttributes (). Any deserialisation For errors, 'these are to be taken out of the START_OBJECT token'; there is more information under the stack trace. TI.

Try:

  Map myMap = Mapper.readValue (url, Map.class);   

Or if you really want a string, do not use Jackson to read the URL in the string using standard Java code:

  String str = IOUtils.toString (url);    

python - Locating specific keys and corresponding values in dictionary -


मैंने निम्न कोड का कोड लिखा है:

  def all_di (fl): dmm = {} श्रेणी में (2): के लिए मी में: में मीटर के लिए सीमा (लेन (i) -1): temp = i [m: m + k + 1] अगर अस्थायी रूप से dmm: dmm [temp] + = 1.0 अन्य: डीएमएम [temp] = 1.0 ## रिटर्न dmm p = raw_input ("2 एए लंबी सीक प्रविष्ट करें:") sum = 0 x, y में dmm.iteritems (): यदि x == p: n1 = Y के लिए एल, एम में dmm.iteritems (): अगर एल [0] == पी [0]: sum = sum + m प्रिंट फ्लोट (एन 1) / फ्लोट (योग) all_di (inh)   <पी> यदि इन्ह =  {'VE': 16, 'GF': 19, 'VF': 23, 'जीजी': 2}   

कोड के रूप में काम करता है इस प्रकार है:

  2 एए लंबी सीक दर्ज करें: वीई   

परिणाम होगा = 16 / (16 + 23) = 0.41

यह कैसे काम करता है: समारोह इनपुट में दर्ज किए गए कुंजी के समान शब्दकोश के लिए शब्दकोश dmm खोजता है उदाहरण यहां लिया गया 'वीई')। यह इसके मान को संग्रहित करता है और फिर सभी कुंजी-मूल्य जोड़े के लिए खोज करता है जिनके पास आम में पहला अक्षर होता है और इसके सभी मान जोड़ता है और एक अंश देता है।

  VE = 16 ** V ** E + ** वी ** एफ = 39 = 16/39 = 0.41   

मुझे क्या चाहिए: फ़ंक्शन को बरकरार रखते हुए, मैं एक माध्यमिक शब्दकोश रखना चाहता हूं जो कि हर प्रमुख-मूल्य जोड़ी के लिए पुनरावृत्त करता है डिक्शनरी में और उस के आंशिक मूल्यों को एक अलग शब्दकोश में संग्रहीत करता है जैसे कि:

  new_dict = {'VE': 0.41, 'GF': 0.90, 'VF': 0.51, 'जीजी ': 0.09}   

मैं प्रिंट कथन को हटाना नहीं चाहता क्योंकि यह मेरे प्रोग्राम के लिए आउटपुट है। मुझे इसके बाद के कार्य के लिए new_dict की आवश्यकता है।

  def all_di (Fl, p = 0): dmm = {} interactive = p == 0 यदि इंटरेक्टिव: p = raw_input ("2 एए लंबी सीक प्रविष्ट करें") अगर पी में fl: numer = fl [p] denom = 0.0 टी: [टी] [0] == पी [0]: denom = denom + fl [t] यदि इंटरैक्टिव: प्रिंट संख्या / denom return numer / denom inh = {'VE': 16, 'GF': 19, 'VF': 23, 'जीजी': 2} all_di (inh) new_dict = {x: all_di (inh, x) inh में) प्रिंट new_dict    

Java: Recursively Finding the minimum element in a list -


I'll call it homework. I'm just looking for some points I'm ejecting my brain with this one, and I'm not getting it for my life. We are asked to find the minimum element in a list. I know that I need a novel here, but after that I'm not sure. Any hints would be great thanks.

  / ** Find the minimum element in the list. * * @ Ultimate * integer list * * * return the minimum element in the list / public static end minute (list & lt; integer & gt; t) {if (t.size () == 1) {return t.get ( 0); } And {list & lt; Integer & gt; U = T. SULIST (1, TCISE); In the most common sense, recursion is a concept based on breaking a job, and    

  1. Breakdown of work How are you making each step "simple" ?
  2. Recursive call. At some point your function should call itself, but with less "work".
  3. What is the case of the base case one (usually trivial) that will stop the recursive process?

    In your case, you are trying to create a function min which is a list. You are right in thinking that you can reduce your work by making a list short by one time (first thing can be taken out of the element). As others have mentioned, this idea is to check the first element (which you have just drawn) against the "rest of the list". Anyway, where the leap of faith comes. At this point, you can assume that your minute function will work on the novel, and just call a function on the novel (recursive call). Now you have to make sure all your calls will be back (i.e., make sure that it will not always buy again). This is where your base case comes. If your list size is 1, then only one element is the smallest in the list. There is no need to call again minutes , just return it (the part you already did in your original post).

jquery - AJAX and 200 OK messages: Are they required to complete a server side call? -


We are developing tracking systems that use the WordPress AJAX API, 3G calls on 3G AGX contracts and WordPress AJAX APIs This refreshes the page.

I see that sometimes my data entry efforts are failing at the back end and I agree (this is probably wrong) that this is happening because in our last AAGX call 200 is already clear, and breaks the connection, which means that the data is never stored.

Now I am under the assumption that as soon as a jQuery.ajax ({type: ' POST 'call has been issued, I can immediately close the page Even then my server side which I posted to receive, and

but my data test is showing that some data is not constantly being recorded. Do I have the right to think that this My last AJAX call should not be related to finishing (and before reloading the page) a pre-ajax call is cleared with 200 OK?

Thanks for any help!

Yes, yes If you send an AJAX request to the server, you can close the page, complete the server request (code execution).

But there is a point address, you do not know that your request has arrived at the server or not.

  jQuery.ajax ("htpp: //", {type: 'POST'});   

This is an asynchronous request, so it will execute the code in the background. Execution of this line of code does not mean that you have sent a request, after some time it works in the background.

  1. jQuery will parse your code, see what you want,
  2. This will create a xmlhttprequest object with the set option.
  3. And finally it will send the request to the server.

    So if you close the page immediately, before the third step, the request will not be sent.

    I recommend that you send a synchronize to the AJAX request and wait for any feedback on the fresh / closed page. Because Synchronous AJAX can temporarily lock the browser request, because the request is active.

      JQuery.ajax ({url: url, success: function (r) {}, async,  

    In this case, you must set an async fake to make it synchronous, : wrong});

C++: BOOST-ASIO No server causes client to crash? -


कनेक्टर पर निम्नलिखित कोड क्रैश हो जाता है boost :: asio :: connect (s, iterator); आउटपुट के साथ: <प्री> कनेक्टर से पहले: यह एप्लिकेशन रनटाइम को असामान्य तरीके से समाप्त करने का अनुरोध किया है। अधिक जानकारी के लिए कृपया एप्लिकेशन की सहायता टीम से संपर्क करें। प्रक्रिया ने 3 (0x3) निष्पादन समय वापस किया: 1.281 s जारी रखने के लिए कोई भी कुंजी दबाएं।

मेरे पास स्थानीय सर्वर से पोर्ट 4001 पर चलने वाला कोई सर्वर नहीं है और मुझे आश्चर्य है कि अगर इस क्रैश को रोकने के लिए कोई रास्ता नहीं है, तो सर्वर कुछ के लिए नहीं चल रहा है कारण अभी तक ग्राहक अभी भी सॉफ़्टवेयर को कुछ हद तक चल सकता है दूसरे शब्दों में, क्या यह देखने का एक तरीका है कि कोई सर्वर प्रोग्राम को दुर्घटनाग्रस्त होने के बिना मौजूद है या नहीं?

यह कोड है

  // // blocking_tcp_echo_client.cpp // ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // कॉपीराइट (सी) 2003-2012 क्रिस्टोफर एम। कोहलॉफ़ (क्रिस कोहलहॉफ़ डॉट कॉम में) // / / बूस्ट सॉफ्टवेयर लाइसेंस, संस्करण 1.0 के तहत वितरित। (Http://www.boost.org/LICENSE_1_0.txt पर // फ़ाइल LICENSE_1_0.txt के साथ देखें या प्रतिलिपि देखें) # # शामिल करें & lt; cstdlib & gt; # शामिल करें & lt; cstring & gt; # शामिल करें & lt; iostream & gt; # शामिल करें & lt; boost / asio.hpp & gt; Boost :: asio :: ip :: tcp का उपयोग कर रहा है; Enum {max_length = 1024}; Int main (int argc, char * argv []) {// try // {// if (argc! = 3) // {// std :: cerr & lt; & lt; "उपयोग: अवरोधक_टीसीपी_चो_क्लंट & lt; होस्ट & gt; & lt; पोर्ट & gt; \ n"; // वापसी 1; //} boost :: asio :: io_service io_service; Tcp :: रिलावर रिज़ॉल्वर (io_service); // tcp :: रिज़ॉल्वर :: क्वेरी क्वेरी (टीसीपी :: वी 4 (), एजीआर [1], एजीआर [2]); Tcp :: रिजःवर :: क्वेरी क्वेरी (टीसीपी :: वी 4 (), "127.0.0.1", "4001"); Tcp :: रिजॉल्वर :: इटरेटर इटरेटर = रिज़ॉल्वर। रिसोल (क्वेरी); Tcp :: सॉकेट एस (io_service); Std :: cout & lt; & lt; "कनेक्टर से पहले:"; बढ़ावा :: एएसआईओ :: कनेक्ट (एस, इटरेटर); Std :: cout & lt; & lt; "कनेक्टर के बाद:"; नेमस्पेस एसटीडी का उपयोग करना; // स्ट्रेलन के लिए Std :: cout & lt; & lt; "संदेश दर्ज करें:"; चार अनुरोध [max_length]; Std :: cin.getline (अनुरोध, max_length); Size_t request_length = strlen (अनुरोध); Boost :: asio :: write (s, boost :: asio :: buffer (अनुरोध, request_length)); चार उत्तर [max_length]; Size_t answer_length = boost :: asio :: read (एस, बढ़ावा :: एएसओ :: बफर (उत्तर, अनुरोध_ लैंघ)); Std :: cout & lt; & lt; "उत्तर है:"; Std :: cout.write (उत्तर, उत्तर_ लैंबी); Std :: cout & lt; & lt; "\ N"; //} // catch (std :: exception & amp; e) // {// std :: cerr & lt; & lt; "अपवाद:" & lt; & lt; E.what () & lt; & lt; "\ N"; //} वापसी 0; }    

बढ़ावा :: asio :: connect पर फेंकता है त्रुटि। इसलिए कोशिश {} ब्लॉक और कैच {} ब्लॉक जो कि टिप्पणी की गई है, क्रैशिंग के बजाय त्रुटि का पता लगाने के लिए उपयोगी होगा।

रिज़ॉल्वर। रिसोल (क्वेरी) रिटर्न .end () एक वैध इटरेटर के बजाय यदि पोर्ट नहीं मिला है, तो आप इसे बहाल प्रलेखन से connect

कॉल करने से पहले इटरेटर का परीक्षण कर सकते हैं:

  • @ थ्रू बूस्ट :: प्रणाली :: system_error विफलता पर फेंक दिया। यदि अनुक्रम
  • खाली है, तो संबद्ध @ c error_code boost :: asio :: error :: not_found।
  • अन्यथा, इसमें अंतिम कनेक्शन प्रयास से त्रुटि है।

android - How to draw a vertical line on a CubicLineChart? -


I am displaying a beautiful chart that contains two XYSeries in each series, there are 24 values ​​in the x-position 0 to 23 Are plotted till A series reflects the temperature in a 24-hour period, the second series shows the rainfall probability in the same 24 hours.

The problem when I try to add a third series to illustrate a single vertical line (used as a "cursor", with a OnTouchListener ) . This idea is to attract a 2-Datapoint series which will be presented as a single vertical line that I can use for my cursor.

XYSeries cursorLine = new XYSeries ("", 2); Cursor Lean.ad (5, 0); CursorLine.add (5, 100); Dataset.addSeries (cursorLine);

It does not display anything.

I also tried to use two very close X values ​​suggested by ACE donation:

  XYSeries cursor lines = new XYSeries ("", 2); CursorLine.add (5.00000, 0); CursorLine.add (5.00001, 100); Dataset.addSeries (cursorLine); Unfortunately, it spreads the "cursor" line across the entire width of the chart, as if it assumes that it is made up of 24 data points instead of the specified 24 digits. Example:  

Enter image details here

I also add Attempted 24 data points, 23 of which have a Y value of 0 and only one (on x position 5) is the Y value of 100. Since it is a cubic line chart, so my cursor appears with the "heel" below; On the lower part of the chart, other 23-digit cursors are also visible. Example:

shows cursor line heel

I have settings The nearest data indicates the x value of +/- 0.00001, but does not remove the high heel - which is as small as the smallest until I set it horizontally to the cursor position. .

I am playing with this for the last hour or so, but I can not find a simple vertical line shown. any idea?

The problem is that you are using scale = 2 for the vertical line series. Each scale calculates the visible data range and attempts to fit the data as it appears completely, I suggest that you add your vertical line data to a scale already present.

delphi - Http get json into string -


I am trying to get a json response through a HTTP GET method for a string but I have found that : Enter image details here

I am using code like: < / P>

  memo1.Text: = idhttp1.Get ('http://blabla.com/bla.php');   

This gives the JSN data I need to get Jason's response to Memo 1.

How can I do this?

I got a solution This code works right.

  Function GetURLAsString (aURL: string): string; Var LHTP: TIDHTP; Alstream: Teestring Stream; Start lHTTP: = TIdHTTP.Create (zero); LStream: = TStringStream.Create (Results); Try lHTTP.Get (aURL, lStream); LStream.Position: = 0; Results: = lStream.ReadString (lStream.Size); After all, free and offline (LHTPP); FreeAndNil (lStream); End; End;    

isa swizzling - I'm having trouble adding two matrices in python -


I want to add two motherhood to dragon 3, but the problem is that when i input Adding the program

This is my code

  def addmatrix (a, b): d = [] n = 0 while n & lt; Lane (A): C = [] K = 0 while K & lt; Lane (a [0]): c.append (a [n] [k] + b [n] [k]) k + = 1 n + 1 d.append (c) return ddef main (): a = Input (insert a matrix: ") B = input (" Enter other matrix: ") Print (Adometrics (A, B)) Main ()   

If input is

Enter a matrix: [[5,6], [1,2], [2,4]]

Enter another matrix: [[2,3], [-6,0], [-2, 4]]

comes in the form of output [['[[['], ['[[[ '' ['52'], [','], ['63'], [']]'], [','], ['], [' [['], [' 1- '', '[', 6 '], [' 2, '], ['] 0 '], [',] '], [', '], [' ['], [' 2 '], [',' '], [' 42 '], ['], '], ['] ']]]

But if I input from the program and make it so that

  def (main): a = [[5,6], [1,2], [2, 4]] B = [[2,3], [-6,0], [-2, 4]] print (admatrix (A, B)) main ()   

output Then comes as the [[7, 9], [-5, 2], [0, 8]] which is correct.

Is there any way that I Can my program work so that when a person joins two matrix together? I am new in Python so any help would be appreciated :)

You have to convert the user Now input into a python object, this is a string.

You can use eval (if not should be used, if you do not know what your users will input I I can type in __ import __ ('OS') system ('rm /some/file.txt') and Python will delete a file):

  a =   

or you can use ast.literal_eval , which is secure: Import from literal_eval ... a = Literal_eval (input ("Enter a matrix:"))

URL Schemes on iOS -


I try to launch an application (App1) from another application (App 2) using URL schemes I am here. Is there a way I can check the application name which is launching my app? Example App2 has launched App 1 (so can I check the name of app 2 1 app 1) Or can we get information on the source starting at App 1?

Thank you in advance

To apply to launch from any other application For, you need to configure "Supported URL Schemes" in your information plist file. You will be able to know the reasons for the following method in your app delegate along with your application launch.

  • (BOOL) Application: (UIApplication *) Application FinishLaunchingWithOptions: (NSDictionary *) launchOptions

    Here are the launch options

    A dictionary indicating the application that was launched (if any). In this situation, the contents of this dictionary can be empty where the user started the application directly

    are the possible keys

    NSString * const UIApplicationLaunchOptionsURLKey; NSString * const UIApplicationLaunchOptionsSourceApplicationKey ; NSString * const UIApplicationLaunchOptionsRemoteNotificationKey; NSString * const UIApplicationLaunchOptionsAnnotationKey; NSString * const UIApplicationLaunchOptionsLocalNotificationKey; NSString * const UIApplicationLaunchOptionsLocationKey; NSString * const UIApplicationLaunchOptionsNewsstandDownloadsKey;

objective c - Game Center login -


My game players need to log in with the apple game center. If they are a new player for the game, then they must first sign in to the game center because I use the player ID as part of the data used to set up a new user account.

I have a game center class that I use to sign in to the player, or signs them to sign if they are not already, then here is the main code .

  - (zero) setup {gameCenterAuthenticationComplete = NO; If (! IsGameCenterAPIAvailable ()) // // Game Center is not available NSLog (@ "Game Center is not available."); } And {nslog (@ "game center is available."); __Week type (self) weak Self = self; // Maintaining cycle error GKLocalPlayer * localPlayer = [GKLocalPlayer localPlayer]; // localPlayer public GKLocalPlayer __weak GKLocalPlayer * Vulnerable Player = Local Player; / Maintaining cycle error deletes weak player AuthenthenticateHandler = ^ (UIViewController * viewController, NSError * error) {if (viewController! = Null) {[weakSelf showAuthenticationDialogWhenReasonable: viewController]; } And if (weak player. Authentic) {[weak self certified player: weak player]; } And {{Weak gameman disabled]; }}; }} - (void) showAuthenticationDialogWhen appropriate: (UIViewController *) controller {[[UIApplication shared application] delegate] window] root view controller] PresentViewController: controller animated: Yes Full minus]; } - (void) certified player (Jikelokelpleyr *) Player {Anselog (@ "% @% @% @" player. Pleyraidi player. DisplayName, Kiladhiklias); LocalPlayer = player; GameCenterAuthenticationComplete = Yes; } - (zero) disableGameCenter {}   

And it works fine. But I have 2 problems

1) As I said that the player is new, they have to sign in to the Game Center before proceeding with the new user registration. This new registration is in the second category. So how do I hear GameCenter's variables gameCenterAuthenticationComplete = YES to other games? I read somewhere else that I can use a representative, but does he work in things? Will a notification be better in one object?

2) And more importantly, what if the player closes the modal to sign into the game center, where the call back / block where the modal is closed? So can I prompt them to sign in again or at least I can put a msg on the screen?

1) You gameCenterAuthenticationComplete by way of example that in your class header AppDelegate.m import and representatives of the interface can use your gameCenterAuthenticationComplete in (Appdelegate.h) in declaring an instance of that class came representative or you can reach sharedinstance class are the following measures adopted in your classroom Yourclass.h file

  + (YourClass *) shared person;   

and in YourClass.m

  Fixed YourClass * example; + (YourClass *) Shared Instruction {@ Synchronize (self) {if (example == zero) {Example = [[YourClass alloc] init]; }} Return example; }   

2) called on cancel button this method gamecenterleaderboardviewcontroller

  - leaderboardViewControllerDidFinish (zero): (GKLeaderboardViewController *) view_controller {[self.gameCenter DismissModalViewControllerAnimated: no]; [View-controller release]; }    

Apache server log highest traffic using bash -


I have an Apache server log and trying to determine which IP address has generated more traffic I have already been able to format it so that its IPS and byte traffic can be made:

  xxx.xxx.xxx.xxx 915925 yyy.yyy.yyy.yyy 1193 zzz.zzz Zzz.zzz 2356   

So now I'm looking for a method to add and add the bytes of the same IP and then only the top Find the value.

Any idea

If you have IP and traffic bytes in the file, So use the following to complete the work.

  1. cat file | Pearl- '$ H {$ F [0]} + = $ F [1]; END {sort keys for% h} {printf qq [% s% d \ n], $ _, $ h {$ _}}} | Sort-2-n-r

  2. awk '{A [$ 1] + = $ 2; Next} for END {{I in A} {print i, a [i]}} 'file | Sort -k2 -n -r

Javascript to enable, disable drop down menu in JSP file having Java code only, no HTML directly -


Let me introduce the design.

Each field in a JSP is created by a map . The name of the label, input type (drop down or other), input value, default value, etc. is added to map , say Map nameAttributes . Another class is general authors , which I do not have access to, which takes the value from map , parses them and writes the appropriate HTML code.

After writing the map, writer.writeSelectBox (nameAttributes); It is called .

Now, the requirement:
is a drop-down menu, depending on its chosen value, some other drop-down menus are disabled (shown in the UI but not modified) Or enable it. Since, I am not writing HTML code for additional fields, I can not write the function call event to do my work.

I have noticed that the JS function is called on onMouseOut event from the field, as shown in "View Source" . So I thought I could write my code to see the field value and affect other drop-down menu. But if I type warning in the JS function (check only), this will not warn me, this means that the function is not called and I can not write the enabled / debable code.

Is there any way to get a job? Enabling and disabling should depend on the user how to select from one of the drop-downs.

Sample code:

  & lt;% map name = newHashmop (); NameAttr.put (GeneralConst.INPUT_MESSAGE, Const.MSG_FIELD_NAME); // ..... Author. All selected box (named etter); & Gt%;   

Need immediate help, thanks.

See the JSP page, it is clear that some areas of Change and On-HouseOut Event etc. , And in the GeneralWriter class, those things are being written as outside stream like

  out.println ("& lt; td Abrap> Selection Name = "+ strName"); Out.println ("style = \" width: "+ strWidth +" px \ ""); Out.println ("On Change =" + On Change);   

So, instead of using the existing code I added my own method and introduced an on-change event. The type of " On Change " which you are looking for (right one) is java.lang.String and it was to be passed by JSP, as the behavior I wanted I want to do special work to call or call for a particular JSP.

Now I added the following to JSP

  & lt; Body & gt; & Lt; Script & gt; Window.onload = setModeForPara2 ('MemberTip','EmberState ',' Ceccestatus'); Function reset (event) {setModeForPara2 ('MEMBERTYPE', 'EMBARTSTATE', 'Ceccestatus'); } & Lt; / Script & gt; & Lt; / Body & gt;   

Where are the names of the criteria drop down menu, and setModeForPara2 () is an incompetence / js function to enable because my requirement is in the original post I went . It checks whether the merchandise is 0, then the incompetent state and gray color to be presented in the Amberstate and Cequestats drop-down menu, otherwise enable them and remove the gray color.
resetevent (uri) There is also a JS function called when the reset button is clicked to present the state to the disabled state and the status field.

Thus, the setModeForPara2 () function is called whenever: 1 page has been loaded,
2. Change the value of the first drop-down (MMEBARTEEE) Is, and 3 The reset button is clicked. Solution of



cocoa - Running .app by double click on it and linking dylibs -


Will someone tell me how to run (run) .app (mac executable) xcode. And i try cocoa usage How, how Link or Load Designated Deals to AP.

and information using the DLDDLIRIBRRIAPP environment variable. How to give the relative path to the dial in the list.

Thank you in advance

It seems that you can store it directly You can run it by double-clicking "Explorer appel" in the organizer, and finally, you can copy it anywhere to run it.

By the way, when you first click on the Mac to launch this app for the first time, then only you will not run when you use "open" in the right-key menu to open it. So, it will work for you.

Line Detection openCV -


I'm running a code to find lines in OpenCV 2.1 in Visual Studio 2008, here's a part of the code :

  IplImage * src = cvLoadImage ("parrot Pollock"); IplImage * dst = cvCreateImage (cvGetSize (source), 8, 1); IplImage * color_dst = cvCreateImage (cvGetSize (source), 8, 3); CvMemStorage * storage = cvCreateMemStorage (0); CVSeq * line = 0; Int i; Int choice = 0; CvCanny (source, DST, 10, 100, 3); Code   

compile the code correctly, but when run returns the following error: OpenCV error: the combination of formats (), file ........ \ Ocv in the unsupported format or unknown function \ Opencv \ src \ cv \ cvcanny.cpp, line 66

Any indication on how to fix it ...

By default when you load an image it loads as a color image. Kenny needs the image input and output of a channel. Therefore, I think that if you load your image as a gray scale or later change it into a gray scale, then it should work.

Either:

  IplImage * src = cvLoadImage ("parr. .png", CV_LOAD_IMAGE_GRAYSCALE);   

or:

  cvtColor (src, src, CV_RGB2GRAY);    

jqGrid change formatter of cell when cell has no value -


I have a jqGrid that has one of the columns set formatter as hyperlink

  {name: 'IDNumber', index: 'IDNumber', classes: 'hyperlink', search: correct, stype: 'text', formater: 'sholin', format options : {BaseLinkUrl: '#'}},   

When a cell is not in the IDNumber value, then I want to change the format to string.

The reason why I want to do this is when the cell has no value and does not display this gridline when it is linked as a formatter

Formatter showlink output and lt; for each input data containing strings (empty string) or number A & gt; element

I'm not perfect, make sure I understand exactly what you want.

If I understand you correctly, then you need to make the link "clickable" even if the cell contains the empty string to do this so that you have all the columns in it Empty strings can replace some things like "& amp; nbsp; & amp; nbsp;" .

Another option I can suggest is that you want to use my dynamic link format which I have described. It is very easy, but the predefined format is more powerful in the form of sholink . It shows how you can use it. Column

  {name: "mylink", width: 60, sortable: false, formatter: "dynamiclink", formatoptions: {cellValue: function cell valley , Line ID, row data, options) {return cell value! == ""? Cell Value: "& lt; span style = 'color: red' & gt; blank link & lt; / span & gt;"; }, URL: function (cell value, line ID, row data) {return / store / adapter? Id = '+ rowId +'? ' + $ .perm ({name: rowData.name}); }}}   

Allows to define the custom cell value and the URL used in the link. The source code of the formator that you can find displays the demo grid

Enter the image details here

Where I put some custom text (red text" blank link ") instead of empty string.

windows 7 - Red5 Server won't start -


Windows 7 Red 5 1.0 RC1 Local Environment

During installation, Leave blank and port

I install it, and then see that the Red5 service appears in the list.

I go into properties, set it to manual, then start over.

Service status changes to "Start", for a while, then switch to "Closed".

No error messages or anything. It just stops automatically.

The answer is that remove the following 3 jars from your Lib Linux

com. Springsource.slf4j.juli-1.6.1.jar
com.springsource.slf4j.log4j-1.6.1.jar
com.springsource.slf4j.org.apache.commons.logging- 1.6.1.jar < / P>

cordova - Blackberry Connection refused when deploying Phonegap app to device -


)

I deploy my app which is built on my Blackberry Z10 device with PhoneGap Want to / P>

I created some Hello world basic app with phonegap, then in the terminal (Mac OS Sher) I run the following command:

/ User / MacBook / Documents / BB 10 APP / Cordova / Run Bibies 10

Everythings work fine, but in the end I get a connection error:

[build] bar packaging full error: error: can not connect: from connection Please refuse IP address settings for the target Check it out. You may have to reboot the target

What could be the problem with the connection?

And what are some other tools I can send on the Android device only through the device like USB?

Thank you: -)

I've got a solution if someone wants to know :

You have to use the device IP address and the developer is not found in the IP which is found in the developer settings on the device (where you see your developer token).

And then it will work (Don 'developer IP, annoying to lead the developers in the wrong direction, ask me.)

Some settings on device IP device were found in the entry (I do not remember which unfortunately, but it's there). Do not use the IP from the Developer menu that does not work: -)

android - How to specify HTTP headers for async imageloading in AQuery (AndroidQuery)? -


I have to specify a specific referrer to successfully load certain images on the remote host. (For example, the referrer should be "", otherwise the webserver will return HTTP 403)

The agency has a section on specifying HTTP headers for AJAX calls, but I do not have a piece Think how to do this for a simple async image call. For example, here is a normal AUTO code that is used to display an image on the network:

  New AQuery (submodelphoto) .image (MyApplication.MEDIA_BASE_URL + getItem (status), True, truth, 0, r.drawable.default_image);   

How do I specify an HTTP Referrer for this call? Is it possible to set up to do this for each call during my app? (To do this I have not repeatedly tried to load an image)

after some Excavation (read more) I have come up with this solution:

  BitmapAjackCollBack CB = new bitmapAccalbackBack (); Cb.header ("Referrer", "http://www.example.com"); Cb.url (MyApplication.MEDIA_BASE_URL + getItem (status)). Fallback (R.drawable. Default_image) .memCache (true). File cache (true); New AQuery (submodelphoto) .image (cb);   

It seems to work, just to think that for every request there can be a way to set up the referrer for AQuery.

validation - XML Schema restrictions on the current date -


Is it possible to restrict the date and time data types for the current date XSD? For example, if you want a maximum notification of the date on the current date:

  & lt; Xs: element name = "DateOfBirths" type = "date of birth" /> & Lt; X: Simple Type Name = "Date of Birth" & gt; & Lt; Xs: restriction base = "x: date" & gt; & Lt; Xs: minInclusive value = "1920-01-01" /> & Lt; Xs: maxInclusive value = "current-date ()" fixed = "true" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt;   

If the default copy of this copy is not possible, is there an alternate solution? Any help would be appreciated.

XSD does not support XPath functions to set values ​​in proximity, therefore (as That you probably already know) code in the work won in question.

The most obvious solution is

  • Use XSD 1.1 and check constraint in one argument.
  • Use schematron and check the constraint in a logic.
  • Check the barrier at the application level.
  • Announcement of date of birth type is a schema document of its own; From time to time, prepare a new version of that schema document, using the hand or cron job or something similar in today's schema document

      & lt; Xs: maxInclusive value = "2013-06-20" /> Will happen.   

    and in the schema document prepared yesterday

      & lt; Xs: maxInclusive value = "2013-06-21" /> Will happen.      

iphone - NSCoding and ARC -


I want to store my custom object. The class sees a dictionary whose values ​​are examples of Classbie.

Everything is good class A's input with coder, and _diker is declared as strong , but after init return and I call callMeAfterInit , _dictionary is empty (not empty, a valid empty dictionary).

It should be simple, but I have not done a lot of collection, so I'm missing something fundamental. What could be the reason to clear the dictionary after return returns?

Here is the required code:

  @interface ClassA: NSObject & lt; NSCoding & gt; @protecti (strong, non-standard) NSMutableDictionary * dictionary; @end @implementation ClassA - (Zero) Encoded Password: (Encoder *) Encoder {[Encoder encoded object: self.dictionary forKey: @ "dictionary"]; } - (id) initWithCoder: (encoder *) decoder {self = [super init]; If (self) {_dictionary = [decoder DecodeObjectForKey: @ "dictionary"]; // Breakpoint here and I can inspect a good dictionary; healthy return to classy values}; } - (zero) callMeAfterInit {NSLog (@ "% @", self.dictionary); // Log output shows an empty dictionary here (valid, but with 0 pair)} @ and @ interface class B: NSObject & lt; Nscding & gt; @property (strong, non-nautical) nsnm * number; @ Property (strong, non-fixed) NSArray * array; @end @ Implementation Classbie - (empty) encoded codec: (encoder *) encoder {[encoder encoded object: self number fork: @ "number"]; [Encoder encoded object: self. For Hey: @ "Array"]; } - (id) initWithCoder: (encoder *) decoder {self = [super init]; If (self) {_number = [decoder DecodeObjectForKey: @ "number"]; _arre = [decoder decodeObjectForKey: @ "array"]; } Healthy return; } @end    

You do not show the code that calls callMeAfterInit < / Code>, then this is an estimate.

No more than you are, you are not talking to the same example as ClassA . Do you call [[ClassA alloc] init]; from somewhere?

java - Guide to implementing spring security password recovery with dynamic URL sent to email -


I find it hard to recover passwords, because I have never done such a thing before.

So far I have a web app:

Spring Security, where the password has been properly hacked and the user's roles are fully implemented and work correctly.

The strategy searches with the stack overflow:

  1. A user hits the forgotten password button, where he enters his email address.
  2. A dynamic link is sent to the email address
  3. The user opens the link in the email address >
  4. who redirects him to the password reset page

    Is not known:

    • How to link dynamic nature - methods of generation is close to the link - some questions here Met, but often include custom handler or spring security functionality
    • such dynamics The request mapping method to answer the link
    • temporary link collection methods - databases, sessions, etc.?

      As you can see that this list is very serious for any sin, Gle question was then hoping that you could be able to provide guide resources how to do this step Take steps. I was surprised that I could not find a lot on this in the Spring security documentation. Thank you.

      I am a student, so in particular in Java context, there are not really the best practices in the industry, so I really hope that anyone can help you. The problem does not really do much with spring security, provided that you configure the user database structure and password encoder. Know how to use it, it is actually implementing only data access, web controllers and an email sender workflow. The link should contain a random token string (for example, SecureRandom and use a base 64 encoder) and it must be stored in a database with user ID and timestamp (validating that window For which the link is valid). The controller will only remove the token from the incoming request, using the token will load the data from the database. It will check the timestamp and then send the user to the password entry form. Depending on the requirements, you also want them to answer some other security questions. Then you want to validate the passwords and encode it and store it in the reset link table in the account matching the User ID stored in the table. It would also be wise for the batch to remove the link that ends with the database.

      The Grails Spring Security UI plugin already has an option that you can use directly or use as a reference.

database - Rails, passing an array as criteria to query -


I'm calling the database based on the criteria passed from the scene, so it must be dynamic.

Say I have 2 arrays:

  column = ['col1', 'col2', 'col3'] vals = ['val1', 'val2 'Val3']   

The query is easy to create, I can concatenation, such as

  query = columns [0] + "= ( ?) And "+ ..   

But what about the parameters?

  @finalValues ​​= MyTable.find (: all, terms => [query, wal [0], wall [1] ...])  < / Pre> 

But I do not know how many parameters I get. Therefore, when the query problem is resolved with the loop and the inclusion, I can do something like this: @finalValues ​​= MyTable.find (: All ,: conditions = & gt; [query, wal]) and the railroad will understand that I am not going to have an array for the IN (?) Segment, but to divide the values ​​for each person (?)

Or is my only option to do a single complete raw string? >

You can create condition as the first element with the query and add all the Vel element to it.

  query = columnss.map {| Col | "# {Col} =?"}. Join ("AND") @finalValues ​​= MyTable.find (: All, Conditions => [Queries, * vals])   

Point Alignment to Columns and Similar Values Must be number of elements.

vb.net - Convert timespan into hhh:mm:ss to insert into mySQL time type fields -


It seems like a newbie question, but I'm really struggling with it.

I have time zone in mysql database, I am using vb.net 2012. I am trying to include the amount of time in the time zone. I am sitting on using a text box and the user has been entered in the decimal form (1:30:00 = 1.5). My problem is that these timespan can be for more than 24 hours and vb wants to convert it to format that includes days.

ex. 100.5 hours are converted to 4.04: 30: 00

I have to show it as 100: 30: 00 so that I put it in my database.

I'm open for alternative suggestions.

Please help me I have been wasted more than enough time on this.

Do you need it? Temppen = New Temppen (100, 30, 1) in the form of Dim TS Smooth Fu String = String.format ("{0:00}: {1:00}: {2: 00} ", _ math.flur (THSHHRS), T. Minutes, TS. Second)

c# - HtmlAgilityPack Attributes.Remove on Image Only Removes One, When There Are Two -


I am using in our project, so that we can display any other HTML in our system. I ran into my unit test on this issue, and want to make sure that I am not doing anything wrong if I have an image, and it has 2 "src" values, then I want to choose it, both of them Remove, and add back to the right path once more. I do not think it will be with our HTML, but just in case ....

So, here is an example image tag:

   Here's the code to manipulate HTML:  
  public static string fixHMMLinks (this string html) {var htmlDoc = new HtmlDocument () {OptionWriteEmptyNodes = true}; HtmlDoc.LoadHtml (HTML); Var ImagesToCheck = htmlDoc.DocumentNode.SelectNodes ("// img [@src! = '']"); Var image (var src = image.GetAttributeValue ("src", string.Empty); if (Uri. ISFFMmlRustring (src, UriKind.Relative)) {if the (null! = ImagesToCheck) {foreach (imagesToCheck.ToList ()) { image.Attributes.Remove ( "src"); Image.SetAttributeValue ( "src", Stringkformet (RELATIVE_IMAGE_PROTOCOL_AND_HOST, src));} else if (Urikaisvelafuaruarstring (src, UriKind.Absolute)) {image.Attributes.Remove ( "src"); Image.SetAttributeValue ( "src", src.Replace (ABSOLUTE_IMAGE_HOST_TO_REPLACE, IMAGE_PROTOCOL_AND_HOST));}}} Return htmlDoc.DocumentNode.OuterHtml;}   

when I debug And this line "removes the image quality." ("Src"); ", there are 2" src "values, as up Damage after the line, although there is one would assume "src", which begins with "/ knowledge", I was asked to summarize the expected removal of them have since been removed:

By removing a feature from the list, using its name. If there are more than one feature by this name, then all of them will be deleted.

I have checked for HtmlAttributeCollection in CodePlex, and remove method takes you through a loop to remove value

I use it wrong Am I doing this, or did I have the opportunity to give a patch to HTMLAgilitpack?

confirmed: image.Attributes.Remove only remove the first event gives.

Remove multiple times to call a quick improvement. If it is called and the attribute is not found, then it does not do anything.

You may want to know about it by HtmlAgilityPack authors.

php - JQuery loaded form won't submit -


When I load a form via Ajax JQuery in this way:

  $ ('# Quick_feed') .load ('API / SHS / loaders.php do = ask_question'); The form appears, but the problem is that when I click on submit button the form is not submitted. Here is the form  
  & lt; Div class = "feed_header" & gt; & Lt; Div class = "feed_profilepic" & gt; & Lt; Img src = "profile_pix /"  Profile_pic ;? & gt; " Width = "50" height = "50" square = "image3" range = "0" & ​​gt; & Lt; / Div & gt; & Lt; Div class = "feed_postedby" & gt; & Lt ;? Php echo $ session-> Full_name; ? & Gt; & Lt; / Div & gt; & Lt; Div class = "feed_posted" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "feed_header" style = "padding-top: 3px;" & Gt; & Lt; Form action = "? Task = submit" method = "POST" & gt; & Lt; Input type = "text" style = "width: 97.7%; color: # 000;" Class = "box" name = "question" value = "" & gt; & Lt; / Div & gt; & Lt; Div class = "feed_header" style = "padding-top: 2px;" & Gt; & Lt; Textarea rows = "10" name = "question_am" id = "approx" "cols =" 30 "style =" resize: none; Width: 99% ">   
& Lt; a href = "#" onClick = "AADS (); Return false "gt; & lt; div class =" feed_buttons "style =" padding-left: 5px; Padding-top: 0px; "& gt; & lt; P & gt; span class =" feed_button "style =" background-color: # 999; Margin-top: 3px; "gt; cancel & lt; / span & gt; & lt; / p & gt; & lt; / div & gt; & lt; / a & gt; & lt; / div & Gt;

Form submission is the page on which the form was loaded. Any suggestions?

Remove the device from that form that you have to terminate the & lt; form & gt; tag and the tag at the same level:

  & lt; form action = "? Task = submit "method =" POST "& gt; & lt; input type =" text "style =" width: 97.7%; Color: # 000; "class =" box "name =" question "value =" "& gt; div class =" feed_header "style =" padding-top: 2px; "& gt; textarea rows = "10" name = "question_am" id = "approximate" "cols =" 30 "style =" size change: none; width: 99% "& gt; & Lt; / Textarea & gt; & Lt; / Div & gt; & Lt; Div class = "feed_header" style = "padding-top: 2px;" & Gt; & Lt; / Div & gt; & Lt; Div class = "feed_header" style = "padding-top: 2px;" & Gt; & Lt; Div class = "feed_buttons" id = "ask" style = "padding-left: 5px;" & Gt; & Lt; P & gt; & Lt; Input type = "submit" value = "ask it" & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt; A href = "#" onClick = "AADS (); Return Return" & gt; & Lt; Span class = "feed_buttons" style = "padding-left: 5px; padding-top: 0px;" & Gt; & Lt; Span class = "feed_button" style = "background-color: # 999; margin-top: 3px;" & Gt; Cancel & lt; / Span & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Form & gt;    

c++ - Changing vectors that were already created -


I am working on a project that pulls the solar system. I make planets only once in my main function.

  int main (int argc, char * argv []) {SolarSystem app (argc, argv); // Create Solar System App CreatePlanets (); // Create planets in solar system app.run (); Return 0; }   

This is my createPlanets () function which is vector & lt; Planet & gt; Sets the value for the planets; vector.

  Zero Solar System :: Creating Panels () const {// File Texture / Radius / / Orbit / Tilt Angle Planets Push_back (Planet ("Images / Sun.jpg", 696, 696, 2500.0, 0.0), 0.0)); // Planets. Push_back (Planet ("Images / Mercury JPG", 2.44, 2.44, 57 9 10.0, 45740.0, 0.0)); 1 1 Planet Push_back (Planet ("images / venus.jpg", 6.05, 6.05, 108200.0, 107464.0, 177.3)); 2 planets 2 Push_back (Planet ("Images / Earth.jpg", 6.37, 6.34, 14 9 600.0, 147102.0, 23.5)); // planet3.paste_back (planet ("picture / moon.jpg", 1.74, 1.73, 384.0, 383.0, 5.145)); 4 4 planets. Push_back (Planet ("Picture / Merse.jpg", 3.3 9, 3.37, 227, 40.0, 207425.0, 25.2)); // 5 planets Push_back (Planet ("Images / Jupiter JPG", 69.90, 65.24, 778330.0, 740734.0, 3.1)); / 6 planets Push_back (Planet ("Images / Neptune. JPG", 24.63, 24.08, 4504300.0, 4460608.0, 29.6)); 7 7 planets. Push_back (Planet ("Picture / Pluto JPG", 1.1 5, 1.15, 5913520.0, 4475140.0, 29.6)); // 8}   

I am creating a menu where the user can change the scale of the planets so that they can be easily seen (the actual scale planets are actually hard to find) . To change the shape, I have to go to vector and change the radius of every planet object there.

Does anyone know how I can do this? Each frame in the display function below draws the planets.

  Zero Solar System :: Display (GLCentexData and ContactData) console {if (ShowOrbit) display orbitpath (); // These variables set the orbit and rotation speed of each planet / Sun / Mer wain ear moon march jumps napa plu double orbit [] = {0.0, 4.15, 1.600, 1.00, 13.0, 0.40, 0.08, 0.006, 0.004}; Double rotat s [] = {1.0, 0.50, 0.125, 30.0, 1.00, 30.0, 75.0, 40.00, 5.000}; // ii = index counter for variables above 0; // Vector Iteration (Study :: Vector and LeTinum; Planet>: For :: Iterator = planets.bgIN (); it! = Planets.end (); ++ it) {// If the planet is displayed If the Sun is Sun (I == 0) // Shading Off GlDisable (GL_LIGHTING); Turn on the other // spot where the sun is in a light source {GLfloat light_diffuse [] = {1.5, 1.5, 1.5, 1.5}; GLfloat pos [] = {2500.0, 0.0, 0.0, 1.0}; GlEnable (GL_LIGHTING); GlLightfv (GL_LIGHT0, GLDIFIFE, LITE_Diffus); GlLightfv (GL_LIGHT0, GL_POSITION, position); } If (i == 4) // Moon {it-> displayPlanet (orbitCounter * orbitS [i], orbitCounter * rotatS [i], Planet [3] .getMajorAxis (), Planet [3] .getMinorAxis ()); } Other // Planets-> Displayplanet (Orbit counters * Orbits [I] * 0, Orbit counters * Rotat S [i], 0.0.0.0); I ++; } // used to calculate the base counter class and rotation speed class counter + = 0.05; // 9 0750.0 Whether Pluto is required once in a class around the Sun if (orbitCounter> 89750.0) orbitCounter = 0.0; }   

I want to add a statement where I can say

  int scale = 1; If (changeScale) scale == 100;   

Then I will multiply the radius by scale if the changeScale is not set, then the planet should remain in the same size. If changeScale is selected which will grow to 100 in the size of planets. Is there no way in which to accept every planet? If this is not possible, how can I do this to duplicate the planets every frame? I'm not sure how I can modify the object inside my vector.

Thank you!

You planet s in your vector Can modify. It will look something like this:

  planet [index] .mail = new_val;   

Or, if there are variables, then private and you have accessory methods,

  planet [index] .setMember ( New_val);   

So, if you want to change the radius, then it looks like one of the two lower statements:

  if (changeScale) {for (Int I = 0; i & lt; Planetary size (); ++ i) {Planets [i] .radius * = 100; // this planet [i] .createdia (planets [i] .getRadius () * 100); // or}}   

Or, you can use iterator s:

  if (changeScale) {for (Std :: vector & gt; planet & gt; :: iterator = planetary. BgIN (); it! = Planets.and (); ++ this) {(* this). Radius * = 100; // It (* this) .setRadius ((* this) .getRadius () * 100); //}}}}