Wednesday, 15 May 2013

datetime - Parsing dates from free-text input in Python -


I'm starting to work on a simple calendar app for that website, on which I'm working (Django , But the fact is probably not relevant.)

  • Every Sunday evening at 7:00

    I want to see when an event Enter a text box like this,

  • next Friday
  • Tuesday, December 1, 2009

And some estimates when my application begins Start putting Zhe It does not have to promise to be right, just users means to be able to put up with a few ideas of what they do. Is there a Python library that does something? Bonus points are extensible to match more formats.

I do not care too much about the time zone - it is safe to assume any time for the purposes of my application, whatever happens in London from time to time, I

Sorry if I have forgotten a duplicate - I have a look.

is


c++ - stringstream operator>> fails as function, but works as instance? -


I am writing a simple code that will remove a bunch of names, int pairs from a file. I am modifying the existing code which uses just:

  string chrome; Unsigned full size;  

But I want to use a second (similar) input file in which the first two columns are the same, but after the other data (which will be ignored). So I write:

  string chrome; Unsigned full size; String line; (Getline (CIN, line)) {if (stringstream (line)> chrom & gt; size) {// save values}}  

But failing to compile this typical porn study gives Lib Template template:

  error: "operator"> gt; & Gt; "Std :: basic_stringstream"; four; std :: char_traits> four>, std :: communicator> four>> (((constants std :: basic_string & lt; four, std :: char_traits & lt; four & gt; std :: communicator & lt; four & gt; & amp;; ((static std :: basic_string & lt; four; std :: char_traits & lt; four & Gt ;, std :: communicator & lt; four & gt; & gt; *) (& amp; line)), std :: operator | (_S_out, _S_in))>> chrome "isstream: 131 : Note: Candidates are: std :: basic_istream & lt; _CharT, _Traits & gt; & Amp; Std :: basic_istream & lt; _CharT, _Traits & gt; :: Operator & gt; & Gt; (Std :: basic_istream & lt; _CharT, _Traits & gt; & amp; (*) (std :: basic_istream & lt; _CharT, _Traits & gt; & amp;)) [with _CharT = four, _Traits = std :: Char_traits & lt; Char & gt;] [... another dozen lines ...]  

The correct line is not std :: string, but some variations of std :: basic_string, etc. However, to explicitly trigger stringstream functions

  string chrome; Unsigned full size; String line; While (gateline (genome, line)) {stringstream ss (line); If (SS>> Chrome> Size) {// save value} // delete the rest of the line //}  

Why? What is wrong in the first case? Always useful works at cplusplus.com, why is not my code?

Update: Another point of reference: The temporary stringstream works when the first value is extracted is an integer instead of a string:

  unsigned int chrom; // serves as integer ... unsigned full size; String line; While (getline (CIN, line)) {if (stringstream (line)> chrom & gt; size) {// save values}}  

Give over three groups of member tasks and a group of global actions on "extraction operator" (+)

  • String Stream (line); - A floating object
  • stringstream SS (line); - A common object.

When "chrome" is an integer, operator is more overloaded as arithmetic. Extractor which is a member function is normal object or temporary object is both fine.

When "chrome" is the string, operator istream & amp; Operator & gt; & Gt; (Istream & is, char * str) , it is a global task that should reference the object as a parameter. However, the temporary object has been given, we do not have permission to pass temporary objects from the non-conferencing context in standard C ++. Overload function can not get reference of floating object unless the overload function is istream & amp; Operator & gt; & Gt; (The cost is and is, four * string) Unfortunately, this is not the fact. In case of temporary objects, the function (s) can not be overloaded, and therefore the error: there is no match for the function ...


Error building Visual Studio 2010 Silverlight 4 projects on Windows 7 with XP Mode -


I Visual Studio Beta 2 XP Mode VM 2010 Windows 7 I made a small Silverlight 4 (Beta) Installed project and tried to make it.

Error 1 "ValidateXaml" operation failed unexpectedly: I get the following error. System.IO.FileLoadException: file or file could not be loaded assembly: // \ tsclient \ d \ Users \ me \ Documents \ Visual Studio 2010 \ Projects \ SilverlightApplication2 \ SilverlightApplication2 \ obj \ Debug \ SilverlightApplication2.dll one or Your dependence The operation is not supported. (Exception from HRESULT: 0x80131515)

File name: 'file: // \ tsclient \ d \ Users \ me \ Documents \ Visual Studio 2010 \ Projects \ SilverlightApplication2 \ SilverlightApplication2 \ obj \ Debug \ SilverlightApplication2.dll '---' System.NotSupportedException: An attempt was made to load an assembly from a sandbox in previous versions of the .NET Framework that generated a network space. This release of .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended for sandbox assembly, please enable loadFromRemoteSources switch. See for more information.

On the system Reflection.randomimedxide _anlod (assembly name filename, string codebase evidence assembly security, runtime assembly space, stack crawl mark and stack marker, Boolean Fenkonfail Notfand, Boolean For Introspikshn, Boolean subscription Czech) system. System Name System, String codebase, evidence assembly security, runtime assembly space, stack crawl mark and stack marker, Boolean Fenkonfail Notfound, Boolean for Introspikshns, Boolean suppress security checks). reflection. Rendime. Name of assembly Assembly name assembly RF, Evidence Assembly security, Stack crawl mark and Stack marker, Boolean forIntrospection, Boolean suppressSecurityChecks) System.Reflection.RuntimeAssembly.InternalLoadFrom (string assemblyFile, Evidence securityEvidence, Byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forEtrosp Ection, Boolean suppress security checks, stack crawl mark & ​​amp; stackMark) System.Reflection.Assembly.LoadFrom on Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute on Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute (string assemblyFile ) (ITask Tasks) (ITask Tasks) Microsoft.Silverlight Build.Task on On Microsoft Valid.Xidit () Microsoft. Bail. Backend Task Execution Host Microsoft. Build. Backend On Microsoft Biscuits. Biscuit Task Builder Execute InstitutionateTsk (iTuskExecutionOut TaskExecutionHost, Task LaggingContact Task LaggingConnecte, taskHost taskHost, ItemBucket Bucketty, TaskExecutionMode howToExecuteTask, Boolean & taskResult)

I believe the fact is that XP mode redirects The folder for hosting the document, it is related to the change in a network, share the location, and trigger some types of CAS / security policy. Being.

Does anybody know how to fix this?

"itemprop =" text ">

After & lt; LoadFromRemoteSources enabled = "true" />

in your configuration file


ASP.Net MVC - Showing Model data based on Roles -


I have a view that needs to show and hide details based on the user's role. I have 2 options

  1. Use an inline if statement to show and hide in view
  2. Create several partial views and use the controller Use and then load the appropriate partial view.

I am a newcomer to MVC so somebody can kindly suggest what is the best way to deal with this problem.

I would probably think differently for each role. I have found that from time to time, thoughts of each role are separated into "mango" content.


ruby - Calling initialize when loading an object serialized with YAML -


Is it possible to force Ruby to call an initial method when using YAML.load_file? For example, I want to call the method to provide value, do not serialize the variable I know that I can factor code into a different method and call YAML.load_file after calling it But I was wondering if there is one more great way to handle this problem.

I do not think you can, because the code you add to is actually specific to the classified class So, you should consider adding convenience to the class. For example, if you want to deserialize the foo class, you can add a class method like:

  class foo def self.from_yaml (yaml) foo = YAML :: load (yaml) # foo Edit the object here foo end end myFoo = Foo.from_yaml ("myFoo.yaml")  

messaging - Why use AMQP/ZeroMQ/RabbitMQ -


Contrary to writing your library.

We are working on a project that is a self-split server pool, if a section becomes very heavy, the manager will divide it and make it a separate machine Keeps in the form. It will also warn all connected clients who affect it to connect to the new server.

I'm curious about using ZeroMQ for inter-server and inter-process communication. My partner would like to roll herself, I am looking at the community to answer this question.

I am a quite novice programmer and have just learned about message lines. As I googled and read, it seems that everyone is using message lines for all things, but why? Does he make it better than writing his library? Why are they so common and why are so many?

What makes them better by writing your own library?

When there is probably nothing to carry out the first version of your app: Your needs are well defined and you will develop a messaging system that meets your needs: Small feature list, small source code etc.

After the first release, very useful later in those devices, when you can actually increase your application and add more features to it Are there. I'll give you some usage cases:

  • Your app needs to talk to a big Andian machine (X86, Intel / AMD) with a large Andian Machine (Spark / PowerPC). Your messaging system had some endurance ordering assumptions: go and fix it
  • You have created your app, so this is not a binary protocol / messaging system, and now it is very slow because you spend most of your time Pars (number of messages have increased and parsing has become an obstacle): Customize it so that it can transport binary / fixed encoding.
  • Start Switch to have had 3 machine within a LAN, any everything from delayed machine. Your client / boss / point-hair-devil-boss appears and tells you that you will install the app on the van which you do not manage - and then you start connection failure, poor latency etc. You need to archive the message and need to resend them later: Go back to the code and plug in this content (and enjoy)

  • were sent The message needs to be answered, but not all of them: you expect a spreadsheet as a result instead of sending some parameters and just sending and accepting, go back to the code and plug in this content (and Enjoy.)

  • Some messages are important and send required requirements as per reception / backup / backup / persistence. Why do you ask

And many other usage cases that I forgot ...

You can apply it yourself, but do not spend too much time doing this: Will replace it later too.


stored procedures - SQL Best Practices -


Is it good to check that some fields are empty from a table and will return true or false from SP or what values It is good to bring and check in code.

This is usually a better design for a specific business layer, which validates the field for example In a n-tier architecture, the business level will be valid and if the required field disappears then an error will be returned. This means that the data level expects the valid data coming from the business level.

All data levels need to be worried about the recovery of data efficiently and efficiently.


iphone - scrollToRowAtIndexPath scroll inside the header section -


When I use indexpath.row = 0, it's working fine and showing below the header

But when I use indexpath.row = 1, the row 1 will move inside the header section of the table view.

Please help me, I must hide the first row.

[alltweettableView scrollToRowAtIndexPath: [NSIndexPath indexPathForRow: 1 insection: 0] atScrollPosition: Animated UITableViewScrollPositionTop: NO]; Text after "

I'm guessing that you have some transparency / transparency (similar to the contact app) with the default table Headers are using and therefore shows through the bottom of the first line.

Take a look at the documentation for the UITableViewDelegate method, and then you can apply that table to the representative of your table view, send a scene with this non-translucent (or transparent) background, and This should prevent the top row from being displayed.

To get started, I want to return it to a custom shape UILBL directly with a white white background and make sure that it should work (because I have not tested it :) < / P>

  // You probably need to fill the frame size yourself / then try something other than the CGRXeroOr. (UITableView *) tableView viewForHeaderInSection: To start (NSInteger (UIView *) tableView - // example (10,2,320,30), then from there #define x 10 #define Y2 #define width 320 #define height 30 ) Section {UILabel * sectionHeader = [[UILabel alloc] initWithFrame: CGRectMake (X, Y, WIDTH, HEIGHT)]; SectionHeader.text = [NSString stringWithFormat: @ "section% d", section]; SectionHeader.background = [UIColor whiteColor]; Return [section header autoreage]; }  

Assuming that works and looks like progress, you might want to prepare a custom view return that is in the form of the next step.


c# - Question about Object Identity and Object Equality and String class exception -


This is Java and C # questions We all know that object identities (==) test whether the two objects Examine the same place and object equation (equal law) that two separate (non-identical) objects have the same value or not. But in the case of string object object recognition, the object similarity is similar, for example if two bullion expressions are correct in the statement

  string a = "123"; String b = "123"; If (a == b) if (a.Equals (b))  

Why is it ?? What is the rationale behind this design decision? Both Java and C # have used memory-saving techniques because wire is irreversible in these languages.

, They can combine frequently-used stars (such as hard-coded strings as your example are literally) and use several references to a string in memory to save space.


How to get POST data as array with C# -


I am developing an ASP.NET handler with C # that receives data posted by external flash program is. How can I use data as an array? It appears that the HTTP context used in ASP.Net automatically decodes the post data HTML so that it can be removed as a simple string. In this case the separator is a comma (maybe it is always a comma, this has never been worked before).

I need one of two things:

1) For data in your HTML-encoded form, where arrays can be used as a separator for arrays Only customers can represent real arrays instead of input of input (customer input comma will remain encoded at this point). 2) PHP print_r () , a way to emulate the var_dump () function (does not know PHP itself, but I have been told That's the move there) dump the variable to an array.

So any help would be appreciated in advance thanks!

Edit 1: The data being posted can be for a group of examples, postcode and optional additional information. Such as address = testroad% 5F5, second% 5thterthreads% 5F6 and postal code = 12345,56789 and extrainfo =, firstfix . In that example, two addresses (% 5F equals each) were two postal codes, but only in the second address was the space before the comma was empty as extrainfo . Now once again, as English is not my motherhood, the problem was that the prospective customer-written comma is mixed with the actual array-split comma after decoding. Public Void Process Requests ({HTTP Context References}} ({var reader = new streamReader}


Hosting Silverlight Out of Browser Application in Sharepoint 2007 -


I am trying to host outside of a Silverlight 3 browser application in Sharepoint 2007. My application looks fine; But when I install it out of the browser; And try to run it from the desktop; Only blank screen is displayed and after that nothing happens.

The XAP file is placed in _layout / MyFolder / MyApp.xap (under 12 hives). Am I missing anything?

My Silverlight app uses SharePoint data through its web services; I need to host it within Sharepoint so that they can access the underlying Sharepoint web services.

It seems that the client used in OOB mode is the HTTP stack problem when hosted by the browser So the app browser will use the htpt stack and so it will be a common set of cookies. They are not available in OOB mode.

How does the SharePoint site use the initial browser to authenticate?

It may be possible to create an OBB experience against SharePoint, but it is more likely to work.

Edit : Your problem is that OOB mode NTLM authentication is not supported in the client HTTP used in Silverlight-4.0 supports this mode.


asp.net - No Form.Submit() function in VB.NET or C#? -


I have some problems with my code because I can not do it in VB.NET or C # because no form 1 is not I VB.NET or C # ???

  & lt; Script language = "javascript" & gt; Submit () function in Function valSubmit () {varMyReg = document.form1.lst Country. Option [document.form1.lstCountry.selectedIndex] .value; VarNewReg = varMyReg.substring (0, 3); Document.form1.hdnRegion.value = varNewReg; Document.form1.action = "http://now.eloqua.com/e/f2.aspx" document.form1.submit (); Back true; } & Lt; / Script & gt;  

Why is it or how can I do it in VB.NET or C #?

C # and VBnet server-side languages ​​are the client-side function of submitting a form in the browser , So you can not use C # or VBnet You have to use Javascript for this (though you can include JavaScript in your HTML using C # or VBnet).

  string js = @ "function valSubmit () {varMyReg = Document Form1.lstCountry.options [document.form1.lstCountry.selectedIndex] .value; varNewReg = varMyReg.substring (0, 3) ; Document.form1.hdnRegion.value = varNewReg; document.form1.action = 'Now http: // now .eloqua.com / E / f2.aspx' document.form1.submit (); back true;} "; RegisterStartupScript ("submitform", js);  

You can modify and modify the script according to your needs, especially to recognize ASP.NET control properly. For example, you can use it. Form. Client IDs to get the main form's ID on one page. To remove the client-script, you can use both (before the end of the page) and (at the beginning of the page)


c# - Return null for FirstOrDefault() on empty IEnumerable<int>? -


कहो मेरे पास निम्न स्निपेट है:

  int? NullableId = GetNonNullableInts ()। FirstOrDefault ();  

क्योंकि GetNonNullableInts () पूर्णांक देता है, प्रथम ऑर डिफॉल्ट को 0 पर डिफ़ॉल्ट होगा। रिक्त को सूची में खाली करने के लिए एक null मान वापस करने का एक तरीका है?

  int? NullableId = GetNonNullableInts ()। कास्ट & lt; int? & Gt; ()। FirstOrDefault ();  

excel - Differences between string representations of date/times -


In Excel 2007, I want the difference for the following string date / time:

  ABC1 Date 1 Date 2 A and B2 Difference 2009.11.28 01: 25: 46: 0287 2009.11.28 01: 25: 46: 0287? 3 2009.11.28 01: 25: 46: 0443 2009.11.28 01: 25: 46: 0443?  

I want to change the strings in date / time and then change the result as the difference of the two converted date / time.

  = subtit (left) (A2, 10), "post-less" itemprop = "text"> 

. "," / ") + Middle (A2128) + right (A2,4) / 86400000- (substitute ( Left (B2,10), ".", "/") + Middle (B2, 12, 8) + Wright (B4) / 86400000)

By special request and Very Short Abbreviation:

  = Subtitle (left (A2, 10)), + REPLACE (rights (A2.13), 9.1,) "." - (Substituted ( Left (B2,10) "." ".", "/") + REPLACE (correct (B2, 13), 9,1, "."))  
< / Html >

Visual Studio 2008 C++ debugger drops out of single-step mode under Vista -


I have a large C ++ project, and try to use the debugger to step through some code I am doing Unfortunately, it sometimes decides to exit the mode, and executes the code regardless of the fact that I pressed F10, and did not break into later breakpoints. I do not know when to leave it, but it seems that doing this happens consistently.

To be specific, I am trying to see what a certain element of performance is, I put breakpoints where the calculation happens. The debugger will be closed on some of them (as far as I do not need), and then ignore all the rest, and the finished image appears on the window. Some other times, I was taking the only step through the code, and suddenly it just started to execute it.

This is using Visual-C in Visual Studio 2008 SP1, running on 64-bit Vista. The code has been compiled in debug mode, in which optimization is not enabled. I have rebuilt a clean and complete without fixing it.

Does anyone know what this can be?

EDIT: There are no threads where I've broken, and I have just set up and still have a problem.

I think I have encountered this before.

You can download hotfixes that will correct this and other issues (available here).

I have set up a bunch and have not had any problems till then. After installing, you can see them listed in your box.

I am at work because I do not take the time to choose the most important people. But maybe at least 3 or 4 which you want to install, I think some hotfixes have some time Can also be grouped in type 1 SP1 (also available in the link).

Edit (in response to an edit in the original post): I am certain that the hotfix resolves any issues that you describe, since complaints were addressed by installing a group of hotfixes Had a group of my colleagues (on the lines of the main complaint), it sometimes ignores my breakpoint and keeps moving right past them! ") I recommend that whatever you apply You can continue to establish it.


javascript - transform pressed key values to english values -


मेरे पास ऐसा इनपुट है

  & lt; input id = "guestcard" name = "गेस्टकार्ड" onkeypress = "transform (event)" type = "text" value = "" / & gt;  

और मैं कुंजीपटल पर दबाए गए कुंजी को बदलना चाहता हूं, भले ही किस भाषा सेटिंग्स को अंग्रेजी चरित्र पर ध्यान दिया जाए। जैसे जब मैं चेक कुंजीपटल + (कुंजीकोड 43) के साथ दबाता हूं, मुझे 1 (कुंजीकोड 49 के साथ) प्राप्त करना है। क्या ऐसा करने के लिए कुछ मानक तरीका है? फ़ंक्शन कैसा दिखता है?

वैकल्पिक रूप से मैं एक ही कार्यक्षमता चाहता हूं, लेकिन एजेक्स (asp.net mvc पर) का उपयोग कर रहा हूं। कोई भी विचार?

अग्रिम धन्यवाद।

जहां तक ​​मुझे पता है , जावास्क्रिप्ट को पता नहीं है - इसलिए आपको किसी भी तरह से पता लगाना होगा या उपयोगकर्ता को उपयुक्त परिमाणीकरण मानचित्रण चुनना होगा (इस मामले में, संभवतया स्रोत के रूप में चेक के लिए एक रेडियो बटन और गंतव्य के रूप में यूएस एएससीआईआई)। एक बार जब इसका ध्यान रखा जाता है, तो आपका कार्य कुछ ऐसा हो सकता है:

  फ़ंक्शन परिणत (घटना) {var code = (event.charCode)? Event.charCode: event.keyCode; // क्रॉस-ब्राउज़र खुश स्विच (कोड) {मामला 43: वापसी "1"; }}  

कुंजीकोड / चारकोड्स गुणों और onKeyDown / प्रेस / अप इवेंट भिन्न ब्राउज़रों में कैसे व्यवहार करते हैं यह देखने के लिए एक महान परीक्षण पृष्ठ है।


php - PDT autocomplete broken in Eclpise -


Suddenly I can not use autocomplete in my eclipse PHP projects when I press alt + / I a dummy Listen to the sound. Which settings should I check?

Try it in PHP Explorer Right-click on your top level folder of the "Configure" menu item Select, then "Add PHP Support".


windows installer - .msi common application data local machine registry -


I think there are many subfolders in the normal appadata folder and there are many entries under hkey_local_machine for software on my Windows 7 system. . I want to know how the entry was created during the software installation and how the program can be found on them.

To create these folders and registry entries. MSI files have the registry Registry entries, the registry creates a "Registry" table in the MSI file.

Regarding the general AppData folder, this property: "The common application database folder" is that which uses the MSI file to refer to it.

Regarding permissions, the table is responsible for setting permissions.

Theoretically, the owner / creator of the file / registry settings is clear, and you can see the corresponding MSI file with how to see how it was created. Otherwise, you may have to enable auditing or you may have to use a tool like RegMon / FileMon to see which entries are being created.


msmq - When was MS Message Queue first released? -


एमएस संदेश कतार पहले जारी किया गया था?

चूंकि Windows NT 4.0 और Windows 95, इसलिए 1995 -इश।


How to write better template tags in django -


I have seen how I can write a template tag that defines a reference variable based on a template

<<> {% my_template_tag 'blah' my_context_variable%} as

but I want to be able to:

Given that Both groups and are set in the context in the user view

  {% is_in_group group user is_member%} {% if_member%} #. ... Do the work .... {% endif%}  

Or something like this:

  {% if_in_group group user%} # .. .. {% end if%}  

Obviously the second way is to set the only is_member in view - but this is just an example and will know Well how to do something like that!

Evgeny is a good idea tag with smart_ef template. However, if that does not work, you probably find that writing a custom filter for this type of comparison is easy. Something like this:

  @ register.filter def is_in (obj, val): Return Val is in obj  

and you will use it like this:

  {% if user | Is_in: group.users%}  

jquery - IE8 cache ajaxSubmit -


I'm using the following function to upload / display an image

The target is that div Is where I am updating the content that is returned from the form function. I wanted Ajax so I do not have to reload the whole page only to upload and preview the image.

I upload an image, display it in the preview, I crop it, and do the second function which it displays in the new target (not shown),

< P> The problem is in IE 8, it starts caching all Ajax calls, even though I'm showing the only way to not set it up is a tough one. Is there a way to force it to not cache? It works perfectly in all other browsers.

  $ ("# profile-photo"). Submit (function () {var myOptions = {target: '# preview-target', before submitting): ShowRequest, success: showResponse, clearForm: true, resetForm: true, cache: incorrect}; $ (This) .jax submit (myOptions); Return back;}); I suspect that this submission is caching, it is more likely that this image is caching the URL. In your reply, are you sending the URL back to the new image? If so, try adding a query string:  
  & lt; Img src = "/ my / path / to / my / image.jpg? Q = 12345" />  

This should force all browsers to reload the image from the server.


PHP date calculate -


What do I do here, I need it in date format php: 2009-11-29

  $ startdate = (date ("Y") - 1). '-' Date ("N"). '-' (Date ("j") - 1); $ End = date ("Y"). '-' Date ("N"). '-' (Date ("j") - 1); $ MyAnalytics- & gt; SetDateRange ($ StartDate, $ ENDDATE); Enter the resonance 'statistics:' $ Startgate. 'At' End of End '& Lt; Br / & gt; & Lt; Br / & gt; ';  

I can get the current date, but I need to get tomorrow's date (for Google analytic)

So if today, 2009-11-29 To remove from 1 is 29 get 28, but today as of today we are 2009-12-01, I get 0 as a day ...

I have to get the full date Required, and one day needs to be removed, the answer is still valid date

thanks

You can use the date ('yn-j', strotomom ('tomorrow'));


graphics - Delaunay tessellation in Python? -


I need to find a polygon's delayation in Python, and only one library that I can get Science) triangle point cloud, not polygon Any suggestions?

Apparently there is a Python binding I will try to work it


arrays - Collect all not in using Ruby -


I have been truncated this small code.

I do not know Ruby and I think it's a great opportunity to implement it.

I want to print all the rows in the file e , which are not in the file c . Each row is a number.

This is what I have:

  e = file. New ('E') Readlines c = File.new ('C'). Readline x = E. Collect. Items | C.include? (item)? The problem is that both files can have spaces, and for this reason the same number can not be treated like this. (Like "1234" is different from "1234")  

How do I need my code to fix this? I have tried c.include? (Item.strip) .. but it does not seem to work.

You are tab when you readlines will help, i.e.

  e = file. Roline ('e'). Map {| X | X.strip} c = File.readlines ('c'). Map {| X | X.strip}  

If you do not want an empty string, you can use archive , or perhaps select :

x = e.select {| I | ! C.include? (I)}

edit : Or, as suggested,

  x = ec  

HTML/JavaScript: Page's focus -


I have a shopping cart-like form when a user clicks on the page, in any case, The "Delete Item" button is focused, therefore, if the user clicks elsewhere and the press enters, the items are removed from their cart. It only happens in IE.

What can be done with it? How can I ensure that when this button is actually clicked, then this button is only focus?

Is it that you have the deleted buttons the only button in your form? If so, IE will treat it as a submit button and whenever it is pressed it will be pressed.


Showing inherited methods in Squeak/Pharo Smalltalk -


I am familiar with the visual work and dolphin versions of Smalltalk, but I have never screamed before, I myself with Feroze I'm getting acquainted, which is a 'clean' fork of a whip.

I used to show the methods implemented by a class either to use the feature in class browser or inherited in both ways and The methods were implemented.

Is this useful feature missing in SICAC, or am I unable to find it?

You can open any hierarchy browser on any particular class You can click on twice. Open the hierarchy button and menu entry browse hierarchy (Ctrl + H) the same view in the toolbar.

Inheritance Browser that shows the gradual implementation of the currently selected method Click on the Inheritance button in the toolbar

Also There is a protocol browser that shows all the methods and superpages of a class simultaneously. To open this browser, select Browse Protocol (Ctrl + Shift + P) in the class context menu.


java - Is there a way to update the JDK without manually downloading the new version? -


I just got a Java update notification that the update 17 has ended, so I started the update and found that only my public Updated JRE I still have to update JDK's update 16.

What is the best way to get the latest JDK available automatically?

Of course, the update should not be rid of the older versions, it should be done manually because the eclipse is still using the older version. Once I update my settings, I will delete the old JDK manually.

Not on Windows If you are getting your JDK via auto-updater via Linux Disto , Then you can depend on it. Somehow I doubt what is in your mind. I do not believe there is any sun-supplied auto download for JDK.


F# active pattern as non-static member -


I'm not sure that non-static public members active patterns are allowed, but you can define them without compiler complains Are there. What is the syntax to match against someone if they are allowed? The compiler is giving me a type of mismatch for Foo in FooBar2.doSomething a 'a - & gt; Options & lt; 'B,' c & gt; given 'a - & gt; 'D -> There is no error in this class; stable work great type FooBar () = static member (| foo | times |) (x, y) options and lt; Unit, unit & gt;

  = Match with X = Y | True - & gt; Foo | False - & gt; Bar member x.do some y = match x, with y | Foo - & gt; () | Bar - & gt; () Type FooBar2 () = Member x (| Foo | times |) y = match with x = y | True - & gt; Foo | False - & gt; With the "foo" member on the bar / compiler error x.do some y = match y | Foo - & gt; () | Bar - & gt; ()  

Active patterns should not be used as members. The fact is that all of these compilations are a compiler bug that we will fix (thanks for the report :)). Use local or module-bound "Walk" to define an active paradigm.


design - To change a language automatically, should you use the Keyboard Language or the Location value? -


To automatically convert a language, should you use the value of the keyboard language or location?

Well, I'm from Spain ... I usually have a traditional keying system in Spanish (Aka Spanish International), but sometimes I change it to en_us some tasks ... anyways, the location of my operating system is always in Spanish, even if some applications are in English (because they do not have a Spanish translation Or whatever)

The issue is, if a user has an OS and the environment set for a particular language, usually his favorite language, it is not always right for the keyboard, because some functions have some functions (Such as writing your language in your language for sorting, programming or legacy software, or so on).

> Hope this will clear all the best options for your question;)


vbscript - Scheduled task error -


I get an error in the given task: "Message: Object reference is not set to an instance of an object".

Schedulkkk vbs script:

  call logentrinter () sub login () error resume again next dim objRequest dim URL objRequest = CreateObject ("Microsoft.XMLHTTP") URL = "http: //localhost:4625/DataUpdater.aspx" objRequest.open "POST", url, false objRequest.Send set objRequest = nothing ending  

If Cassini / IIS is causing an error, then you should post the code in .aspx / .aspx.cs file, and error on that line Should arise.


Flash/silverlight and multiplayer games -


I wonder if it is possible to make a game with Flash / which is multiplayer (let's say two players) between players At the real-time interfaith daphase uses Flash, in the interview, the developer says:

"Purkkai Dofas is the tour on an unzipped tour"? Jmares Pvovir Soul Q seist Uncurrent duet final fantasy tactics, matte ot In a tout a fat English,

: "Why is Dufus a turn based game?" ...) To be honest, this is also because Flash did not display many animations at the same time ".

Is this true? To be clear, let us all take an example: Is it possible to clone Warcraft 2 with Flash / Silverlight?

Thank you

This is an important thing for you, between the customer and the server There is fast communication - UDP rather than TDP sockets. It will be supported in Silverlight 4, which is currently in open beta

On the graphic side, performance is good enough for something like working needed.

It is not completely clear whether Flash has the proper UDP support:


javascript - How to center a Div across all Monitors/Resolutions/Browsers? -


I have created my light box, the problem is that it is centered on my monitor but not on widespread monitors or big offers .

>

horizontally centered, vertical Or both? If you want both of you, have worked in the past for me otherwise, the answer is horizontal only good for centering


linq - C# Random Pair generation -


Assume that the possible death consequences are {1,2,3,4,5,6}

When two dice is thrown thrice , I want to collect random results from two dice.

My implementation

  var q = 3 times in new int [] {1, 2, 3} set 1 = new random () Next (1, 6) set 2 = new random () Next (1, 6) select new {s1 = set1, s2 = set2}; Forchcha (var v in q) {Console.WriteLine ("die1: {0} die2: {1}", v.s1, v.s2); }  

But most of the time, I get the same values ​​for the DI1 and DI2.

I mean

  Die1: 5 Die2: 5Diay 1: 2DAY 2: 2DAY 1: 2DAY 2: 2  
< P> What do I need to improve to get random pairs?

This is because you have two random items effectively By default, they are getting preference using a time-based value, most likely Environment.TickCount , although I have not confirmed this.

A Random will solve it before your query, because the two items must be sewed separately:

  var rnd = new Random ( ); Var q = 3 times in new int [] {1, 2, 3} set 1 = rnd. Next (1, 6) set 2 = rnd. Select Next (1, 6) New {s1 = set1, s2 = set2};  

mfc - CString : What does (TCHAR*)(this + 1) mean? -


सीएसटीआईआर हेडर फाइल में (यह माइक्रोसॉफ्ट या ओपन फाउंडेशन क्लासेस -), निम्न कोड स्निपेट है

<पूर्व> स्ट्रेट CStringData {लंबे समय तक nRefs; Int nDataLength; Int nAllocLength; टीसीएचएआर * डेटा () {रिटर्न (टीसीएचआर *) (और यह [1]); }; ...};

(टीसीएचआर *) (और यह [1]) क्या इंगित करता है?

CStringData struct का उपयोग CString वर्ग (http: // www.koders.com/cpp/fid100CC41B9D5E1056ED98FA36228968320362C4C1.aspx) में किया जाता है।

किसी भी मदद की सराहना की जाती है।

सीएसटीआईआर के पास बहुत से आंतरिक चाल है जो इसे सामान्य पारित होने की तरह दिखते हैं printf फ़ंक्शंस के लिए, वास्तव में वर्ग होने के बावजूद तर्क सूची में LPCTSTR को डालने के बिना, उदाहरण के लिए varargs < / कोड> ( ... ) उदा एक printf इस प्रकार CString कार्यान्वयन में एक एकल चाल या फ़ंक्शन को समझने की कोशिश करना बुरी खबर है (डेटा फ़ंक्शन आंतरिक फ़ंक्शन होता है जो स्ट्रिंग के साथ जुड़े 'असली' बफर हो जाता है।)

इसमें कोई पुस्तक है, जो उसमें जाती है, और आईएआरसी ब्लैज़कज़क पुस्तक इसे छू सकती है।

संपादित करें: कच्चे सी ++: -

  टीसीएचएआर * डेटा () {रिटर्न (टीसीएचएआर *) (और यह [1] ); };  

यह कहता है, "आप वास्तव में एक साथ आबंटित वस्तुओं की सरणी में पहली प्रविष्टि हैं। अब, दूसरी वस्तु वास्तव में एक CString नहीं है, यह सामान्य है एनयूएल ने यूनिकोड या सामान्य वर्णों के बफर को बंद कर दिया है - यानी, एक एलपीटीआरएसटी "।

एक ही बात को व्यक्त करने का दूसरा तरीका यह है:

  TCHAR * डेटा () {return ( टीसीएचएआर *) (यह + 1); };  

जब आप टी को एक सूचक में जोड़ते हैं, तो आप वास्तव में 1 * आकार के टी को एक कच्चे स्मृति पते के रूप में जोड़ते हैं। इसलिए अगर किसी के पास 0x00000010 पर sizeof (CString) = 4 पर स्थित है, तो डेटा 0x00000014 से शुरू होने वाले वर्ण बफर के एक NUL टर्मिनेंट सरणी में एक सूचक वापस करेगा

लेकिन केवल एक बात को संदर्भ के बाहर समझना नहीं है जरूरी एक अच्छा विचार है।

आप की आवश्यकता क्यों जानते हो?


wpf - DataTrigger / Style quick in XAML -


मेरे पास एक दीर्घवस्था है, जो कि इतनी परिभाषित है

  & lt; Ellipse Stroke = "# FF474747" शैली = "{StaticResource SelectedTemplate}" भरें = "{स्टेटैटिक रिसोर्स RedGradient}" / & gt;  

मेरे पास भी दो शैलियों की स्थापना है जैसे

  & lt; radialgradientbrush x: key = "redgradient" GradientOrigin = "1,1" & gt; & Lt; GradientStop रंग = "व्हाइट" / & gt; & Lt; GradientStop color = "Red" ऑफसेट = "1" / & gt; & Lt; / RadialGradientBrush & gt; & Lt; RadialGradientBrush x: कुंजी = "ग्रीनग्रैडिएंट" ग्रेडियेंटऑग्रीन = "1,1" & gt; & Lt; GradientStop रंग = "व्हाइट" / & gt; & Lt; GradientStop रंग = "ग्रीन" ऑफ़सेट = "1" / & gt; & Lt; / RadialGradientBrush & gt;  

अब, जब गलियारा पहले खींचा जाता है तो रेड ग्रेडिएंट ब्रश के अनुसार लाल होता है। मैं बकाया मान (चयनित) सही होने पर अंडाकार हरे रंग को बनाना चाहता हूं, इसलिए मैंने ऐसा करने के लिए एक स्टाइल जोड़ा

  & lt; शैली x: key = "selectedTemplate" TargetType = "Ellipse" & gt ; & LT; Style.Triggers & gt; & Lt; DataTrigger मान = "ट्रू" बाइंडिंग = "{बाइनिंग चुने}" & gt; & Lt; सेटर संपदा = "स्ट्रोक" मान = "व्हाइट" / & gt; & Lt; सेटर संपदा = "स्ट्रोकछेदना" मान = "5" / & gt; & Lt; सेटर संपदा = "भरें" मान = "{स्टेटिक रिसोर्स ग्रीनग्रैडिएंट}" / & gt; & Lt; / DataTrigger & gt; & LT; /Style.Triggers> & Lt; / शैली & gt;  

अब, जब चुना गया है केवल स्ट्रोक हल्का परिवर्तन, कुछ और नहीं है? कोई भी कृपया मदद कर सकता है?

धन्यवाद

जाहिरा तौर पर एक्सएएमएल इनलाइन शैलियाँ आपके द्वारा सेट किए गए किसी भी ओवरराइड । यही कारण है कि केवल स्ट्रोकटिचनेस को बदला जा रहा था क्योंकि यह इनलाइन सेट नहीं किया गया था।


c# - I want to compare the (dt.Rows[1].ItemArray[1].ToString()) with 1,2,3,4 : but does not Work?? show me error -


  शून्य चेक_यूसर () {string username = WindowsIdentity.GetCurrent ()। Name.Split ('\\') [1] .ToString (); MessageBox.Show (उपयोगकर्ता नाम); SqlCommand cmd = new SqlCommand ("User_Name चुनें, SO_User_Table से FK_RoleID जहां User_Name = '" + username + "'", cn); SqlDataAdapter da = नया SqlDataAdapter (); डेटाटाईबल डीटी = नया डाटाटेबल (); कोशिश करें {da.SelectCommand = cmd; da.Fill (डीटी); अगर (dt.Rows.Count == 0) {MessageBox.Show ("आपको अनुमति नहीं है, कृपया अपने प्रशासक से संपर्क करें"); } और अगर (dt.rows.Count & gt; 1) {संदेशबॉक्स। ("आपको अनुमति नहीं है, कृपया अपने प्रशासक से संपर्क करें"); } Else if (dt.Rows.Count == 1) अगर (डीटी। आरओ [1] .इमरात्र [1] .ओस्ट्रिंग () == 1) {संदेश बॉक्स। दिखाना ("आपका व्यवस्थापक हैं"); } और अगर (डीटी। आरओ [1] .इमरात्र [1] .ओस्ट्रिंग () == 2) {संदेश बॉक्स। शो ("आप एसएम हैं"); } और अगर (डीटी। आरओ [1] .इमरात्र [1] .ओस्ट्रिंग () == 3) {संदेश बॉक्स। शो ("आप बिक्री हैं"); } और अगर (डीटी। आरओ [1] .इमरात्र [1] .ओस्ट्रिंग () == 4) {संदेश बॉक्स। दिखाना ("आप विक्रयमार्ग या निदेशक हैं"); }} पकड़ (अपवाद पूर्व) {// lblInfo.Visible = true; //lblInfo.Text = "एक त्रुटि है! कृपया व्यवस्थापक से संपर्क करें। (" + Ex.Message + ")"; } अंत में {dt.Clear (); da.Dispose (); dt.Dispose (); cn.Close (); }}  

  यदि (dt.rows [1] .ememrray [1 ] .ओस्ट्रिंग () == 1) {संदेश बॉक्स। दिखाना ("आपका व्यवस्थापक हैं"); } आदि।  

आप एक int के लिए एक स्ट्रिंग की तुलना कर रहे हैं?

मैं अनबॉक्स डीटी। राव [1] की कोशिश करता हूं। [1] .अफ्रिक्सिंग द्वारा [1] इंट) या "1" के साथ तुलना करके

  यदि ((int) dt.rows [1] .ememrray [1] .ओस्ट्रॉन्ग () == 1)  < / Pre> 

या

  यदि (dt.rows [1] .इमरेरे [1] .ओस्ट्रिंग () == "1")  

jquery uploadify -


OK, I can not post all the code on this because it's just unnecessary but here's the problem.

I have a tabbed talk (ui.tabs) that contains the uploading form for uploading the file. Although on the first tab I check to determine the position of a radio bootatt that only image files or Flash files should be allowed.

I have already uploaded it, such as $ (document) .ready:

  $ ("# uploadeefi"). Uploadee ({params});  

... including 'fileDesc' and 'fileExt' parameters. In its own right, it works fine but once it starts, I want to change the settings using:

  $ ("# uploadify"). UploadifySettings ('fileDesc', 'blah blah'); . $ ("# Uploadify") uploadifySettings ('fileExt', '.ext');  

... But when I do this, firebug spots the following:

document.getElementById (a (this) .attr ("id") + "uploader"). Update settings are not a function Line 26

Now there is nothing wrong in uploading clearly, but I can have a total noodle here, is this happening Because it thinks that '#uploadify' has not been started so far?

You should look at an acceptable answer. The key is to call $ ("# uploadify"). UploadifySettings (); Submit the Upload Handler inside, or submit the Form Handler.

Overall, should be like JS code:

  jQuery (function ($) {// uploadify $ ("# uploadify"). Uploadify ({params Submit the handle form $ ("#form"). Submit (function (e) {// prefent form submit e.preventDefault (); // uploadify setting, formerly ScriptData $ ("# uploadify") UploadifySettings ("scriptData", {'file_id': '345'}); // Start upload $ ("# uploadeefi"). UploadifyUpload ();});});  

This code works for me, I hope it will work in your case. The form can be replaced by another function, such as Turn On Function Upload, which is present in the script from the uploaded website.


gdi+ - How to measure the pixel width of a digit in a given font / size (C#) -


I am trying to calculate the pixel width of the Excel column, like using the official formula from the OpenXML specification Is described. However, in order to apply this formula, I need to know the max numeric width of the normal font, which is the pixel width of the broad numerical digits. The OpenXML specification gives this example as an explanation:

Using the Calibri font as an example, the maximum digit width of 11-digit font size is 7 pixels (96 dpi). .

I have checked that it is correct by examining a calibrary 11-point digit with the correct view and it is actually 7 pixels wide. Therefore, I am trying to create a method which will return the maximum number of widths for any font / size.

I have followed the recommendations given in me, but it expects that the result does not arise. / P>

Here is my test code:

  var font = new font ("calibrary", 11.0f, font style. Regular); (Debug.WriteLine (TextRenderer.MeasureText (i.ToString (), Font));}  

for this (Var i = 0; i & lt; 10; i ++) It tells that the width of all the digits is 15.

Any suggestions please?

thanks, Tim

First let me know that the code I am showing looks like a terrible hack and I'm not presenting it as one of the measures. Instead, I'm hoping I am giving this information a bit more about the behavior of the measurement text

I have made a slight change to your code. I am measuring the length of two underscore characters, after that in the body of the loop, I underscore the desired character on both sides I am scaling down and reducing the length of two underscores alone. For the test scenario, I am getting the result of 7. Its main objective was to determine that the measurement text is a letter-rate -Description for padding on the class basis or whether the padding on the beginning / end of the string It seems that this is the latter. It is the latter. Perhaps it will inspire you with a more elegant solution, combined with some other inputs you have received.

  var font = new font ("calibrari", 11.0f, font style. Regular); Intro underscore width = TextRenderer.MeasureText ("__", font). With; (Var i = 0; i & lt; 10; i ++) {int charWidth = TextRenderer.MeasureText (String.Concat ("_", i.ToString (), "_"), font). With - underscore width; Debug.WriteLine (charWidth); }  

java - Set logging level at handler or logger? -


I am using Java logger for the first time and have seen that it is possible to set logging level through Handler.Setalval (...) or logger.Setalval (...) Although I can not find any difference, is there any difference? And if there is, then what is the recommended way to do this?

logger a specific class. However, you may have multiple handlers that are connected to that logger if you set the 'handler level' instead of the logar level, then you need to make sure that you are setting the right handler until you have many If you are not using handlers and need a good level of granulity in your logging, then it would be best if you adjust the logger level and leave the handlers alone.

Check out how good a handler and logger work together.


java newbie question -


यदि मेरे पास ऐसा कुछ है

  मानचित्र & lt; स्ट्रिंग, फ़ू & gt; कम महत्वपूर्ण चीज़ें; ... फू एफ = foos.get ("key1"); foos.removeAll ();  

क्या मैं अभी भी कर सकता हूं स्ट्रिंग s = f.getSomeProperty ();

फ़्यूज़ ऑब्जेक्ट्स का संदर्भ नहीं, पूर्ण ऑब्जेक्ट नहीं है अगर आपको फ़्यूज़ से कुछ मिलता है, तो आप उस ऑब्जेक्ट का संदर्भ लेते हैं और आप इसे संशोधित कर सकते हैं। यदि आप foos से सभी तत्वों को निकालते हैं, तो अब यह कोई संदर्भ नहीं रखता है, और उन वस्तुओं को केवल कचरा एकत्रित किया जा सकता है, यदि उस ऑब्जेक्ट का कोई अन्य संदर्भ नहीं है।

< / html>

c# - Programmatically get the number of indexed pages in Google? -


As an SEO metric, I want to get the number of programs through Google indexed pages.

(If I search for "site: mydomain.com" then I will find the number of pages).

Is there any Libe for this or do I need to parse a Google request?

You must use the Google Webmaster Tools API with the first Gmail login and functionality in Google Webmaster If familiar, check out the following developer guide:


javascript - Leaflet : only display blank page -


I am working on an app using Cordoba, Lifetlet and Ionic.

Here are my code controllers. Js:

  // map Controller ('maxictone', function ($ radius, $ rootscope, $ state, $ iNanbar bennagle, geolocation, notif) {// Change title bar content $ scope.viewTitle = "& lt; img src = 'img / map Svg 'class =' ​​nav-title-icon '/> conformer status "; $ scope.initMap = function () {var map = new L. map (' map '); var osmURL =' http: // {S} .hide / hide / {z} / {x} / {y} .png '; var osm attrabil =' map data © OpenStreetMap Contributor '; var OSM = New L. Teleline (OSMUrl, {Attribution: OSMATRB} ); Map.set Yu (New l. Leteng (47.12, 01.13), 11); Nksha.andleyr (Osm);}});  

And my HTML code for the map:

  & lt; Ion-view title = "map" & gt; & Lt; Ion-Navi-button side = "true" & gt; & Lt; Button class = "button button-icon icon ion-checkmark-round constant" ng-click = "confirmation status ()" & gt; & Lt; / Button & gt; & Lt; / Ion Neo-button & gt; & Lt; Ion material & gt; & Lt; Div id = "map" & gt; & Lt; / Div & gt; & Lt; / Ion content & gt; & Lt; / Ion-view & gt;   

When I imitate my app using the Cordova simulation iOS , it displays a blank page with a title and title with a green footer is.

If I put $ $ scope.initMap = function () on the commentary, then it displays an empty page with my blue headers and title (and any green footer).

This is the first time that I work with JS, Cordova and Ionic. Can you give me some suggestions?

Thank you!


javascript - Protractor xpath identification with lengthy xpath -


New to Protractor scripting.

There is no opinion on why I can not get the element in stack trace based on this low run?

  TempString = browser.driver.findElement (by.xpath ("/ html / body / section / div / form / section / section [2] / div / div / div [1] / Div / div / div [3] / div [2] / div [2] / div [1] / div [1] / h3 ")) gettext () .; This is the "monthly payment" field on the  mortgagecalculator.org  site. Trust 

  // span [contains ("., " Monthly payment ")] / Preceding-Separator :: H3  

Since there are two elements with the text" Monthly payment ", you can get both of them and before To get the desired one:

  var monthly payment = element.all (by.xpath (' // span [in (., "Monthly payment")] / predecessor- :: H3 ') monthly Payments. First (). GetText (); . MonthlyPayments.last () gettext ();  

node.js - passport's req.isAuthenticated always returning false, even when I hardcode done(null, true) -


I am trying to work my passport local strategy.

I've got this middleware set up:

  passport.use (new local credentials (function (username, password, done) {// returned (blank, user ); If (user name == 'ben' & password == 'benny') {console.log ("password is correct"); returned (empty, correct);} returned refund (empty, false , {Message: "wrong login"});}));  

But then here in the

  app. Usage ('/ admin', adminIsLoggedIn, admin); Function adminIsLoggedIn (req, res, next) {// If the user is authenticated in the session, then continue (req.isAuthenticated ()) back to the next (); // if they do not redirect them to the home page res.redirect ('/'); }  

It always fails and redirects to the home page.

I do not understand why this is happening? Why would not it be certified?

In my console, I can see that this password is correct printing why would not it work?

I had a similar problem. Due to the required express-session middleware for passport, it may have been fixed using the following moderators: (Express 4)

  var session = Required ('Express-session') ; // Passport Session is required for app.use (session ({secret: 'secrettexture', saved: updated: true, revert truth, // using store session on MongodiBi using Exchange session: new mongostore ( {Url: config} UrlMongo, archive: 'session'}}})); // Init Passport Authentication App Usage (passport.in initialize ()); // Continuous login session. Usage (Passport Session ());  

css - jQuery Full calndar - set fixed hight to date in month view -


I want to determine that each day will have a certain height in the month view

by default If the incidence occurs if the height of the rooms is high then its date expands. (for example).

Simple CSS does not work on TD because the events are in the html.

How can I set each day in the month "height: 120px; overflow" -y: scroll "?

thanks.

You can add in a class that the height you want is unchecked, which will override the inline style ...

< Pre> .fc-basic-view .fc-body .fc-row {height: 120px! Important; overflow-y: scroll key;}

forms - Django Admin Action using intermediate page -


I have a model with many fields. I only have some fields I want. Instead, instead of a super list, I have a little change list, then there are administration actions that can give predetermined subsets of fields.

The initial action takes me to the right page, but when I present this form gives me back whatever page specifies me, but does not update the field if needed. When I start it, I am fine with tearing it down. I think I really need to know, what to put in the action of the html = "html" to keep the recursive work properly?

I am using the Denggo 1.7. I have to cover many of my areas as a CIA thing since working in a very information safe area.

This is my admin.py

  class credential admin (Admin.ModelAdmin): field = ['reserved' R ',' reserved '] list_desplay = [' from reserve ' 'Reserved'] Category Reserved SafeformAdam (forms.form): Reserved = form. Protected (self, request, queryet): form = any plural = '' request 'submit' in the form. CF field (widget = form.txtieria, max_long = 50) reserved = forms.DateTimeField (widget = forms.DateTimeInput) def. POST: Form = self.reserveToFormAdmin (request.POST) in Form.fields f: print f print form.is_valid () Print form. Errors if form.is_valid (): reservetos = form.cleaned_data ['reserveto'] reserved bills = form.cleaned_data ['reserved by'] print "hello" count = 0 for query in the query group: plural = 's' self.message_user (Request, "Successfully secured% s cred% s: cred.reserveto = reservetos cred.reservedBy = reservedByss cred.save (), then count = 1 count + = 1."% (counting, plural)) returned HttpResponseRedirect ( Request.get_full_path (), c) if not form: form = self.reserveToFormAdmin (initial = {'_ selected_action': request.POST.getlist (admin.ACTION_CHECKBOX_NAME)} returning (request, 'administrator / reserveCreds.ht Ml ', {' creds': query group, 'form': form, 'path': request.get_full_path ()} reserveCred.short_description = "reserve this creds" action = [check_out_a_cred, check_in_a_cred, audit_creds, compareAudits, reserveCred]  

reserveCreds.html

  {% extends "admin / base_site.html"%} {% block content%} & lt; P & gt; How long and which department is the receiver credits: & lt; / P & gt; & Lt; Form action = "{{path}}" method = "post" & gt; {% Csrf_token%} {{form}} & lt; Input type = "submit" name = "submit" value = "submit" /> & Lt; Input type = "button" value = "cancel" /> & Lt; / Form & gt; & Lt; H2 & gt; Reserved: & lt; / H2 & gt; & Lt; Ul & gt; {Cred for%}%} & lt; Li & gt; {{Cred.userid}} & lt; / Li & gt; {% Endfor%} & lt; / Ul & gt; {% Endblock%}  


python - How to scrape between span tags using beautifulsoup -


I am trying to scrape the text using Python + beautiful soup. I type in the code:

  soup.find_all ("span") [0]  

It gets me:

< Pre> & lt; Span style = "margin-right: 0.9m" & gt; TEXT1 & lt; Span style = "color: # 111111; margin-left: 0.2 amy" & gt; TEXT2 & lt; / Span & gt; TEXT3 & lt; / Span & gt;

This is great but the problem is that I am removing TEXT1 , TEXT2 , and TEXT3 Want to

I do not know how to do this. If I do:

soup.find_all ("span") [0] .find_all ("span"), only me

  & lt; Span style = "color: # 111111; margin-left: 0.2 AM" & gt; TEXT2 & lt; / Span & gt;  

I think this is because in this particular & lt; Span & gt; and & lt; / Span & gt; Both include. How do I pick TEXT1 , TEXT2 , and TEXT3 ?

With a little formatting, we can see what kind of structure you have:

  & lt; Span style = "margin-right: 0.9m" & gt; TEXT1 & lt; Span style = "color: # 111111; margin-left: 0.2EM" & gt; TEXT2 & lt; / Span & gt; TEXT3 & lt; / Span & gt;  

Therefore, unfortunately, we can not use an approach because we want to access the NavigableText elements in many depths.

The only way to do this is to create a function that checks the children of a given element (which is called context under the following functions) , And if they are NavigableText elements, then assemble them

Consider: navigableString, tag def extractNavigableStrings (context) from bs4.element import: string = [] context.children In: Children: if Isinstance (e, navigableString): strings.append (e) ifinstance (e, tag): string.andend (extractivevigative strings (e)) Signal string

How we can run on your input:

  Beautiful soup from bs4 import Import Import Navigating String, tag def extractNavigableStrings (reference): strings = [] context.children for e: ifinstance (e, navigable string): strings.append (e) if iStance (e, tag): strings.andend (ExtractNavigative String (E) Return String Soup = Beautiful Soup ('' '& lt; span style = "margin-right: 0.9em"> TEXT1 & lt; span style = "color: # 111111;  

and print

and margin-left: 0.2 AM "TEXT2 TEXT3 & lt; / span & gt; / Code> Function Our Nav Displaying our list of widgets

 [u'TEXT1 ', u'TEXT2', u'TEXT3 '] 

, note that the element is returned The list does not have python wire, they are navigable string element - it's ok to sort them out, but if you want to get string content, then you Unicode (& lt; element & gt;) For example:

  nss = extractNavigableStrings (soup) string = [NIS for ns.string]] print strings # [u'TEXT1 ', u 'TEXT2', 'UITTECTA 3'] in strings: print type (s), s # & lt; Type 'Unicode' & gt; TEXT1 # & lt; Type 'Unicode' & gt; TEXT2 # & lt; Type 'Unicode' & gt; TEXT3  

html - Add font to css used in jsf -


यहां मेरी सीएसएस फाइल है:

  @ font-face {font-family: " yekan "; Src: url ("# {resource ['css: BFantezy.eot']}"); Src: url ("# {resource ['css: BFantezy.eot']}" # iefix "प्रारूप ('एम्बेडेड-ओपेन्टेपे'), url (" # {resource ['css: BFantezy.woff']} ") प्रारूप ('woff'), url ("# {resource ['css: BFantezy.ttf']}" प्रारूप ("truetype"), url ("# {resource ['css: Yekan.svg.svg']} # बीकेन ") प्रारूप ('एसवीजी'); } ...  

और मैं इस शैली पत्रक को xhtml पेज में उपयोग कर रहा हूं:

  & lt;? Xml version = '1.0 'एन्कोडिंग =' यूटीएफ -8 '? & Gt; & Lt;; DOCTYPE HTML PUBLIC "- // W3C // डीटीटी एक्सएचटीएमएल 1.0 ट्रांसक्रिप्शन // एन" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; html xmlns = "http://www.w3.org/1999/xhtml" xmlns: एच = "http://xmlns.jcp.org/jsf/html" & gt; & LT; ज: शीर्ष & gt; & Lt; title & gt; घर और lt; / title & gt; & Lt; h: आउटपुट स्टेलीशीट लाइब्रेरी = "सीएसएस" नाम = "होमस्टाइल सीएसएस" / & gt; & Lt; / h: शीर्ष & gt; & Lt; h: शरीर कुछ पाठ & lt; / h: body & gt; & Lt; / html & gt;  

लेकिन फ़ॉन्ट प्रभावित नहीं है, (गाया नहीं)।

फ़ॉन्ट फाइल src \ main \ webapp \ resources \ css निर्देशिका में है।

आपको अपनी शैली पत्रक में अपने फ़ॉन्ट को अपने पृष्ठ पर लागू करने की आवश्यकता है। उदा।

<पूर्व> शरीर {फ़ॉन्ट-परिवार: येकाना; }

python - Looping through model objects to check whether a field is populated -


I am working on a project project and how to remove the loop through all my "task" model objects Check that many "user" fields are populated by a specific type of user model object.

Is there an easy way to do it all over the model objects?

You do not have to repeat the object. For example, suppose you have a Work is a model like:

  class work (models.Model): user = model.ManyToManyField (user) ...  

The following query will return all tasks objects that contain at least one related user who is a "student":

  Task.ObagesFilter (users__ type = 'student') < / Code> 

d L'underscore ( __ ) Dijengo many-to-say, to overcome many relationships and bring Type user table columns.


symfony - Sending mail with swiftMailer SMTP and Debian -


I have a simphone app running on Debian 7 Vm. I am trying to send mail using Swift Mailer. All codes are fine while code is running but no email is received. What am i doing

Controller:

  $ message = \ swift_message :: newInstance () - & gt; SetSubject ('Hello Email') - & gt; SetFrom ('Send@example.com') - & gt; Setup ('name.lastname@gmail.com') - & gt; Setbody ('hello'); $ Mailer = $ this- & gt; Get ('mailer'); If (! $ Mailer-> Send ($ message, $ failures)) {Resonance "Failures:"; Print_r ($ failures); Return "to"; } Other {Return 'Email Successfully Sent'; }  

This is always returning "Email successfully sent". Swift mailer: Transport: "% mailer_transport%" host: "% mailer_host%" Username: "% mailer_user%" Password: "% s"

Mailer_password% "#spool: {type: memory}

parameters.yml:

  mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: null mailer_password: empty  

php.ini:

  [mail function]; For Win32 only; Http://php.net/smtp SMTP = 127.0.0.1; Http://php.net/smtp-port smtp_port = 25  

In order < / P>


google maps - How do I change the characters in the middle of a String in Java? -


I have a string that acts as the URL of a googleMaps image in my interface, and I change it It should be enabled at arbitrarily at the zoom level, I have found:

  string coordinates = latitude + "," + longitude; String URL = "http://maps.googleapis.com/maps/api/staticmap?centre=" + Coordinate + "and Zoom = 12 & Size = 400x400 and Markers = Color: Red;" + Coordinate;  

Where the zoom level on the image is determined by the number after the "& amp; zoom =" tag, how can I change this number efficiently?

The Java string is irreversible, so you can only change it by overwriting the whole string. However, you can see static parts as

  string urlFirstPart = "http://maps.googleapis.com/maps/api/staticmap?center=" + coordinatess + "& amp; zoom =" Can save in; String urlLastPart = "& amp; Size = 400x400 and marker = color: red |" + Coordinate;  

and then by zoom

  url = urlFirstPart + zoom + urlLastPart   to zoom Update url for  

python - Make a square contour plot in matplotlib -


I can not find matplotlib to create contour plot with equal x and y axes. Note that I try to define figures with equal figs (10,10) and also try to 'equalize' in the axis function. Neither work, as shown by the "circle" which is oval, is:

  import matplotlib.pyplot as import from matplotlib.colors Import from border range from martplatelib . MaxNLocator imports from ticker imports 2 2D grid for numpy np # generation X; Y = borders = 0, 1 + 0.1, 0.1), slice (0, 1 + 0.1, 0.1)] z = y + xz = z [: - 1,: -1] level = MaxNLocator (nbins = 15) .tick_values (Z.min (), z.max ()) # Select the desired look, sensible level, and define a generalization. # Examples which takes the data value and translate those levels into Plt.figure (num = none , Fig = (10,10)) = Separator = plt.get_cmap ('nip-spectral')) Value = range (minimum level, encoder = semipamp, clip = true) # shapes * point * based plot, then its bound point Centers in the environment So do plt.contour (x [: - 1,: -1] + 0.1 / 2., y [: - 1,: -1] + 0.1 / 2., z, level = level, cmap = cmap, zorder = 1) plt.colorbar () plt.axis ([0, 1, 0, 1], 'equal') plt.tight_layout () circle = plt.Circle ((0.4,0.5), 1, color = 'k', Fill = false) plt.gca (). Add_artist (Circle) plt.savefig ('not_square')  


git - Is there a way to get the latest tag of a given repo using github API v3 -


I'm relatively new to the Github API and I'm struggling to get the latest tags of a given repo.

Question: Why do I need it?

A: As a QA I am responsible for testing and issuing live and in our team about 40 artifacts (Repo in Github ). I want to create a device which lists the projects that are done after the latest tag. So that I can manage the release more efficiently.

Coming to the point

GET / repos /: owner /: repo / tags

P> But this gives a complete list of the tags of the repo.

Is there an easy way to find the latest tags from all the available tags of the above API calls?

If I repeated it through every tag to do the latest search tag (based on the timestamp of each tag) it is not done efficiently to do this because the number of tags increases in time And since I want to repeat this process for at least 10 repops.

Any help would be highly appreciated.

Many thanks in advance

GitHub has the ability to get the latest tag The API is not, as it is for this, it can be because the tags are arbitrary string, it is not necessarily the savers, but it is not really an excuse, because the tags have a timestamp, and GitHub has them Sorting sequentially when returning.

Anyway, the latest tag, you have to call that API, then sort the tag according to the rules. Since these rules are trivial (see point 11 on that link), it is better to use ().

  var gitHubPath = 'iDoRecall / selection-menu'; // example repo var url = 'https://api.github.com/repos/' + gitHubPath + '/ tags'; $ .get (url) .done (function) {var version = data.sort (function (v1, v2) {return semver.compare (v2.name, v1.name)}); $ ('# result' ) .HTML (version [0] .name);});  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> & Lt; Script src = "https://rawgit.com/hippich/bower-semver/master/semver.min.js" & gt; & Lt; / Script & gt; & Lt; P & gt; Latest Tags: & lt; Span id = "result" & gt; & Lt; / Span & gt; & Lt; / P & gt;  


objective c - NSURLIsExcludedFromBackupKey does not work on iOS 8 -


after

I use the standard method for leaving the backup:

  + (bool) addSkipBackupAttributeToItemAtURL :( inclusion NSURL *) URL (emphasis [([[NSFileManager default manager] Failaksstappth: [url path]]); NSError * error = nil; BOOL success = [URL Setarssorsvalu: @ (Yes) of: Ansuaraielai for Error of backpack: & amp; Error; if (! Success) {NSLog (@ "error except% @ from backup% @", [URL's last Gather blanket], error);} Return to Success;}  

As some people have suggested that I use this method [NSUr fileURLWithPath: Path] to do well but it does not work:

except error groups.xml backup error domain = NSCocoaErrorDomain code = 513 "Не удалось завершить операцию. (Cocoa, 513 ошибка)" from

UserInfo = 0x170272ac0 {

NSURL = file: /// private / var / mobile / Containers / Bundle / Application / 59286088 -C226-4653-A84F-A4B5D40C11DE / anatomyfree.app / groups.xml, NSFilePath = / private / var / mobile / container / bundle / Away Not / 59286088-C226-4653-A84F-A4B5D40C11DE / anatomyfree.app / groups.xml, NSUnderlyingError = 0x1702492a0 "Не удалось завершить операцию. Action is not allowed "}

This file exists. It is parsed but it can not be removed from backup. What is the reason for this?

I use iOS 8.2, iPhone 6, ru location

There is a method call :.

  NSString * path = [[Ansbindl main bundle] name Pthfosr resource file type: extension]; ns URL * url = [Ansuar file URL Vithpathः path] [Utilities addSkipBackupAttributeToItemAtURL: url];  

Try it, it works perfectly for me in iOS 8:

  NSString * documentsPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, Yes) objectAtIndex: 0 ]; NSURL * url = [Ansuar file URL Vithpath: [NSString stringWithFormat: @ "% @ /% @.% @", Dastavejpath, filename, extension]] [Utilities addSkipBackupAttributeToItemAtURL: url];  

SQL Server Copy Data With New Primary Key Without Removing Old Data -


Here's an example of what I'm trying to do:

I have a Name Table:

  ID (PK) | Foreign Kayid (FK) | Data 1 Data2  

Then say I have data such as

  1 4 John 12 2 4 Josh 13 3 4 Kelly 15  

Is there a way that I can copy this data to a single table, by changing only the primary and foreign keys?

Example:

  4 99 John 12 5 99 Josh 13 6 99 Kelly 15  

I already had a new parent (With ID 99) in my table, I have defined the primary key for auto increment, so I do not care what will be my primary key value. Now, I want to move all the rows where the foreign key ID = 4 and copy that data to that name table, where the foreign key ID = 99. I do not want to move the data. Data with foreign key = 4 should still be there. How do I do this? Any help would be greatly appreciated.

You need a INSERT SELECT statement:

< Select the name of the pre-> name (foreign cad, data1, data2) 99, data1, data from 2 where foreign key = 4

javascript - FullCalendar click and drag multiple events -


I am trying to set up a calendar where a user clicks on a weekly view and drages several times by selecting the slot ('AgendaWeek') For example - Mon 2-4, Tuesday 1: 30-2: 00, etc.

What is the recommended way to do this? Currently every time a new selection is made, the last one is automatically approved.

Every time a user selects a timerange, it creates a type of event for the user's visual response It really is not an incident yet, and when the user chooses another, it is removed.

What you need to do, adds a real event when any selection is made.

Use.

The user once triggers the slot selection (clicks and drags) every time. In it, call to add it as a real event to the calendar. And then call to remove the manual placeholder. Choose

 : function (start, end, js, scene,) {$ ("# calendar"). FullCalendar ('addEventSource', [{start: start, end,},]); $ ("# Calendar") Fullcalendar ("deselect") .; }  


ruby on rails - no implicit conversion of Symbol into Integer when migrating in production -


So I'm working on an existing app and for some reason I'm working on it and on my local environment However, when I try to flee on his thirst, I get an error?

Error:

  == 20141119113015 CreateReleasedInventoryStatus: migrating == ================ == - create_enum ("eh_released_inventory_status", ["rejected", "pending", "allocated", "issued", "transferred"]) aborted rake! StandardError: An error has occurred, and canceled the migration in the following: integer / app / vendor / bundle / ruby ​​/ 2.0.0 / gems / power_enum-2.8.0 / lib / power_enum / schema / schema_statements Any implicit conversion of symbols in rb: 84: in `[] '/app/vendor/bundle/ruby/2.0.0/gems/power_enum-2.8.0/lib/power_enum/schema/schema_statements.rb: 84: in` create_enum' / apps / Seller ' `/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in /app/vendor/bundle/ruby/2.0.0/gems/activerecord- block method_missing 4.2.0 / lib / active_record / migration.rb: 632: '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632 in the block' say_with_time ' : ` '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb: 652: in in` method_missing' /app/db/migrate/20141119113015_create_released_inventory_status.rb say_with_time : 3: `` exec_migration /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:606:in 'In Change / App / Seller / b undle / Dark red / 2 0.0 / gems / ActiveRecord-4.2.0 / lib / active_record / migration.rb: 590: `displaced 'block /app/vendor/bundle/ruby/2.0.0/gems (2 levels) /activerecord-4.2.0/ lib / active_record / migration.rb: 589: in block `displaced '/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/ Abstract / connection  

Migration file:

  Create classReliable status & lt; ActiveRecord :: Migration DEF create_enum ("eh_released_inventory_status", ["rejected", "pending", "allocated" "issued", "transferred"]) end of change  

I am also using the following gem:

  mani 'power_enum'  

Your travel syntax is going wrong for the power_enum gem that you are using.

Mani says that the syntax uses a name, then an option hash, such as:

  create_enum ("status", {...}) < / Code> 

You are using a name, then an array:

  create_enum ("eh_released_inventory_status", [...])  < / Pre> 

As far as I can tell, the solution is to change your migration line from what you have posted on the power_enum syntax, there is a bunch of examples in the README, and also It looks like it's completely and very good Is documented well.


ArcGIS for Silverlight Print Task -


When I try to use this exported web map function in the ArcGIS server from silver-light application, then server this error The feature is included in the service ...

Error executing the device: layer "site location": the 'symbol' is missing in the ordinary renderer. Failed to execute (failed to export export web map) (Export Web Map Function)

Is there a very simple symbol in this service, am I missing something?


Google Play Game Services, Android, accepting quests in Play Gams app -


I am working under

9.2

Allow to accept searches from the Play Games app.

Clicking a search tile in the Play Games app will give your game a view to allow players to accept the search.

I go to the Play Games app. I am getting my own game. I look at the Search tab, I open it. I see a list of searches on every search tile. , It says "play"

Now, this quality checklist wants me to get a specific approach to reach this game which allows to accept the search.

I can not find any related to showing a view like this anything . I have not seen any particular information in the intention of launching my app.

  • How do I know about finding out that you came into my game with a specific search tile in the Play Games app?

    Or can I explicitly set up a different activity to be removed from those search tiles?

    We spent a few hours for the same question and the answer was simple.

    Just use

    and callback registration

      gameHelper.getApiClient (). The registerConnectionCallbacks (New GoogleApiClient.ConnectionCallbacks () {@Override public void onConnected (Bundle bundle) accept started via {// Game Google button game play, // we find that a bundle with all the information on will (bundled == null) return; questEntity questEntity = bundle.getParcelable (Games.Quests.EXTRA_QUEST); if (QuestEntity == null) return; activity.startActivityForResult (Games.Quests.getQuestIntent (gameHelper.getApiClient (), questEntity. getQuestId ()), REQUEST_CODE_QUEST_UI);} @ override connection spaces (int reason) {}});  

    PHP mysqlnd/MySQL version -


    I have an old machine that uses PHP 5.3.8 & amp; MySQL 5.5.23 (found via the "Selection version ()" of mysql) However, PHP's mysqlnd driver indicates MySQL 5.0.8. what gives?

    I know that this machine needs to upgrade PHP, can this be the problem? Are mysqlnd upgraded to support "new" MySQL versions while upgrading PHP? Thanks!

    I had only one question and got the answer. Mysqlnd version numbers are not in line with mysql version number. More information on Php.net:

    It seems that MySQLD is not connected to any specific MySQL version. For example:


    reporting services - SSRS- Issue with iif containing monthname function -


    I have a data set that I'm trying to force everything in the same group 12 months ago . I am trying to do this with a SQL case when it decides all months and years> 0 months ago 0 has an int value, but when I try to put it in SSR, it does not work.

    I am trying to use this formula but do not work till I remove the 'Mahananam' function. = IIF (Fields ASGN_SUB_DUE_MONTH.Value> 0, MONTHNAME (Fields ASGN_SUB_DUE_MONTH.Value) & amp;! "" & Amp;! Fields ASGN_SUB_DUE_YEAR.Value
    , "More than 12 months ago")

    But this formula works = IIF (Fields ASGN_SUB_DUE_MONTH.Value> 0, MONTHNAME (IIF (Fields ASGN_SUB_DUE_MONTH.Value> 0 and Fields ASGN_SUB_DUE_MONTH.Value & lt; !! 13, Fields ASGN_SUB_DUE_MONTH.Value, 1)) & amp; ; "" & Fields! ASGN_SUB_DUE_YEAR.Value
    , "More than 12 months ago")

    Anyone know why and how I can solve The second function works, but I am not comfortable to leave it in reporting, which is included in the other functions of the embedded IEF.

    In advance thank you

    "itemprop =" text ">

    The issue relates to my case statement and how iif in SSR Processes, true statements from my later research IIF because all the entries in the expression need to be embedded in all parts of the expression, even when I "month") that the IIF portion with MONTHNAME is not killed (values ​​of -1 or 0) Because of this evaluation and an error,


    c# - Intermittently Access Violation Exception when calling the OpenCL function GetPlatformIDs via DLL call -


    I use'm writing an application in C # which Opansiel I use functions directly using an existing casing I want to do as I did in the past with other DLLs. When I function GetPlatformIDs phone I intermittently the following error:

      AccessViolationException An attempt was made to write to the reading process or protect memory without. It is often a sign that the other memory is corrupt.  thought 

    I started there was an error in my DLL call so I try to look at other examples of other sites and code from open source projects, but they all behave the same with them Were. If the code can find the initial call then everything else will work, but 50% of the time fails on that call. To illustrate this problem, I have followed the bare bone sample:

      using the system; Using System.Runtime.InteropServices; Namespace openclerrortest {class Program {[DllImport ( "OpenCL.dll", EntryPoint = "clGetPlatformIDs", ExactSpelling = true)] internal exile stable unsafe integer _GetPlatformIDs (uint num_entries, IntPtr * platforms, uint * NUM_PLATFORMS); Static Unprotected Zero Test () {UIT Newsflats; Int ec = _GetPlatformIDs (0, (IntPtr *) IntPtr.Zero.ToPointer (), and amp; numOfPlatforms); } Static zero main (string [] args) {test (); }}}  

    Here is a stack trace when it crashes: (UInt32 num_entries, intPtr * platforms, UInt32 * NUM_PLATFORMS on openclerrortest.program._GetPlatformIDs) (

      Openclerrortest.Program.Test (at C): \ Users \ My \ Documents \ Visual Studio 2005 \ Projects \ openclerrortest \ openclerrortest \ Program.cs: OpenCellortest.Program.Main on Line 14 (String [] args): \ Users \ MY \ DOCUMENTS \ Visual Studio 2005 \ Projects \ openclerrortest \ openclerrortest \ Program.cs: On Line System.AppDomain._nExecuteAssembly 19 (assembly assembly, string [arg]) on System.AppDomain.ExecuteAssembly (str On the Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly () in the System.Threading.ThreadHelper.ThreadStart_Context (object state) in the assemblyfile, Evidence AssemblySecurity, System.Threading.ExecutionContext.Run (executionContext executionContext, ContextCallback callback, Object state) in the system String [] args) .reading.ThreadHelper.ThreadStart ()  

    Any help would be greatly appreciated Ated.


    java - Read only one order from orders textfile based on orderID -


    I'm making a system for a restaurant. I have an order text file that saves details of the order with order details I want the user to be able to input an order ID and then only read from this order text file.

    Currently I am able to read the entire textfile and display it in jTextArea, my code is:

      string file_name = "login / orders.txt"; Try (BufferedReader accReader = new BufferedReader (new FileReader (file_name)) {ReadFile file = new readfile (file_name); String [] aryLines = file. OpenFile (); Int i; (I = 0; i & lt; aryLines.length; i ++) for {txtFullOrder2.append ("\ n" + erilline [i]); }} Hold (IOException pre) {JOptionPane.showMessageDialog (blank, "error"); }}  

    Any help would be greatly appreciated, thanks!


    c - nested functions in gcc using -std=c99 -


    The code below which I am reading is invalid c99, although I think it is gcc -std = C99 which, my The GNU extension for knowledge should be disabled which allows for the embedded function. I do not seem to understand why this is the matter.

      int main () {int E () {printf ("test"); Return 0; }; E (); Return 0; }  

    To receive a warning on a non-conformant code, you must -contact also, you will see the following ( ):

      Warning: ISO C forbids nested functions [-weederic] int e () { ^  

    To change this in an error, you can use -errorerror to change the alerts to errors or -fendantic-errors < / Code>.

    From the GCC document:

    To get all the diagnoses necessary for the standard, you should specify - Packing (or -pindi-errors if you want them to be warnings Instead known as errors)


    Data Passing from One Php page to another -


      & lt; a href = "& lt;? Php गूंज $ config_basedir;; & gt; showcart.php? Type = " $ प्रकार & Gt; बास्केट / चेकआउट देखें & lt; / a & gt;  

    उपर्युक्त लिंक को शीर्षलेख प्रोग्राम द्वारा कहा जाता है मैं showcart.php को कॉल करते समय टाइप वैल्यू देना चाहता हूं लेकिन इसके गुम रिक्त मूल्य।

    संपादित करें

    <प्री> & lt;? Php $ type = $ _ GET ['type']; गूंज "$ प्रकार"; ? & Gt; & Lt; a href = "& lt;? Php echo $ config_basedir;? & Gt;" & gt; होम & lt; / a & gt; - & lt; a href = "& lt;? Php गूंज $ config_basedir;; & gt; showcart.php? प्रकार ="। $ प्रकार & Gt; बास्केट / चेकआउट देखें & lt; / a & gt; & Lt; / div & gt;

    आप इसे एक ही गूंज के रूप में भी कर सकते हैं:

    < पूर्व> गूंज "& lt; a href = '{$ config_basedir} showcart.php? प्रकार = {$ प्रकार}' & gt; बास्केट / चेकआउट देखें & lt; / a & gt;";

    जैसा आपके पास है वहां कई वाक्यविन्यास त्रुटियां हैं, जैसे कि आपके href विशेषता पर कोई समापन उद्धरण नहीं है, और आप PHP ब्लॉक के बाहर PHP के साथ सम्मिलित करने का प्रयास कर रहे हैं।

    < / div>

    javascript - class variable that is modified by creation of instances -


    I'm interested in how to implement something in JavaScript, here's an example of Ruby:

      class person @@ count = 0 def initialize @@ count + = 1 end def self.count @@ count end end  

    each time When a person starts, the counter increases.

    joe = person.new person count = & gt; 1 Bob = Personian.nunepe = count = & gt; 2

    How do you implement it in javascript?

    You can use a property of a constructor or factory method .

    with a manufacturer:

      function person () {person.count + = 1; } Person.count = 0; Var bob = new person ();  

    with a factory method:

      function person () {var p = {} person.count + = 1; Return p; } Person.count = 0; Var bob = person ();  

    With one of these you can also use an external variable instead of putting it on the function.


    eclipse - RAD/WebSphere deployment of applet in web project -


    मेरी वेब प्रोजेक्ट एक जावा एप्लेट के साथ तैनात करेगा। मेरे कार्यक्षेत्र में मेरे पास एक ऐपलेट, वेब (और जेपीए, ईजब, कान, इत्यादि) प्रोजेक्ट हैं।

    एपलेट को फायर फ़ाइल के अंदर निर्देशिका में /applet/lib/applet.jar के रूप में तैनात किया जाना चाहिए

    वेब प्रोजेक्ट के गुणों के अंतर्गत-> तैनाती का विधानसभा मैंने स्रोत = एपलेट प्रोजेक्ट के लिए एक प्रविष्टि जोड़ा, पथ = / applet / lib / applet.jar

    जब मैं युद्ध फ़ाइल निर्यात करता हूं परियोजना से, एपलेट को उचित स्थान में शामिल किया गया है। जब मैं प्रोजेक्ट से कान फाइल निर्यात करता हूं और युद्ध फ़ाइल को देखता हूं, तो एप्लेट उचित जगह पर है अगर मैं मैन्युअल रूप से WebSphere के व्यवस्थापक कंसोल के माध्यम से कान फाइल परिनियोजित करता हूं, तो एप्लेट तैनात किया जाता है।

    हालांकि, जब मैं आरएडी के माध्यम से प्रोजेक्ट चलाता हूं, तो एप्लेट नहीं मिला है। मैंने साफ, पुनर्प्रकाशित, पुनरारंभ किया है, वेब एप्लिकेशन की स्थापना रद्द / पुनर्स्थापित किया है, कोई फायदा नहीं हुआ जादू जादू किया है।

    यह करने के लिए मैं किस सेटिंग में हूँ?

    < P>

    डिफ़ॉल्ट रूप से आरएडी कार्यक्षेत्र से परियोजनाओं को चला रहा है और कान, युद्ध और जार नहीं बनाता है। ज्यादातर मामलों में यह बेहतर है क्योंकि प्रकाशन तेज है, लेकिन आपके मामले में नहीं। आपको अपनी उपयोगिता प्रोजेक्ट को पैक जार फ़ाइल के रूप में जरूरी है।

    सर्वर से पहले निकालें प्रोजेक्ट ठीक करने के लिए, फिर सर्वर में अपने सर्वर को डबल क्लिक करें और सेटिंग सेटिंग अनुभाग पर जाएं सर्वर पर संसाधनों के साथ चलाएं । सहेजें, सर्वर को पुनरारंभ करें और अपनी प्रोजेक्ट को पुनर्प्रकाशित करें।

    फिर आपकी एपलेट परियोजना को जार फ़ाइल के रूप में सही ढंग से पैक किया जाएगा और /applet/lib/applet.jar फ़ाइल में रखा जाएगा।


    graph - Initializing a structure in C gives "declaration of anonymous struct must be a definition" error -


    I have a structure known as an edge in my C code

      Struct edge {int weight; Node * node 1; Node * node 2; };  

    Where node is another structure which is also defined in my code. When I try to declare the edge in my code then

      struct I get two errors: 1) The declaration of the unknown structure should be a definition 2) Type: ab * (struct edge *) malloc (sizeof (struct (edge));  

    The name requires a specifier or qualifier.

    Am I doing wrong? My node structure has been defined for more reference

      struct node {char data; Structure node * parents; };  

      size (structure (edge))  

    sizeof (struct edge)

    to add () to a composition tag Not allowed.


    utf 8 - QString QRegExp Remove Special Characters -


    I have a custom with latitude / longitude data in the following format:

    27 ° 34 '35.667 "45 ° 37 '28 .34"

    I want to be able to strip / remove all special characters (°, ','), but I am not able to do this with the following code:

    lat.remove (QRegExp (QString :: fromUtf8 ("[\\ ° \ '\"] "))));

    When I print the results of latitude, Finds:

    lat = "27 \ 260 34 35.67"

    It looks like this and 'letter'

    Any idea how to do this work? I would like to include the final format only empty space or letters = "27 34 35.67"

    / Div>

    I was able to work with the following:

    lat.remove (QRegExp (QString: : FromUtf8 ("[\ x00b0 \ '\"] ")));


    android - IllegalStateException while fetching contacts asynchronously -


    When I tried to bring contacts into the ontet method using the following code,

     < Code> cursor C = getContentResolver (). Query (ContactsContract.Contacts.CONTENT_URI, blank, blank, blank, contactcontact.DISPLAY_NAME); If (c. Gatecount ()> gt; 0) {log. ("Number of contacts:", string.value (c. Gatecount ())); While (c.moveToNext ()) {Log.i ("contact", c.getString (c.getColumnIndex (contactsContract.Contacts.DISPLAY_NAME)); }}  

    This worked. But when I moved the code to asyncTask-doInBackground, it is giving IllegalStateException here my code is

      secure ArrayList & lt; String & gt; DoInBackground (Zero ... Parameter) {Cursor C = mContext.getContentResolver (). Query (ContactsContract.Contacts.CONTENT_URI, blank, empty, blank, ContactsContract.Contacts.DISPLAY_NAME); ArrayList & LT; String & gt; X = new arreelist & lt; & Gt; (); If (c.getCount ()> gt; 0) {stringbilder sb = New stringbilder (); While (c.moveToNext ()) {sb.append (c.getString (c.getColumnIndex (ContactsContract.Contacts.DISPLAY_NAME)); X.add (sb.toString ()); Log.i ("contact", sb.toString ()); }} Return x; }  

    Here's my log CAT output

      E / Android Rentaim: Fasl exception: AsyncTask # 1 java.lang.RuntimeException: doInBackground while executing a error android.os.AsyncTask on java.util.concurrent.FutureTask.setException (FutureTask.java on () $ 3.done (AsyncTask.java:299) java.util.concurrent.FutureTask $ Sync.innerSetException (FutureTask.java 273) to: 124) android.os.AsyncTask $ SerialExecutor $ 1.run on java.util.concurrent.FutureTask $ Sync.innerRun (FutureTask.java:307) java.util.concurrent.FutureTask.run (FutureTask.java : 137) (JavaklangkThreadkrun on java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:569) on java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1076) AsyncTask.java:230) (thru ADJAVA: 856) Reason: java.lang.IllegalStateException: Line 0, Colonel-1 could not be read from the cursor window. Make sure that the cursor is properly started before accessing data from it. android.database.CursorWindow.nativeGetString (Native Method android.database.CursorWindow.getString on android.database.CursorWrapper.getString) (CursorWindow.java:434) on android.database.AbstractWindowedCursor.getString (AbstractWindowedCursor.java:51) At (use the cursor. Java 14.14) akshara.xcontacts.adapters.ContactsListAdapter $ contactsLoader.doInBackground (contactsListAdapter.java:100) at akshara.xcontacts.adapters.ContactsListAdapter $ ContactsLoader.doInBackground (ContactsListAdapter.java:77) asyncTask on android.os $ 2.call java.util.concurrent.FutureTask $ Sync.innerRun on (AsyncTask.java:287) (FutureTask.java:305)  at java.util.concurrent.FutureTask 

    . Run android.os.AsyncTask $ SerialExecutor $ 1.run on java.util.concurrent.ThreadPoolExecutor.runWorker on (AsyncTask.java:230) (FutureTask.java:137) (ThreadPoolExecutor.java:1076) Java.util.concurrent. $ Worker.run at ThreadPoolExecutor (Threadpool Exporter. Java / 696) at java.lang.Thread.run (Thread.Java: 856)

    Can anyone tell me what is wrong with my code? / P>

    To ensure mContext immediately before executing asyncTask

    if not working Try:

    Use ArrayList & lt; String & gt; X = new Arasuachi & lt; String & gt; ();

    Instead of:

      ArrayList & lt; String & gt; X = new arreelist & lt; & Gt; ();