Tuesday 15 September 2015

asp.net mvc - jquery load returns empty, possible MVC 2 problem? -


I have a site that wants to get some different data using asp.net net MVC /

The data to load are from these pages:

This should not be a banner, but for some reason I get an empty response, this is my JS:

& lt; Script & gt; JQuery.noConflict (); JQuery (document) .ready (function ($) {$ ('.totalDonations'). Load ('http://charity.hondaclassic.com/home/totaldonations'); $ ('# donation list'). Load ('Http://charity.hondaclassic.com/home/SharityList');}); & Lt; / Script & gt; In FireBug, I feel that the request is made and comes back with a reply of 200 OK but the response is empty, if you browse these pages then they work fine. Are you what is this?

Here is the administrative action from the MVC site:

  public proceedings total donation () {var total = "$" + repo.All & lt; Customers & gt; () .Sum (x => x.AmountPaid) .ostring (); Return content (total); } Public Action Result Charities () {Var Charities = Repo. All & lt; Company & gt; (); See Return (donation); }  

Someone forgets the stupid little thing that I have, please should have taken me 5 minutes and it's been hours!

Ajax prevents HTML from loading HTML. The correct way to do this would be to ask if there is a request from AJX and instead to find ways to change it.

  public execution total donation (string callback) {var total = "$" + repo All & lt; Customers & gt; (). Yoga (x = & gt; x.AmountPaid) .ostring (); If (! String.InsnaleAliquely (callback) {return content (callback + "({total:" + total + "})";); } And {return content (total); }} ... $ .getJSON ('http://charity.hondaclassic.com/home/totaldonations?callback=?', Function (data) {$ ('totalDonations') .html (data.total);}) ;  

caching - ASP.Net HttpContext Cache-- why do I read Null when someone else says ""? -


I have a colleague who has written the following line in the page load method in an aspx page:

  myDataSet = (Dataset) HttpContext.Current.Cache ["Dataset"];  

The first time I pressed the page HttpContext.Current.Cache ["dataset"] reads tap when it does, the value "" ( String.Empty ) and it is an exception.

We are running both ASP.NET 2.0 on our development machines, it has cleared our browser cache and runs an iisreset, yet still read that thing for the first time when it Hits the page. What can we do to explain this discrepancy to someone?

Try this instead, you should avoid killing at least exception:

  myDataSet = HttpContext.Current.Cache ["Dataset"] as DataSet;  

comments - Accessing Jcomments permission tab in joomla / Enabling hidden menus -


I'm using a no unnecessary menu to edit Joomla by super administrator That installation / uninstalling module etc. But now, I want to set jcomments permissions and I can not find the menu anywhere to do this. I found a simple settings page using the administrator / index of Php? Option = com_jcomments & amp; Task = settings

But I can not go to the permissions page because it uses AJAX (I think) .. I thought of editing the settings in the database directly but it was very Only bad will be practice .. So,

1) Can anyone tell me how to enable or how to enable those menus

2) If not possible, then I want to uninstall the old version of the zoom and make it a new one

You can change the menu to

. / Administrator / module / mod_menu / helper.php

and menu permissions

/libraries/joomla/user/authorization.php

However, if you can not install anything (United Nations), then I think that you are not just a manager (Administrator) (Can you create new users?) Then maybe it's just Joomla That's the habit of using the menu to allow your role. More information for user roles


git - What are these ^M's that keep showing up in my files in emacs? -


So I guess what could happen to this textmate, but we work in a small team and some Issues full - file conflicts in almost identical files in GIT because one line of one branch is attached to ^ m.

What should this mysterious ^ M character do, and where is it coming?

Our developers use Emacs on Windows / Mac, Mac on Mac, Coda on Mac, and sometimes Wp-Admin Text Editor.

Any one of these

I think this is Windows Public because they like their CRLF. Unix loves LF and MAC loves CR until it shows unix paths.


jQuery + Ajax Hash / History and more -


I am trying to use URL hash in jQuery to control history in Ajax and links / page book - Make markable I have tried to exclude almost every plug-in, and I think that nobody can take it to work properly, so I do not really have any code example but I have any suggestions, suggestions, Open to tutorials, etc.

The difference on one of those pages which I am trying to include is that I have a jQuery animation driven splash / loading page, which is also the same page in which all content load Will.

.. and on this link, I want to pass by all the splash / loading animation and want to load content directly based on the hash value / string (in this case, #home) .

I was trying to understand this one for a while, any help is appreciated, thanks!

What problem do you have? Set the hash tag or handle the change of the hash?

By setting the hashes, it is just a question of putting a hash in the link, for example & lt; A href = "www.voidsync com / 2010 / # page" & gt; Link & lt; / A & gt; But I think this is not your problem.

To do something really with a hash, you should have a listener function, for example hash has changed every 100 mms and works accordingly. A simple task can be:

  $ (function () {var current_hash = false; set interval (function () (if (window.location.hash! = Current_hash) { Current_hash = window .location.hash; $ ('# content'). Load ("content.php? Page =" + current_hash);}}, 100);});  

The hash has changed, if this (untested) function will check every 100ms, and if it is, then the page will be updated through Ajax.

This function also works Load the page, So if a user like page www.voidsync.com/2010/#images If the screen comes from the page, the function will automatically load the 'images'. Then history and bookmarks work.

Hope that helps, just ask if you meant something else. / P>


android - How do I use MediaRecorder to record video without causing a segmentation fault? -


I have Android I am trying to use the media. To record the media record video, and even if I'm ready for Android Runtime Segmentation Defects () here is an example:

  Create a bundle savedinstenstate {log on public}. ("Video test", "make recorder"); MediaRecorder Recorder = New MediaRecorder (); ContentResolver = getContentResolver (); Try {Super.onCreate (Saved Instantstate); Logs. I ("video test", "-------------- start ----------------"); Surface view target_view = new surface view (this); Logs. I ("video test", "creating surface"); Surface Target = target_view.getHolder (). GetSurface (); Log.i ("video test", target.toString ()); Logs. I ("video test", "new recorder"); Recorder = new media recorder (); Logs. I ("video test", "set display"); Recorder.setPreviewDisplay (target); Logs. I ("video test", "pushing surface"); SetContentView (target_view); Logs. I ("Video test", "Set audio source"); Recorder.setAudioSource (MediaRecorder.AudioSource.MIC); Logs. I ("video test", "set video source"); Recorder.setVideoSource (MediaRecorder.VideoSource.DEFAULT); Log.i ("video test", "set output format"); Recorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); Logs. I ("video test", "set audio encoder"); Recorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); Logs. I ("video test", "set video encoder"); Recorder.setVideoEncoder (MediaRecorder.VideoEncoder.MPEG_4_SP); Logs. I ("Video test", "Set maximum duration"); Recorder.setMaxDuration (3600); Logs. I ("video test", "set to information listener"); Recorder.setOnInfoListener (new listener); Logs. I ("video test", "set video size"); Recorder.set videos (320, 240); Logs. I ("video test", "set video frame rate"); Recorder.setVideoFrameRate (15); Logs. I ("video test", "set output file"); Recorder.setOutputFile (get_path (this, "foo.3gp")); Logs. I ("video test", "ready"); Recorder.prepare (); Logs. I ("video test", "start"); Recorder.start (); Logs. I ("video test", "sleep"); Thread.Sleep (3600); Logs. I ("video test", "stop"); Recorder.stop (); Logs. I ("video test", "release"); Recorder.release (); Logs. I ("Video Testing", "----------------- SUCCESS ------------------"); End(); } Hold (exception e) {Log.i ("video test", e.ostustring ()); Recorder.reset (); Recorder.release (); Logs. I ("Video Tates", "------------------- Fail -------------------"); End(); }} Public static string get_path (reference references, string fname) {string path = context.getFileStreamPath ("foo"). GetParentFile () GetAbsolutePath (); String race = path + "/" + fname; Logs. I ("video test", "path:" + res); Return ridge; } Class listeners have media recorder .Oniflister {Infos at Public Zero (Media Records Recorder, It's What Extra) {Log. ("Video Test", "Video Info:" + + "," + Extra); }}  

This issue appears to be related to the timing of the state machine for the camera

< / P>

/ div>

c++ - Program stop to running when calls a process -


I am trying to create a program that calls another process using CreateProcess. After some problems, I change my program to open just one known program:

  if (! CreateProcess (LPWSTR) "C: \\ Program Files \ Opera \\ Opera Exe ", // a module name (use command line), // command line zero, // process handle inheritable faucet, // thread handle inherentable FALSE, // set handle inherited FALSE 0, // No creation Flag Taps, // Parents use the Environmental block, tap, // Parents start Use directory; // pointer to STARTUPINFO structure and pi) // pointer in PROCESS_INFORMATION structure.  

I have found this example in MSDN, but every The times when I run my program, windows (Vista) shows an error msg: the program is running ...

Do anyone know what the problem is?

Regards, Lindro Lima

This line is incorrect:

< Pre> (LPWSTR) "C: \\ Program Files \ Opera Opera \\ Opera.exe"

LPWBost wchar_t * has been typed. Then you are putting a simple string (the array of characters that will decay for the const char * ) in wchar_t * . The probability of the end result is not even finished

Use either CreateProcessA and leave artists, or use a broad string:

  L: C: \ \ Program Files \ Opera Opera \\ Opera.exe ",  

iphone - A problem with override UINavigationController -


Now I am working with the cocos2d and I design so that I can add the navigation controller to my cocos 2D application, so I I add the navigation controller to my application. I click on touch it or not near the cocos 2d.

Now I am trying to override the Navigation Controller by adding new new class name and Navigation The heir to the controller

Init I [Super this];

- (BOOL) ccTouchesBegan: (NSSet *) touches with the event: (UIEvent *) Event {NSLog (@ "I Overriding Touch"); Yes come back } - (BOOL) touches with ccTouchesMoved: (NSSet *) Event: (UIEvent *) Event {NSLog (@ "IM Overriding Touch Men"); Yes come back }

this does not call

why you call methods Are ccTouchesBegan: withEvent: and ccTouchesMoved: withEvent: instead of the original name? When you do a UINavigationController subclass, you do not have to change the names of the methods; Instead, you should put the same name and call them on super for example:

  - (zero) touches: (nsset *) of the avant Touches with: (UIIvent *) event {NSLog (@ "I Overriding Touch"); [Super touches brinjal: left with event: incident]; } - Enhanced the touch (zero): (NSSET *) touches the event: (UIEvent *) Event {NSLog (@ "I'm Overriding"); [Super touches: touches with event: incident]; }  

objective c - problem with NSString stringWithString, in iPhone app -


This is a snippet of code that I am having problems with. I have an iPhone App that is 99% of our users. Works fine for, but maybe for 1%, I have this bug that I can not solve or reproduce at my end. The app just deposits for them, and does not actually crash (hence no crash report). Some ad hoc distribution has disclosed the problem of having this part of the code. If anyone has any ideas which is a problem then please tell me thank you.

NSString * addChar = Zero; NSString * fullname = (NSString *) ABRecordCopyCompositeName (record); AddChar = [[NSString stringWithString: [[Full name substringToIndex: 1] capitalized string]]; [FNN release]; NSMutableArray * array = [app_contacts objectForKey: addChar]; // lookup if the key exists (array == blue) // If there is nothing in the key, then create new array {nslog ("array empty"); NSMutableArray * newarray = [[NSMutableArray alloc] init]; [Navirea Dot Object: Index on One-Viewer: 0]; [App_contacts set value: newareray for: addchar]; [Newara release]; } And {nslog (@ "array is not empty"); [Array addObject: one_person]; [App_contacts setValue: array for: addChar]; } [Adcar release];

In this code:

  NSString * fullname = (NSString *) ABRecordCopyCompositeName (record); AddChar = [[NSString stringWithString: [[Full name substringToIndex: 1] capitalized string]];  

If the full name is equal to @ @, you will increase an exception when inviting [fullname substringToIndex: 1].


windows - Why would I use "Both" COM threading model instead of "Free"? -


According to

If I register my COM object with "both" or "free" threading model then the object is completely Thread-safe from Especially all uses of the global shared variable should be synchronized and all usage of member variables should also be synchronized. It is very hard.

Now I understand that using the "free" threading model is beneficial for being able to register my object and it may be worth the cost of making it completely thread-safe. But why would I want to all equally and would like to use my object instead of "both" threading model? What will be the benefit? How do I choose between "both" and "free"?

both the threading model

of the threading model The main reason for marking your constituents as a support is to improve both "performance" when the component is called single-threaded apartment (STA).

If you mark your component as an MTA and your component is made from within STA then your component will be made in a separate MTA apartment and, however, if the threading model of your component If marked as "both", then it will be built inside the apartment of the STA object and will be delivered directly.

So if you think that your component can be said within STA, all VB6 COM objects are STA) you may want to mark the threading model as "both".

A good KB article.

Free threading model

If your component uses other components marked as "Free" then you can use the "Free" thread model You may want to use if your component was marked as "both" then there may be excessive switching of apartments between the "both" components running in STA and MTA. As a general rule, try to make components close to the collar (i.e. the same apartment) while working properly in all situations.

Another condition that is explicitly blocking your component as "free" (such as thread. Sleep), if the component is marked as "both" and immediately in STA, then component STA The message will block the pump.

Other things and scenarios

If you are planning to use components in IIS, then there are other things to consider for IIS , "Both" recommended settings are primarily used by the apartments for threaded components, the use of exec + to COM + ObjectContext, and the fact that "free" threaded components use system security context (if you enter the user's security context Needing With) to avoid locking issues. For more information about IIS threading ideas, see.

COM + Support has other things to consider and how your components behave if you are run in COM + and interface points are passed and stored.

An excellent article is. Contains COM + Focus but it also discusses COM for your question, read the section titled "Threading Model Recommendations", Microsoft has removed the original article, so I'm linking to a copy.


actionscript 3 - Flash/AS3 > Font Embed causes positioning error with Chalet Font -


I am trying to embed the sheet font in the dynamic text field and it generates the vertical position of the text to jump Having been above the actual text field () Is the chalet a mess fonts? (Or more likely to be, the flow has been switched to handle the fonts) This font shows perfectly fine in Photoshop and Illustrator.

How can someone advise me to display this font properly in Flash?

Ah ... no problem ... it seems that to rearrange my fonts I had some opposition from me. I cleaned it in the old reference (OS X font book) and then closed the flash and restarted it and now things look great.


Comparing and splitting of string inside JavaScript function -


मेरे पास एक चर में एक स्ट्रिंग है:

  var test = "http: // www.gmail.com @% @ http: //www.google.com@%@http: //www.yahoo.com@%@ ";  

मैं इस स्ट्रिंग को विशेष वर्णों की घटनाओं में विभाजित करना चाहता हूं, अर्थात्: @% @ , फिर बंटवारे के बाद मैं इस बात को एक सरणी में धकेलना चाहता हूं इस तरह से:

  var spcds = []; spcds.push ( "http://www.gmail.com"); spcds.push ( "http://www.google.com"); spcds.push ( "http://www.yahoo.com");  

मुझे जो कुछ चाहिए, वह स्ट्रिंग वेरिएबल को विभाजित करता है और इसे spcds सरणी में धकेलता है। मैं यह कैसे मेरे जावास्क्रिप्ट समारोह में कर सकता हूँ कि परिणामस्वरूप मूल्य अन्य चर में संग्रहीत किया जाएगा जो मैं तब सरणी spcds को दबाएगा।

स्ट्रिंग को विभाजित करने के लिए प्रयोग करें:

  var भागों = test.split ("@% @");  

और अगर आप खाली भाग नहीं रखना चाहते हैं, तो उन मानों को फ़िल्टर करने के लिए उपयोग करें, जो खाली स्ट्रिंग नहीं हैं:

  var भागों = Test.split ("@% @")। फ़िल्टर (फ़ंक्शन (वैल) {रिटर्न वैल! = "";});  

iphone - Full screen mapkit map -


I have a mapkit view on an iPad and I want to show to all the world, but then I

  MK Cordineate region area; Region.center.latitude = 0.0f; Region.center.longitude = 0.0f; Region.span.latitudeDelta = 180.0f; Region.span.longitudeDelta = 360.0f; [Map set region: region];  

I have an error canceling the app because of an error-free exception 'NSInvalidArgumentException', Reason: 'Invalid Area' How is it OK?

Have you tried to use "area treffs"?

[mapView set region: [see Map area area blasts: area] Animated: TRUE];


asp.net mvc - Display other fields besides just the foreign key Id in a list using Linq to sql -


When I display a list of records, what is the best way to display a user name instead of author_id (foreign key) I'm using SQL on this project from Linux.

  & lt;% foreach (Miscellaneous items in the model) {%> & Lt; TR & gt; & Lt; TD & gt; & Lt;% = Html.Encode (item.Title)% & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt;% = Html.Encode (item.Author_Id)%>  

I think I have to give something to the controller or if I use the Lambda expression to call a specific area If you make your model, then your FK was in place, I can do it on foreign key values.

So on your model should be an author's property, which is linked to the author table, then you have Model.Author.Name.


html - Getting Outlook to respect margin-top: 0px on body of an email? -


I have a minor question:

I am emailing a sender and There is no margin on the top of the email - so that an image or flush with the top of the table viewport.

I have tried sticking with the margin-top in HTML email: 0 px and it works fine in Thunderbird, however, when the margin applied to test content in Microsoft Outlook is top of whether this margin There is no way to get rid of it or it is not possible in Outlook.

You & lt; Body & gt; Tag

  & lt; Body topmargin = "0" & ​​gt; Ultimately, however, Outlook is bad for providing CSS and unfortunately is going to get worse with 2010. In the mean time, in-line styles are actually only a style that works in most cases. Will do 


Grails render as XML generates an unwanted class element -


I am providing a command class in XML form via XML

  foo Submitting as XML  

Where foo is an example of a command class.

It successfully gives XML for the value of objects. However, there is also a class element in the generated XML, like, My.package.ClassNameOfCommandObject

This also happens when I do a standard domain class, as well as when I sign I use the ASXML () method

I have taken a look through the XML converter documents, You do not have the necessary options. The easiest way (though a hack) is to generate XML only, and to substitute string in the resulting string.

It may be of use - it goes a little bit in the interior of the process and where you can overwrite things

Of course, you always need very custom if you An example is the only markup builder you can use


c# - How to create a generic extension method? -


I want to develop a generic extension method which should be arranged in a longer chain sequence.

I mean

  string [] name = {"John", "Mark", "Joel", "Thomas", "Compass", "Konrad" "Andrew", "Brian", "Bill"}; Var query = names.OrderBy (a => a.Length). Since then (a = & gt; a); What is the way to develop a generic extension method?  

I tried:

  Public Static Class Extension Operations {Public Fixed T [] Alpha Lananda Vice & lt; T & gt; (This t [] name) {var query = names.OrderBy (a => a.Length). Since then (a = & gt; a); Return query; Error 1: Definition for T-Length does not include  

Error 2: Can not convert

Code> System.Linq.IOrdiredEnumerable to T [] .

The first error is because the length string < / Code> is the asset of the square, whereas the type of T parameter in your normal version is not known, it can be of any kind.

The second error is because you return only the query object, but not the actual results. You may need to call ToArray () before returning.

With little modifications you can come up with:

  Public Static Class Extension Operation {Public Fixed IEnumerable & lt; T & gt; Alpha lengthwise & lt; T, L & gt; (This IEnumerable & lt; T & gt; name, funk & lt; T, L & gt; length provider) {Name back Order By (a => Length Provider (A)). Then (a => a); }}  

You can use it:

  string [] name = {"John", "Mark", "Joel", "Thomas "," Copsy "," Conrad "," Andrew "," Brian "," Bill "}; Var Results = Name Alpha Long Weise (a => a.Length);  

sql server complex query - fetch data and search on multiple tables -


मेरे पास निम्न तालिका हैं:

  उत्पाद श्रेणी (टी 1):  आईडी नाम 
  उत्पाद मास्टर (टी 2):  आईडी नाम श्रेणी 

अब मेरे पास उत्पादों और संबंधित श्रेणी का नाम लाने के लिए निम्न प्रश्न हैं केवल एक क्वेरी:

  चुनें *, (टी 1 से नाम चुनें जहां t1.id = t2.category) से 'श्रेणी' के रूप में टी 2  

से है पूरी तरह से काम कर रहा है अब मुझे क्या करने की आवश्यकता है, परिणाम सेट पर फिल्टर ऑपरेशन करें। निम्न पर विचार करें:

  चुनें *, (टी 1 से नाम का चयन करें जहां t1.id = t2.category) से 'श्रेणी' के रूप में टी 2 से होता है जहां '% keyword%' या ' श्रेणी 'की तरह'% keyword% ' 

अब यह केवल तभी काम कर रहा है जब मैं एक कीवर्ड दर्ज कर रहा हूं जो नाम के कॉलम पर है लेकिन खोज नाम श्रेणी के आधार पर नहीं किया जा रहा है। कोई भी विचार जो मैं गलत कर रहा हूं?

बीटीडब्लू: मैं एएसपी.नेट 3.5 को एसक्यूएल सर्वर 2005 एक्सप्रेस संस्करण के साथ प्रयोग कर रहा हूं।

अपना समय और समर्थन की सराहना अग्रिम में बहुत धन्यवाद।

जॉन्स आपका दोस्त हैं:)

  T2 से चुनें। * T1.name T2 से जुड़ें t1 पर t2.category = t1.id WHERE T2.name '% keyword%' या t1.name जैसे '% keyword' ' 

uml - Numbering Messages in Enterprise Architect Communication Diagrams -


I am using Enterprise Architect (Sparks Systems) to create a UML 2.0 communication diagram. I want the number of messages to be similar to this example:

How do I start a message from 2, 3, etc.? Whenever I create a new message, it creates it as 1.x. I see how to reorder the message, but not how to start a new sequence.

The example states that "a new number begins for a new layer of division processing", but it is not mentioned how to define a new layer of processing

Understand this.

Right-click on the message Select the collaborative property.

Check the box next to starting a new group.

Click OK.


State in ASP.net Master Page -


We have a bug that we are trying to fix. It seems that a user can see the same ASPX page at the same time to other users.

I was thinking: If we store data in a property on the master page, then all pages will run at the same time viewing that data.

is a master page:

  public class MyMasterBase: System.Web.UI.MasterPage {Private int myInt; }  

Create references for the master page from aspx pages:

  MyMasterBase Master = Page. Masters as MyMasterBase;  

Two users then call the ASPX page at the same time:

  • The first user sets 1 to myInt
  • Second user
  • What will happen if the first user reads my INR value?

I hope it will be 1, but if it was 2 then

Shiraz

I like the cash problem Do not continue data between master page sessions, but cache will search everywhere in your project that you are entering information in the cache and make sure no user or session-specific data is going into it. The cache should contain only information that is applicable to all users at any time.


iphone - Capture the preview of a UIImagePickerController -


It has been asked many times. But most answers do not apply to the latest OS (3.0+) or "Apple will reject it".

The program I need is catching the image displayed in the preview of the UIMPC controller, the user takes a picture and uses the image - what exactly do I need, one of my app Getting a screenshot, which includes the camera in the background and other items on the foreground.

I have tried several methods, being the latest: iterate through all the subviews of UIImagePickerController.view and using them using the [view.layer renderInContext:] method Save as images. With this method, I can actually get all the controller's assets (buttons, etc.), but I can never see the actual preview. Has anyone installed a way to do this in 3.0+?

It has already been answered along with


c# - How much does the order of case labels affect the efficiency of switch statements? -


विचार करें:

  यदि (condition1) {// कोड ब्लॉक 1} और {/ / कोड ब्लॉक 2}  

अगर मुझे पता है कि condition1 हो जाएगा तो true अधिकतर समय, तो मुझे तर्क का कोड चाहिए के रूप में लिखित, के बजाय:

  अगर (! Condition1) {// कोड ब्लॉक 2} और {// कोड ब्लॉक 1}  

के बाद से मैं दूसरे कोड ब्लॉक में jump के जुर्माना से बचें (नोट: मेरे पास विधानसभा भाषा का सीमित ज्ञान है) क्या यह विचार स्विच स्टेटमेंट्स और केस लेबल्स के आगे ले जाता है?

  स्विच (myCaseValue) {case मामले 1: // कोड ब्लॉक 1 ब्रेक ; मामले Case2: // कोड ब्लॉक 2 ब्रेक; // आदि}  

अगर मुझे पता है कि एक मामले अधिक बार हो जाएगा, तो मैं मामले लेबल्स के आदेश को पुनर्व्यवस्थित कर सकता हूं ताकि यह अधिक कुशल हो ? क्या मैं? मेरे कोड में मैं केस लेबल्स को वर्णानुक्रम में कोड पठनीयता के लिए आदेश दे रहा था, इसके बिना वास्तव में इसके बारे में सोच रहा था। क्या यह माइक्रो-ऑप्टिमाइज़ेशन है?

"post-text" itemprop = "text">

आधुनिक हार्डवेयर के लिए कुछ तथ्य जैसे x86 या x86_64:

< उल>
  • एक बिना शर्त से ली गई शाखा में लगभग कोई अतिरिक्त लागत नहीं है, डिकोडिंग के अलावा यदि आप एक संख्या चाहते हैं, तो यह एक चौथाई घड़ी चक्र के बारे में है।
  • एक सशर्त शाखा, जिसे सही ढंग से अनुमान लगाया गया था, में लगभग कोई अतिरिक्त लागत नहीं है।
  • एक सशर्त शाखा, जो सही नहीं थी भविष्यवाणी के अनुसार, एक प्रोसेसर पाइपलाइन की लंबाई के बराबर दंड है, हार्डवेयर के आधार पर यह लगभग 12-20 घड़ियों है।
  • भविष्यवाणी तंत्र बहुत परिष्कृत हैं कम संख्या में पुनरावृत्तियों के साथ लूप्स (उदाहरण के लिए 2 से ऊपर कोर 2 पर) पूरी तरह से भविष्यवाणी की जा सकती है।
  • आप Agner में शाखा भविष्यवाणी के बारे में और अधिक पढ़ सकते हैं, यदि वे बहुत लंबे समय तक नहीं हैं, तो "दोबारा उठाए गए नोट-लेड" जैसे छोटे दोहराए जाने वाले पैटर्न का अनुमान लगाया जा सकता है। डोंगी उत्कृष्ट

    स्विच स्टेटमेंट आमतौर पर कंपाइलर द्वारा एक कूद तालिका द्वारा प्रतिस्थापित किया जाता है ज्यादातर मामलों में मामलों के क्रम में कोई फर्क नहीं पड़ेगा। यहां पर अप्रत्यक्ष छलांग के लिए भविष्यवाणी तंत्र भी हैं।

    तो सवाल यह नहीं है कि अगर आपके कूदने की अधिक संभावना है, तो यह कम से कम आपके द्वारा चलने वाले हार्डवेयर के लिए अनुमान लगाए जाने की संभावना है पर आपका कोड यह बिल्कुल आसान प्रश्न नहीं है। लेकिन यदि आपके पास एक यादृच्छिक (या छद्म यादृच्छिक) स्थिति के आधार पर शाखाएं हैं, तो संभव है कि आप इसे एक बंटाहीन कथन के रूप में बदलने की कोशिश कर सकें।


    mysql - Storing dynamic form data in DBMS, looking for the optimal approach -


    While working on a project that will completely store (completely different) forms. To store values.

    Brief description: Each 'document' has a variable amount of questions (though a constant amount in each type of document) and matching answers.

    The most useful usable approach is the following, here I have grouped the documents by 'type', which tells which questions are related to the document, in return for the answers to the matching questions .

    + --------------- + 1n + ----------- + | Document type ---------- | Questions | + --------------- + There are so many + ----------- + | 1 1 | | Is of N type. + --------------- + 1 n + ----------- ++ belongs to the documentinterity | ---------- | Answer: + --------------- + + There are so many ----------- +

    The flaw here is that To get the documents that have a question, Answer B is complex and potentially slow when the database gets bigger, which will do it faster.

    I am thinking that I have stumbled in the store's optimal view of data or if there is some clean solution that I may remember.

    You encountered a common problem: some dynamic (bunch of some different data sets One thing in general: they come from forms) are trying to use some stable (predefined structure database). Do you want to do cobbler with the database, but without it would be easy enough, since ever since I think that you really want to use a database for this, what do I want to do here

    • You have a document (or questionnaire ) which contains multiple questions are both common And your own table is required, as you've done so far
    • Each question has a type that defines what type of question it is ( select multiple selections, freeforms, ... ) And of course there are also options in question. So this is two more tables here. The argument is that this decoupling from the actual question allows for some abstract intangible existence and possibly loooooong though your questions will be a bit simpler. Therefore, in each document 1. For questions, in each question 1 type and 1 .. N options are a little skipping, here I am thinking about link tables etc.

        document bigint id document queries bigint document_id bigint question_ id bigint id varchar question type type bigint question_ id bigint type_id type [with pre-filled table id: type pairs, like 1 = freeform, 2 = Select one etc.) Q & A point ID big question Question: varchar details varchar value answer bigint id bigint document_id [etc. Such as user_id] allows such a variety of designs:  
      • Reusable yourself, very easy if you '
      • without breaking the existing types New types can be easily added.
      • You can always always navigate through the structure, for example " what is the name of the document for answering this single question? " or "how many people Has the wrong answer to this question? "
      • Types are separated, so you can create a web UI that easily shows the state in the database - better yet, if the type changes, you can touch your UI code at all Does not fall.
      • Since every possible option for the question is its line in the questionsonline table, so you can get real value very easily.

      T It is a clear problem with the fact that it requires a very strong coupling between the tables for integrity and in the beginning it will be painful to walk properly. Since then, the value has questions> varchar, you should be able to purge the content and you may want to apply another area for conversion signals too.

      Hope it helps, even if you do not agree with your solution at all.


    javascript - hide text but not input inside a label jquery -


    I have a label and input output from a shopping cart that we are using. I do not want to hack the cart origin to change it's way of output. Therefore, the code happens with the input inside the label as follows:

       Yes & lt; / Labels & gt; & Lt; / Div & gt;  

    I am trying to hide the word "yes" in the label, but I am unable to choose it. This is not a brother of input since a label and if I do not choose the input of the parent, then it makes the whole label disappear with the input. I tried forward and it wont be done, because DOM-wise text is not really next .. I can not use orphan because there is no label for its orphan. What am I missing? Thanks!

    Replace labels with checkboxes only.

      Var l = $ ('[FormField_29_0] for label'); L.html (l.find ('Input'));  

    .net - Problems with DataContractSerializer - how to correctly serialize objects deriving from List<T>? -


    निम्न नमूना कोड का निरीक्षण करें:

      नाम स्थान एक {[सीरियलज़ेबल] आंतरिक वर्ग परिसर ऑब्जेक्ट & lt; टी & gt; : सूची & lt; T & gt ;, आईक्वेटेबल & lt; कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; & gt; जहां टी: आईएक्वेटेबल & lt; T & gt; {निजी टी एम_स्टेट; आंतरिक टी राज्य {get {return m_state; } सेट {m_state = value; }} पब्लिक बॉल्स इक्वाल (कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; अन्य) {// कार्यान्वयन अंतरिक्ष को बचाने के लिए छोड़े गए हैं }} सार्वजनिक स्थिर वर्ग कार्यक्रम {सार्वजनिक स्थिर शून्य मुख्य () {var obj = नया कॉम्प्लेक्स ऑब्जेक्ट & lt; int & gt; (); Obj.state = 100; Var स्ट्रीम = नया मेमोरीस्ट्रीम (); Var सीरियलाइजर = नया डेटा कंट्रेक्टसिरियालाइजर (obj.GetType ()); Serializer.WriteObject (स्ट्रीम, ओबीजी); stream.Flush (); स्ट्रीम। खोजें (0, SeekOrigin.Begin); Var copy = (कॉम्प्लेक्स ऑब्जेक्ट & lt; int & gt;) serializer.ReadObject (स्ट्रीम); Debug.Assert (obj.Equals (कॉपी)); }}}  

    ध्यान दें कि जटिल ऑब्जेक्ट & lt; T & gt; से सूची T & gt; से निकला है।

    फिर भी, आखिरी दावा विफल हो जाता है [सीरियलिज़ेबल] के साथ [CollectionDataContract] को बदलकर और [DataMember] से m_state के समान नकारात्मक परिणाम प्राप्त कर सकते हैं। < / P>

    ऐसा लगता है कि DataContractSerializer नोटिस करता है कि वर्ग एक संग्रह है और इसके अन्य राज्य को अनदेखा करने का विकल्प चुनता है।

    कृपया इस समस्या को हल करने के लिए किसी को भी सलाह दें

    • मैं कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; के रूप में संभव के रूप में कुछ परिवर्तन करना चाहूंगा
    • मैं DataContractSerializer < />> इस प्रश्न के लिए अप्रासंगिक कारणों के लिए

      बहुत पहले धन्यवाद।

      संपादित करें:

       < कोड> सार्वजनिक बूल बराबर (कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; अन्य) {if (! M_state.Equals (अन्य। एम_स्टेट)} गिनती = अन्य। संख्या) {वापसी झूठी; } Bool परिणाम = सच; के लिए (इंट आई = 0; आई & lt; गणना & amp; amp; amp; (परिणाम = यह [i]। एक्वायल्स (अन्य [i])); ++ i) {} रिटर्न परिणाम; }  

    एक सूची संरचना को सही क्रमबद्ध करने के लिए, आपको CollectionDataContract विशेषता इस प्रकार है:

      [संग्रहडाटा कॉन्ट्रैक्ट] [सीरियलज़ेबल] आंतरिक वर्ग परिसर ऑब्जेक्ट & lt; T & gt; : सूची & lt; T & gt ;, आईक्वेटेबल & lt; कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; & gt; जहां टी: आईएक्वेटेबल & lt; T & gt;  

    हालांकि, संग्रहडाटाकंट्रैक्ट अतिरिक्त डेटामैम्बर्स को सीरियललाइज करने की अनुमति नहीं देता है। कार्यवाही सूची से इनहेरिटिंग से बचने के लिए होगी, लेकिन इसके बजाय इसे एक सदस्य चर बनाकर और वैकल्पिक रूप से आईसीओल्यूशन को लागू करना होगा, जैसे: <डेटा प्रदाता> [सीरियलिज़ेबल] आंतरिक श्रेणी के कॉम्प्लेक्सऑब्जेक्ट & lt; T & gt; : आईकॉल्लेक्शन & lt; T & gt ;, आईक्वेटेबल & lt; कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; & gt; जहां टी: आईएक्वेटेबल & lt; T & gt; {निजी टी एम_स्टेट; [डेटामेम्बर] सार्वजनिक टी राज्य {get {return m_state; } सेट {m_state = value; }} निजी सूची & lt; T & gt; एम_लिस्ट = नई सूची & lt; T & gt; (); [डेटामेम्बर] सार्वजनिक सूची & lt; T & gt; सूची {वापस {return m_List; } सेट {m_List = value; }} सार्वजनिक बाल बराबर (कॉम्प्लेक्स ऑब्जेक्ट & lt; T & gt; अन्य) {यदि (! अन्य। राज्य। एक्लॉल्स् (राज्य)) गलत लौटा; अगर (अन्य। सूची! गणना! = सूची.काउंट) झूठी वापसी; के लिए (इंट आई = 0; आई & lt; अन्य.लिस्ट.काउंट; i ++) {if (! अन्य। सूची [i]। एक्लॉल्स (लिस्ट [i])) लौट आई; } वापस सच; } // आईकॉल्किंग के सदस्यों को रिक्त करने के काम की रकम / कम करने के लिए सूची के चारों ओर लपेटने के लिए स्थान / सहायक विधियों को बचाने के लिए बाहर छोड़ा गया था, आपको सार्वजनिक शून्य जोड़ें (टी आइटम) करना होगा {List.Add (item); } सार्वजनिक बाल निकालें (टी आइटम) {वापसी सूची। निकालें (आइटम); } सार्वजनिक टी इस [int index] {get {return list [index]; }}}

    पर क्लिक करें

    jquery select parent problem -


    नीचे नमूना html मार्कअप

      & lt; div class = "container answer_comments" & gt; & Lt; p class = "comment_text" & gt; हे कि अच्छा नहीं है। & Lt; / p & gt; & Lt; p class = "comment_attribs" & gt; अनाम उपयोगकर्ता द्वारा 1 दिसंबर को & lt; / p & gt; & Lt; p class = "comment_text" & gt; क्या यह वास्तव में क्यों? & Lt; / p & gt; & Lt; p class = "comment_attribs" & gt; 27 नवंबर को व्यक्ति द्वारा & lt; / p & gt; & Lt; p class = "close_comments" onclick = "close_comments ()" & gt; बंद करें & lt; / p & gt; & Lt; / div & gt;  

    JS फ़ंक्शन:

      फ़ंक्शन close_comments () {var comments_wrapper = $ (this) .closest ('। Answer_comments'); comments_wrapper.slideUp (); }  

    .answer_comments बंद नहीं होगा यह है कि क्योंकि आई $ (यह) गलत का उपयोग कर रहा है? पृष्ठ पर कई बार इस div को दोहराया जाता है, मैं क्या करने की कोशिश कर रहा हूं, यह सबसे अच्छा तरीका क्या होगा?

    जांचें कि यह क्या है, यह संभवतः फ़ंक्शन की बात कर रहा है, तत्व

    परिवर्तन

      & lt; p class =" close_comments "onclick = "close_comments ()" & gt; बंद & lt; / p & gt;  

      & lt; p class = "close_comments" onclick = "close_comments (यह)" & gt; बंद करें & lt; / p & gt;  

    और समारोह

      समारोह close_comments (तत्व) {var comments_wrapper = $ (element) .closest ('। Answer_comments'); comments_wrapper.slideUp (); }  

    और देखें कि क्या होता है


    multiplying - SQL-Doesn't return a value when the columns are multiplied -


    I have 3 columns in my DB table, I want to multiply the column, itm_count & amp; Total output for itm_price and given id (itm_id) Total ods_temporder WHERE itm_id = '11 '

    as the SELECT sum (itm_price * itm_count)

    I use the above SQL query to do this Tried, but the result was zero.

    What is this giving you?

      SELECT itm_price, itm_count fds ods_temporder WHERE itm_id = '11 ' 

    either itm_price or itm_count NULL? Do you have itm_id = 11? There are rows for


    How do I Change the Sheet Name from C# on an Excel Spreadsheet -


    I have C # applications where I am creating several Excel files from the database in the database, though this part is working fine , My user asked if the sheet tab can be modified to display the field from the database. It sounds simple, however, when I try to reset the name, it tells me that it is read only and can not be set. I have tried the following and it is not working:

      xlApp.Sheets [0]. ["A1"]. Value = "newtname"; Also try:  
      xlApp.Name = "NewTabName";  

    I saw a Google search and some other methods that were not working for me and some reactions indicate that it is only readable and can not be done .

    Something looks like that should be simple. How can i do it

    You need access to the actual worksheet. Try doing something like this:

      Microsoft.Office.Interop.Excel.Worksheet worksheet = (worksheet) xlApp.Worksheets ["Sheet1"]; Worksheet Name = "newtname";  

    Sql Shorthand For Dates -


    Choose what type of query

      choose from log_table where 'dt & gt; = 'Nov-27-2009' and DT & lt; 'Nov-28-2009';  

    But you can only specify on 1 date and say that the next day the result should be for the entire day.

    I'm just making it up, but something like this:

      select from log_table * where dt = 'neo-27-2009': + 1;  

    I do not think there is a method which is portable for all RDBMSes

    In one of my references, the investigation () shows that no RDBMS solves the problem in the same way, I recommend to check Chapter 8 of that book, which includes DB2, Oracle, All different methods have been included for postgresql, mysql.

    I do not address with this problem, however, and SQL cookbook RDBMS, so I will mention something about it here. does not have date / time data type in SQLite ; You must create all your date / time data by storing it as TEXT and make sure that your application implements its formatting, which is a set of SQLite data, Allows you to add a nominal date / time while retaining in case you want to add two periods of each time (hh: mm: ss), however, depending on the data that you have typed T column, which you are treating as a date / time data, you need to call (search "definition of SQLite user work") and call sqlite3_create_function () Attach them to the database at runtime. If you want an example of some user functions that add time values, let me know.


    Resizing images on iPhone for UITableView image -


    I am using a sectioned tableview, and I want to display an image on the left side of the cell. If I choose one from the photo library (in the example simulator the photo) and it will look at the UITB Set as image, it takes the whole screen.

    How can I change the image size so that it fits perfectly into the image view of the cell?

    Thanks,

    Yassin

    This is basically There is a similar question, who has it.

    Add that project to that project and call it The size of your scene I used the code and it works well.


    common errors and fixes in C++ -


    Does anyone have a site that teaches how to fix normal compressor errors for new ones? Not a type of name, etc.?

    It is a good resource to know what to do and what not to error message Paste in a search engine often helps.


    c# - WPF - Binding in XAML to an object created in the code behind -


    Can an object created in code (i.e. C #) be used to force XAML?

    For example:

      Public class MyForm {Private MyComplexObject complexObject; Public MyForm () {InitializeComponent (); } Public OnButtonClick (Object Sender, RoutedEventArgs E) {complexObject = new MyComplexObject (); }}  

    Complex object is not created until the button is clicked. But once I click on that button, I have a text box which is starting to show the complexObject.ID id.

    I want to do it in XML if it is possible.

    Can this be done? if so, how?

    There is a possibility that your XML should be tied to an asset behind your code. Recipient complex object for that property ID will return, if complex object! = Null otherwise, it gives something "default", whether it is zero or 0 or default ( type of ID ). Similarly, for a complex asset the setter must assign value to complex object if there is a complex object, again, not blank.

      public entry id {get (if (complexObject! = Null) back complex object.ID; return 0; // or empty or some appropriate default} set {if (complexObject! = Null) ComplexObject.ID = value;}}  

    Get all selected items from asp.net ListBox -


    Anyone knows an easy way to get selected items in the CatalogBox control extension Methods?

    And, please let me argue that is irrelevant how to get such a list because in the end everything uses a loop to use an item and anyway the selected people Finds

      var selected = yourListBox.Items.GetSelectedItems (); // var selected = yourDropDownList.Items.GetSelectedItems (); // var selected = yourCheckBoxList.Items.GetSelectedItems (); // var selected = yourRadioButtonList.Items.GetSelectedItems (); Public Static Class Extensions {Public Fixed IEnumerable & lt; ListItem & gt; GetSelectedItems (this ListItemCollection item) {return items. Optty Type & lt; ListItem & gt; (). Where (item => items selected); }}  

    css - Center a dynamic width box -


    छद्म एचटीएमएल

      & lt; div & gt; & LT; ul & gt; & Lt; li & gt; नेवा 1 & lt; / li & gt; & Lt; li & gt; नेवी 2 & lt; / li & gt; & Lt; / ul & gt; & Lt; / div & gt;  

    मुझे यह देखना है कि

    [DIV --------------- [UL nav1 nav2] - ---------------------]

    इसके बजाय मुझे

    [DIV [उल] मिलता है Nav1 nav2 ----------- पैडिंग -------------------]]

    ली की बचे हैं जारी। उल अतिप्रवाह है: ऑटो मैं उल जितना व्यापक हो सकता है, उतना विस्तृत नहीं जितना हो सकता है, इसलिए मैं इसे ऑटो मार्जिन के साथ केन्द्रित करूँ?

    कोशिश करें:

      div {text-align: center; } उल {प्रदर्शन: इनलाइन; }  

    आप भी जोड़ने का प्रयास करना चाह सकते हैं:

      li {display: inline; }  

    c# - .Net How to get notified efficiently when a thread is suspended? -


    Do you know any way to suspend a particular thread and notify it on startup?

    I would like to be able to do something like this:

      thread Suspended + = delegate {// something}; Thread Re + representative {// do something else};  

    I suspect that this Net Framework has this capability, but is it possibly a technique to achieve with Pinovok? I should be able to do this with less overhead.

    If you are committed to writing your own thread pool it probably does not help, but I Staying with the .NET ThreadPool class and try to tune it to be required with SetMaxThreads / SetMinThreads and GetMaxThreads / GetAvailableThreads. Is there any special reason that this is not enough?

    I was in PDC last year and in some of which Duffy's talk of equality was very interesting. I remember that he was talking about providing an extensible thread pool class in NATT because MSFT usually finds that when people write their own thread pools and write they will work most of the time, one By providing extension mechanisms they were hoping that they limit the ability of the gods to be caught.


    Django: using ForeignKeyRawIdWidget outside of admin forms -


    I am trying to find some documents to use foreign carriagewidth in my own forms. Currently I'm getting the error, "at least 2 non-keyword arguments" (1 given) " init () gets" which tells me nothing.

    Any help would be most appreciated Googling It changes a bit but Dev conversations and there is no such example how I can implement it.

    Update : it is resolved; See the solutions below.

    As DJ ango 1.5, it works in non-admin forms to reuse foreign carriagewidth Does. Django.contrib.admin.sites Import Site Category from InvoiceForm (ModelForm): Category Meta: Model = Invoice Widgets = {'Customer': External CarrierWidgets (Invoice _Meta.Gate_Field (Customer).

    ') .rel , Site)}}

    osx - Awk strftime on Mac OS X -


    The following command gives me an undefined function error on my Mac (10.6):

       

    $ Awk 'BEGIN {now = strftime ("% D" System ()); Print:} 'awk: Undefined Function StormTime Calling Source Line Number 1

    On a Red Hat system, I get the expected result:

      $ Awk 'BEGIN {now = stafttime ("% D", system ());   

    What's the deal here? <> P> Sprime is a GNU Gock Extension If you want to use Sprime, download GNU and install it on your Mac.Otherwise, there are other tools like Perl / Python that you can use to check whether you have your own Is on Mac


    download - Segmented C# file downloader -


    Trying to write a program in C # that downloads files using multiple segments , Like most download managers, they run into problems that are downloaded files that are broken eg. I download a video and play it for 2 seconds, then WMP says that it is impossible.

    I hexhed the downloaded file and it appears that there are squares of scattered zerbites throughout the file, why have anyone got any idea? VS does not report any errors.

    Each segment is called getPart () in a separate thread.

      Launch public launch; Public long end; Public int thread; Public form 1 handle; Public myFile handler; Public Zero getPart () {log ("get share" + start.ToString () + "," + end.ToString ()); HttpWebRequest part = (HttpWebRequest) WebRequest.Create (Handler. Url); Part.AddRange ((int) start, end (interval)); HttpWebResponse PR = (HttpWebResponse) part.GetResponse (); Stream rstream = pr.getResponseStream (); Logs ("start up" + start.ToString ()); Int'l count = 0; Byte [] buffer = new byte [256]; Int x = rstream.Read (buffer, 0, 256); While (x> gt;) {handler.litfile (buffer, (int) (total + start), x); Kulbite + = X; X = rstream.Read (buffer, 0, 256); } Log (start.ToString (+) + "-byte started part ran ..."); Rstream.Close (); Pr.Close (); Handler.partDone (thread); Return; } Public Zero WriteFile (Byte [] buffer, integer start, integer size) {mFileStream.Seek (SeekOrigin.Begin); MFileStream.Write (buffer, 0, size); Return; }  

    OK I thought it, just thought I would leave an answer to this For anyone with type of issues, a lock is required around the file writing stream.

      Public Waste Written File (Byte [] Buffer, Integer Start, Integer Size) {mFileStream.Seek (SeekOrigin.Begin;); MFileStream.Write (buffer, 0, size); Return; }    

    becomes

      write public zero file (byte [] buffer, integer start, integer size) {lock (mFileStream) {mFileStream .Seek (Start, SeekOrigin.Begin); MFileStream.Write (buffer, 0, size); Return; }}  

    Is C++ code generation in ANTLR 3.2 ready? -


    I was trying to create ANTLR 3.2 parser / lexer generated in C ++ it was in vain Java & amp; C. However

    I was using this tutorial to get started:

    When I checked * .stg files then I found that:

    CPP There are only so many files in

    ./tou/ src / main / resources / org / antlr / codegen / templates / C / AST.stg ./tool/src/main/resources/org/antlr/codegen/templates/ C / ASTDbg.stg ./tool/src/main/resources/org/antlr/codegen/templates/ C / ASTParser.stg ./tool/src/main/resources/org/antlr/codegen/templates/C/ASTTreeParser Stg ./tool/src/main/resources/org/antlr/codegen/templates/C/C.stg./tool/src/main/resources/org/antlr/codegen/templates/C/Dbg.stg

    and in other languages ​​as well.

    My CG file:

      Grammar C; Option {language = 'CPP'; } / ** things like "call fu;" * / R: 'Call' ID ';' {System.out.println ("invoke" + $ ID.text);}; ID: ('a' .. 'z' | 'a' .. 'z' | '_') ('0' .. '9' | 'a' .. 'z' | 'a' .. ' Z '|' _ ') *; WS: ('' '\ n' | '\ r') + {$ channel = HIDDEN;}; // Error:  

    Errors:

      Error (10): Internal Error: Group CPP Interface ANTLRCore does not satisfy: missing templates [lexerRuleRefAndListLabel, parameterSetAttributeRef, scopeSetAttributeRef, returnSetAttributeRef, lexerRulePropertyRef_text, lexerRulePropertyRef_type, lexerRulePropertyRef_line, lexerRulePropertyRef_pos, lexerRulePropertyRef_index, lexerRulePropertyRef_channel, lexerRulePropertyRef_start, lexerRulePropertyRef_stop, ruleSetPropertyRef_tree, ruleSetPropertyRef_st] error (10): internal error: group CPP interface does not satisfy ANTLRCore: these templates mismatched argument [outputfile ( Lexer, PARSER, TREE_PARSER, exc No scope, action, dock comment, identifier, name, token, Toknnam, rules, cyclic DFA, bits, build template, build AST, rewrite mode, Profile, backtracking, Sinkrad, Memoaijh, Numul, filename, Aantielarwarsian, Jenaretmstamp, trace , Scopes, superclass, Litrl), optional Hederfail (LEXER, PARSER, TREE_PARSER, ActionScope, functions, DocComment, identifier, name, token, TokenNames, rules, cyclicDFAs, bitsets, buildTemplate, buildAST, rewriteMode, profile, contrary finding And returning, synpreds, memoize, numRules, filename, ANTLRVersion, generatedTimestamp, detection, scope, superclass, literal), lexer (grammar, name, token, scope, rule, numRules, labelType, filterMode, superclass) rule (RuleName, RuleDescriptor, block, EmptyRule, details, exceptions, finally, memoize), ALT (element, AltNum, details, autoAST, outerAlt, treeLevel, rew), tokenRef (token label, ElementIndex, Hetero), tokenRefAndListLabel (token label, elementIndex, Hetero), listLabel (labels, ELEM), charRangeRef (A, B, label), ruleRef (rules, labels, elementIndex, args, scope), ruleRefAndListLabel (rules, labels, elementIndex , Args, scope), LexerRuleRef (rules, labels, args, ElementIndex, scope), LexerMatchEOF (labels, ElementIndex), tree (root, ActionsAfterRoot, children, taps qualified Chaildlist, gaps, tree level)] Error (10): Interior Arro R: CG: java.lang.IllegalArgumentException: The template action can not be found; gate. Group hierarchy [CPP]  

    ... and so on.

    Please advise. Thanks! I am using Leopard 10.5.8

      CLASSPATH =: / user / merge / project / anther-3.2.jor: / users / vivalent / project / strimentplate-3.2.2 / lee / Stringtemplate-3.2.1.jar: / Users / Vivelt / Project / StringTamplate-3.2.1 / Lib / antlr-2.7.7.jar  

    It looks like you have answered your question: ANTLR's C ++ laser / parser generator is not yet functional Yes.

    What is the value for it, it is still possible to use ANLR to parse C ++ through C target. I use the ANTLR to generate C-language lexers and parsers. I am compiling it, and then I link it to my C ++ code.

    I have a C ++ file which translates into my target abstract syntax tree sections of an ATLR payse tree, and does not care about the rest of the code that where AST comes from. It works very well in practice! It would be easy to replace the ANLR with a different parser generator, and I think the separation cleaner leads to ANLR grammar.


    How can I convert PHP Code Sniffer XML report into HTML? -


    Can you suggest some method of converting the PHP code sniffer XML report into HTML page (s). I think I might need to translate some XSLT ... thanks in advance for advice.

    I posted a few days ago on my blog XSLT stylesheet: with a new type of report: xsl.


    c# - How to simulate a "Func<(Of <(TResult>)>) Delegate" in .NET Framework 2.0? -


    I try to use this class in VB.NET and with the .NET Framework 2.0 class.

    more method headers public sub-new (funnel (as of the tresult) byc worker) .

    It seems to compile everything except this line Private _workerFunctionFunc (of TResult) >

    I can find at MSDN that these new representatives (Funk (Off ... ) Are supported from. 3.5.

    How can I work in .NET 2.0?

    P>

      public representative Te Funke & lt; t & Gt; ();  
    < / Html>

    artificial intelligence - What is the difference between supervised learning and unsupervised learning? -


    In case of artificial intelligence and machine learning, can you provide a basic, easy explanation with an example?

    Since you ask this very basic question, it seems to be the only thing to know the machine worth a shot. The machine learning algorithm is a class that is data-driven, that is the data that "tells" is a "good answer", unlike "normal" algorithms. Example: To detect face in images, a hypothetical non-machine learning algorithm will try to determine what the face is (like a round disk with a dark area, where you expect eyes). A machine learning algorithm does not have such coded definition, but will be "learn-by-example": You will show many images of face and no face and a good algorithm will eventually learn and it will be able to predict whether an invisible image The face is.

    This specific example of face detection is supervised , which means that your example should be labeled , or explicitly say who There are faces and people who are not.

    Your examples in the Unsorganized algorithm are not labeled , that means you do not say anything. Of course, in such a case the algorithm itself can not face "invention", but it can try data in different groups, e.g. It can detect that the faces are very different from the landscape, which are very different from the horses.

    In another answer it has been mentioned (though, incorrectly): there are "intermediate" forms of supervision, i.e. semi supervised and active learning Technically, these supervision methods have some "smart" ways to avoid a large number of labeled instances. In active learning, the algorithm itself decides what you should label (for example it can be very convincing about the scenario and the horse, but it can ask you to confirm whether the gorilla actually Is a picture of a face). In semi-supervised education, there are two different algorithms that begin with examples labeled, and then each other tells "something" that they think of a large number of unreserved data that they learn from this "discussion" Are there.


    .NET WinForms startup crash -


    It seems that on some clients our WinForms crashes at startup. With some I mean very rare. In one situation we found that the Arial SystemFort was corrupt and was due to crashing in initialized material on startup. To find out that we were very hard, only one clue was an event log entry, the system. The drawing module made the cause of the accident.

    Now I have such a situation again, but this time the faulty module is "unknown" and I am wondering how people are disposing / debugging such accidents. I have an exception handler around the initial components Tried to wrap but it did not catch anything.

    How does anyone advise about these crashes?

    You always catch exceptions at main and in your error log Paste exceptions only after you can debug and know for yourself.

    For error logging tools, you can try, or just write in a simple flat file.


    c++: CGAL 2D delauny triangulation: Concave Shapes -


    I am currently meeting CGAL for some 2D triode tasks and I find something simple to do anything has gone. Either way I actually get to actually triangulate the gap size from now on, I always get the convex hull of all the points. Actually I want to add points on the mouseclick as it works in the drawing, so that all of them in order Point shape should be outlined. How can I do this with CGAL? In general, a simple example of making concave shapes triangular will take me on the right path! Thanks!


    forms - php associative array and switch -


    मेरा साहचर्य सरणी।

      $ money = array ("Nickels" = & gt; $ _POST ["निकेल"], "डाइम्स" = & gt; $ _POST ["डाइम्स"], "क्वार्टर" = & gt; $ _ POST ["क्वार्टर"]);  

    क्वार्टर, डाईमेस और निकेल को संभालने के लिए सेट अप करने के लिए मेरे एचटीएमएल फार्म संक्षिप्तता के लिए इस मामले में नहीं दिखाए जाते हैं।

      & lt; label & gt; & lt; b & gt; क्वार्टरों: & lt; / p & gt; & lt; / लेबल & gt; & Lt; चयन करें नाम = "क्वार्टर" & gt; & Lt; विकल्प मान = "। 25" & gt; 25c & lt; / विकल्प & gt; & Lt; विकल्प मान = "। 50" & gt; 50c & lt; / विकल्प & gt; & Lt; विकल्प मान = "। 75" & gt; 75c & lt; / विकल्प & gt; & Lt; विकल्प मान = "1" & gt; $ 1.00 & lt; / विकल्प & gt; & Lt; / चयन & gt;  

    कोई उपयोगकर्ता केवल केवल क्वार्टर, केवल डाइम्स, या निकल्स का चयन कर सकता है यदि कोई उपयोगकर्ता .25 के विकल्प मान के साथ क्वार्टर का चयन करता है, तो यह मान php स्क्रिप्ट पर भेजा जाएगा।

    इसलिए मैं इस तथ्य के आधार पर गणना के लिए सोच रहा था कि उपयोगकर्ता केवल एक के साथ क्वार्टर चुन सकता है मूल्य, केवल एक मूल्य के साथ डाइम्स, और निकेल केवल एक मूल्य के साथ, और संप्रदायों का एक संयोजन नहीं है,

    उदाहरण के लिए, उदाहरण के लिए यदि कोई उपयोगकर्ता $ का चयन करता है पैसे ["क्वार्टर"]; //। Html, .25, .50, .75, या 1 के रूप में आने वाले विभिन्न मानों के साथ, और चयनित मानों में से केवल एक इसे php स्क्रिप्ट पर निर्भर करेगा

    क्या मैं यह कर सकता हूं:

      स्विच ($ चयन) {मामला "क्वार्टर": गूंज "आपने $ पैसे चुना [क्वार्टर '] ; । & Lt; br / & gt; "; टूटना; मामले "निकल": गूंज "आपने $ पैसे चुना [निकेल ']; । & Lt; br / & gt; "; टूटना; मामले "Dimes": प्रतिध्वनि "आपने $ धन चुना ['Dimes']; । & Lt; br / & gt; "; टूटना; डिफ़ॉल्ट: प्रिंट "कृपया एक मूल्य का चयन करें"; }  

    न्यूबूट फ्लेमिंग के लिए धन्यवाद, मैं अब भी सीख रहा हूं और " और " के संदर्भ में मिश्रण और मैच के लिए खेद है। कोड>।

    एक रूप में चयनित मान को $ _ POST ['quarters'] के रूप में जमा किया जाता है

    मैं समझता हूं, कि आप जांचना चाहते हैं, अगर उपयोगकर्ता ने आपके से अधिक एक का चयन करें & gt; s (सही?) का चयन किया है

    तो, मैं इस तरह एक चेक बनाऊँगा:

      $ चयनित = 0; यदि ($ _POST ['quarters']! = "DEFAULT_VALUE_OF_YOU_SELECT_QUARTERS") {$ चयनित ++;} अगर ($ चयनित & gt; 1) {$ $ _POST ['निकेल']! = "DEFAULT_VALUE_OF_YOU_SELECT_NICKELS") {$ select ++;} अगर ($ _POST ['dimes'] = "DEFAULT_VALUE_OF_YOU_SELECT_DIMES") {$ चयनित ++;} {/ / उपयोगकर्ता ने एक से अधिक}  
    को चुना है

    Converting ../ in paths in Ant -


    I have an ant in which it has the line:

    WORKSPACE.dir = $ {Baseir} /../

    Then I have:

    CORE_PROJECT.dir = $ {WORKSPACE.dir} / UUI_Core

    Which means that I end up with such paths:

    C: \ Dev \ Vertical \ RTC \ UUI_Core_ANT /..// UUI_Core < / Code>

    It works fine in almost all cases but I try to make a list of classes used in a build I ha. At the moment I have this code:

      & lt; Pathconvert property = "coreClasses" pathsep = "dirsep =". " Refid = "coreSources" & gt; & Lt; = = "C: \ dev \ workspaces \ RTC \ UUI_Core \ src \" from = "" = & gt; & Lt; Mapper & gt; & Lt; Chainedmapper & gt; & Lt; = "*." From globmapper = "*" /> gt; & Lt; / Chainedmapper & gt; & Lt; Chainedmapper & gt; & Lt; = "*. As" from globmapper = "*" /> & Lt; / Chainedmapper & gt; & Lt; / Map & gt; & Lt; / Pathconvert & gt;  

    Which file space and JSUT package work to quit? Although it is not very flexible. I should be able to use CORE_PROJECT.dir here.

    So, how can I change

    C: \ dev \ workspaces \ RTC \ UUI_Core_ANT /..// UUI_Core

    to

    C: \ देव \ workspace \ RTC \ uuI_Core

      WORKSPACE.dir = $ {baseir} /../  

    This is not a valid anti syntax. To convert location attribute & lt; instead of location Property & gt; should work using . Location replaces the attribute value with a full path in your case:

      & lt; Property Name = "WORKSPACE.dir" location = "$ {baseir} / .." />  

    edit : When using path-like properties, use the always location attribute needed.


    mysql - SQL Performing a search/replace search -


    I have to find the specific columns for every occurrence of the string and change it with a different string. Column is a MySQL TEXT column I

      update TABLE_NAME set FIELD_NAME = (FIELD_NAME, 'find this string', 'instead of the string with this string');  

    asp.net - How to escape string in .aspx -


    I am trying to make this string work, I can not save it properly or I use wrong syntax I am "vs."

      & lt; A href = "& lt;% # string.format (" {0} items not irrelevant = truth and id = {1} ", page, & lt;% # container DataItem.Id)%> & gt; ... & lt; / A & gt;  

      & lt; A href = '& lt;% # string.format ("{0}? Item = true and id = {1}", page, container.datetime.id)%> & Gt; .. & lt; / A & gt;  

    ... everything is wrapped for reading power. It can all be alive in a row.


    c# - Difference between Assembly.CreateInstance and Activator.CreateInstance? -


    इन कॉलों के बीच अंतर क्या है?

    कोई भी नहीं विधानसभा.यंत्रण वास्तव में क्रियाशीलता को कहते हैं। हूड के तहत तैयार करें।

    विधानसभा पर परावर्तक का उपयोग करें। CreateInstance:

      सार्वजनिक वस्तु CreateInstance (स्ट्रिंग प्रकारनाम, bool ignoreCase, BindingFlags bindingAttr, बाइंडर बाइंडर, ऑब्जेक्ट [] एजीआर, कल्चरइन्फ़ो कल्चर, ऑब्जेक्ट [] एक्टिवेशनऍटिवेट्स) {प्रकार प्रकार = यह.टेट टाइप (टाइपनाम, झूठे, अनदेखा करें); अगर (प्रकार == शून्य) {वापसी नल; } वापसी क्रियाशीलता। रचना (प्रकार, बाध्यकारी अटूट, बाइंडर, आर्ग्स, संस्कृति, सक्रियण गुण); }  

    asp.net - HTML table row height -


    HTML और amp; सीएसएस प्रश्न:

    मैं अपनी तालिका पंक्ति को एक पंक्ति में (5 मिमी की ऊंचाई, 30 मिमी लंबाई) सीमित करने की कोशिश कर रहा हूं। लेकिन यह उस आकार में रहना चाहिए, भले ही यह इस स्थान में फिट न हो (क्योंकि मुझे ढाल पृष्ठभूमि के आकार के आकार की तलाश वाले चित्रों में समस्याएं आती हैं)।

    मैं यह कैसे कर सकता हूं?

    <पी>

    // जीआरएस / स्टैंडॉर्टे / जी 080 ज़्यूरिच स्किंडलरस्ट्रस / स्टैंडऑर्टडीटन / गेब्यूडेडेन / ई01 / ट्रैक 2 / सीकरहेट्सडोकॉमेंटेशन / / एपीसी <पी>

    जैसा कि पहले से ही कहा गया है, आप सभी पाठ को एक पंक्ति में रखने के लिए white-space: nowrap की कोशिश कर सकते हैं सामग्री को अनियंत्रित रूप से बढ़ते हुए (आप को div को td में उस कोड के लिए काम करना पड़ सकता है) को रोकने के लिए अतिप्रवाह: छिपा हुआ जोड़ें सुनिश्चित करें कि td अतिप्रवाह का सम्मान करता है: छिपा हुआ है।) तब तक काम करना चाहिए जब तक कंटेंट में कोई लाइन ब्रेक या ब्लॉक तत्व न हो।

    यह कभी भी 100% निर्दोष समाधान नहीं होगा, हालांकि। उपयोगकर्ता ने एक बड़े फ़ॉन्ट आकार का चयन किया हो सकता है, केवल एक पंक्ति के बावजूद भी सेल को ऊपर खींचने के लिए।

    मुझे नहीं पता कि आपकी छवि कैसा दिखती है, लेकिन इसे केवल क्षैतिज (" पृष्ठभूमि पुनरावृत्ति: दोहराए x ) और पृष्ठभूमि रंग के साथ बाकी को भरना? वह आम तौर पर मदद करता है


    How do I "advanced format" slider questions in a .txt file to import into Qualtrics? -


    I have read, but it does not mention the format of a slider question, or any of its "special questions" For the matter.

    Sliders are supported for advanced formatting? If so, what is the format for them in .txt file?

    Unfortunately, you can not. You can only import question types in those instructions from which you are connected Sometimes, you can choose the closest type you want, then change the question type to Qualtrics and it will keep the options imported by you. .


    java - Why can a method be declared to throw many exceptions even if none of them are thrown? -


    I was merging my source code with a colleague and I saw that he added an exception to the declaration Was a ritual; However, I knew that the exception would never really be thrown away by that method.

    I wonder why the compiler did not warn me about "unannounced exception declared" (or something like that). I realize that you can declare any method of throwing an exception, even if it is thrown out by code in any of those exceptions.

    Why is that so?

      throws the public zero Fu () IOException, introspection exception, best operation operation, ... {// nothing}  

    1. Overriding method can throw exceptions, even if it does not have a superclass.
    2. While retaining the rear compatibility, you can change the method later to throw one of the exceptions.

    Change integer to float column table Rails -


    Let me convert t.integer: mark_up to a float How can I do this? I used my terminal Railg Migration change_column (: stakes,: mark_up,: float) Unexpected token (

      RailMigration produces ChangeMarkUpToFloat  

    and the file that has been created: db / migrate / 2015xxxxxxxxxx / Change_mark_up_to_float.rb

    Edit it:

      class ChangeMarkUpToFloat & lt; ActiveRecord :: change migration change df change_column: bet, mark_up,: float end End  

    and then back to your terminal:

      rake db: migrate  

    asp.net mvc - Avoid donut caching when user is logged in as admin in Forms Authentication? -


    I would like to avoid caching if users are logged in with the form authentication in the administrator group.

    I have overridden the cache attribute and have applied it at the controller level, however, the method is not called through the NonAdmin validationcallback!

      public class output cache_nonAdam: donutOutputCatchErebrebreak {public override zero-on-operation expensing (Action Exposing Contact Filter Contex) {HttpContext.Current.Response.Cache.AddValidationCallback (NonAdmin, NULL); Base.OnActionExecuting (filterContext); } Private Zero Non Admins (HTTPTontax HTTuTTEX, Object Data, REFTPTITTUS httpValidationStatus) {// - Method Call Not Found! HttpValidationStatus = FormsAuthenticationService.IsLoggedIn ("Admin")? HttpValidationStatus.IgnoreThisRequest: HTTP validity Status.Valid; }}  

    How can I get non-caching when the user is logged in?


    How to stretch a block programmatically in AutoCAD with C#.NET -


    I am trying to write a method that takes a block in a drawing through block references and spreads it . So far, my method looks like this:

      Public static zero section BracketWithID (ObjectID PASADED ODOF ObjectToUpdate, Distance Newx Scale, Distance NewIscale, Distance News Escale) {Transaction Transaction = Database. Transaction Manager BlockReference (DocumentLock docLock = doc.LockDocument ()) using the start-up process ()) {BlockReference objectToStretch = transaction.GetObject (BlockedEdOfObjectToUpdate, OpenMode.ForWrite); Transaction.Commit (); }}  

    I get the object to stretch in the context of the block, but it does not appear to change the block anyway, so that it is wide and / or more (I use 2D Aeroplane). What is the best way to go about doing this?

    You can not "block" the block reference You need either 1 to change its size. Redefine the block (definition) or 2. Change the blockrifference scalefactors property. Changing scale fronts can not give you the results you are looking for. One way to see this is to make a block, put it in an AutoCAD drawing, and then play with the scale X, Y and Z in the property editor.


    java - inserting into access database apostrophe issue -


    I am trying to get some information in an Access database of a website. I am creating beans with information from the website and then I will send that bean to the database. The problem is that with some exceptions, some things have been blocked in the database. Exceptions -

      net.ucanaccess.jdbc.UcanaccessSQLException: unexpected token (tokens required):  

    So what Ive checked in common with the values That this exception is creating an apostrophe, every value which is calling an exception, there is an apostrophe in it, and I can not really change it yet. So I'm wondering how can I get that apostrophe in ucanaccess that can use without any exception?

    The query statement

      stmnt = conn.prepareStatement ( "insert probe Table1 (doctorName, details, specialty1, specialty2, personalSite, clinic1, phone1, clinic2, Phone2, Clinic3, phone3, worksWith) values ​​(?,?,?,?,?,?,?,?,?,?,?,?, ') ;? stmnt.setString (1, tempBean.getDoctorName ()); stmnt.setString (2 Tempbinkgetdeskripshn ()); Stmntksetstring (3 Tempbinkgetspeshlitil ()); Stmntksetstring (4 Tempbinkgetspeshliti2 ()); Stmntksetstring (5 Tempbinkgetpersonlsite ()); Stmnt .setString (6, tempBean.getClinic1 ()); stmnt.setString (7, tempBean.getPhone1 ()); stmnt.setString (8, tempBean.getClinic2 ()); stmnt.setString (9, tempBean.getPhone2 ()) ; Stmntksetstring (10, Tempbinkgetclinik3 ()); Stmntksetstring (11 Tempbinkgetfone3 ()); Stmntksetstring (12 Tempbinkgetvrksvith ()); Stmnt.aksekyuteupdate ();  

    Y ou are facing a common problem called SQL injection.

    The way to ensure this with Java that does not prepare ready access locations. Take a look at the second question for a good example.


    c - clock_gettime CLOCK_REALTIME unexpected result -


    I see how much time I'm trying to process a pipeline data, I have to take the results of the store < / P> clock_gettime (CLOCK_REALTIME, & amp; Start);

    When I add data items to my input buffer.

    Then I used that time when I calculated how long it took to take action on items too.

    It seems for the first few items to work properly, but then I get crazy results after that.

    I went to work out while using the function

      Double xelapsed (struct timespec one, struct timespec b) {return (a.tv_sec - b.tv_sec) * 1,000,000.0 + (a.tv_nsec - b.tv_nsec) / 1000.0; }  

    This is what I end:

      bash -4.1 $ ./pipe Latency: 1.447000 μs latency: 81.54 9000 Μs Latency: 104.253000 μs Latency: 112.497000 μs Latency: 121.307000 μs Latency: 128.99 3,000 μs Latency: 136.334000 μs Latency: 147.910000 μs Latency: 147.910000 μs Latency: 152.242000 μs Latency: 156.492000 μs Latency: 160.72 9 000 μs Latency: 164.7 9 3,000 μs latency: 168.782000 μs latency: 172.756000 μs latency: 176.720000 Μs latency: 175.370000 μs latency: 184.937000 μs latency: 183.424000 μs latency: 187.353000 μs Retention: 196.870000 μs Latency: 200.874000 μs Latency: 205.332000 μs Latency: 20 9.353000 μs Latency: 213.677000 μs Latency: 218.040000 μs Latency: 222.435000 μs Latency: 226.559000 μs Latency: 230.897000 μs Waiting Period: 235.170000 μs Waiting Period: 239.481000 μs Waiting Period: 243.829000 μs Waiting Period: 247.709000 μs Waiting Period: 251.974000 μs Waiting Period: 256.338000 μs Waiting Period: 260.363000 μs Waiting Period: 264.832000 μ Latency: 26,92,000 μs Latency: 273.171000 μs Latency: 277.525000 μs Latency: 281.701000 μs Latency: LET 285.674000 μs Ics: 290.187000 μs Latency: 294.239000 μs Latency: 298.504000 μs Latency: 302.604000 μs Latency: 307.095000 μs Latency: 315.343000 μs Latency: 318.812000 μs Latency: 327.149000 μs Latency: 331.065000 μs Latency: 335.114000 μs Latency: 33 9 632000 μs Latency: 342.989000 μs Latency: 344.433000 μs Latency: 348.567000 μs Latency: 352.376000 μs Latency: 356.801000 μs Latency: 360.752000 μs Latency: 364.337000 μs Waiting Period: 368.808000 μs Waiting Period: 372.082000 μs Waiting Period: 376.500000 μs Waiting Period: 380.283000 μs Waiting Period : 384.611000 μs Raticsha period: 388.134000 μs latency: 392.083000 μs latency: 396.484000 μs latency: 400.428000 μs latency: 1426625359409111.000000 μs latency: 1426625359409117.250000 μs latency: 1426625359409123.250000 μs latency: 1426625359409128.750000 μs latency: 1426625359409134.500000 μs latency: 1426625359409140.500000 μs wait duration: 1426625359409146.000000 μs latency: 1426625359409151.750000 μs latency: 1426625359409157.500000 μs latency: 1426625359409163.000000 μs latency: 1426625359409168.500000 μs Prtic Period: 1426625359409174.250000 μs Waiting Period: 1426625359409180.000000 μs Waiting Period: 1426625359409185.500000 μs Waiting Period: 1426625359409191.000000 μs Waiting Period: 1426625359409196.750000 μs Latency: 1426625359409202.250000 μs  


    javascript - How can I make 2 audio elements in succession, but make just 1 request for the audio? -


    I have a large audio file that I want to load once on a web page, but I have 2 audio in javascript Tag object:

      var audio tag 1 = new audio (); Var audio tag 2 = new audio (); Audio 1. Src = 'huge file MP3; Audio 1. Src = 'huge file MP3;  

    How do I make a request to a browser? I know the files are cached, but I suspect that the browser has to cache any of the 2 requests, because the feedback headers for the first request have not come at the time of issuing the second request. This means that the programmatic and cache control headers are not read by the browser.

    Is there a way to tell the browser, "Once request this data, and exclude 2 audio tags?" 2 instead of issuing the request?

    I think I can create an audio bob and then create an object url? Maybe it's too much over land for easy work?

      var audio tag 1 = new audio (); Var audio tag 2 = new audio (); AudioTag1.src = 'huge file MP3 ;; AudioTag1.addEventListener ("Load", function () {console.log ('Audio 1 Ready'); AudioTag 2.src = 'hugeFile.mp3'; audioTag2.load ();}); AudioTag2.addEventListener ("Load", function () {console.log ('Audio 2 Ready');}); AudioTag1.load ();  

    Not tested, but it is sure that on the second request, the browser will check the cache and the file will be fully loaded


    combinations - R: function that returns all the possible ordering of n elements? -


    In R, is there a function that gives all the possible order of n elements? I want an N! By N matrix, such that each row has all the possible orderly elements of n elements. That is, if n = 3, I want to:

      1,2,3 1,3,2, 2,1,3, 2,3,1, 3,1,2, 3,2,1  

    I first thought that the expansion would occur. The grid works, and tried:

      n & lt; - 3 wide .grid (representative (list (1: n), n)) Var1 Var2 Var3 1 1 1 1 2 2 1 1 3 3 1 1 4 1 2 1 5 2 2 1 6 3 2 1 7 1 3 1 8 2 3 1 9 3 3 1 10 1 1 2 11 2 1 2 12 3 1 2 13 1 2 2 14 2 2 15 3 2 2 16 1 3 2 17 2 3 2 18 3 3 2 1 9 1 1 3 20 2 1 3 21 3 1 3 22 1 2 3 23 2 2 3 24 3 2 3 25 1 3 3 26 2 3 3 27 3 3 3  

    But this gives 3 matrix by 3 ^ 3 That is, each row may have duplicate values. ..

    try

      library (gtools) permutations (n , 3) # [1,] 1 2 3 # [2,] 1 3 2 # [3,] 2 1 3 # [4,] 2 3 1 # [ 5,] 3 1 2 # [6,] 3 2 1  

    Is there a reason to write an IIFE invoked with a leading 'not'-operator (!) in JavaScript? -


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

    • 4 जवाब



    जावा में एक IIFE को लागू करने के दो (सामान्य) तरीके हैं I

    <प्री> // रास्ता 1 (फ़ंक्शन ()} {/ * मेरा आईआईएफई बॉडी * /}) () // रास्ता 2! फ़ंक्शन () {/ * मेरा आईआईएफई बॉडी * /} () < / कोड>

    मुझे यह जानना है कि क्या कोई अच्छा कारण है कि कोई दूसरा प्रयोग करेगा
    मैं केवल नहीं के दूसरे कारणों का कारण देखता हूं उदाहरण के लिए यदि आप अपने आईआईएफई को कुछ वापस करने के लिए चाहते हैं तो आप इसे इस तरह एक चर में निर्दिष्ट नहीं कर सकते:

      var x = (function () {return 5;}) (); // एक्स होगा 5 var y =! समारोह () {वापसी 5; } (); / Y सच हो जाएगा  

    क्योंकि यह बूलियन को डाली जाएगी जब भी मैं किसी ऑब्जेक्ट को वे-2-आईआईएफई से एक्सेस करना चाहता हूं तो मैं इस तरह से बंद होने का उपयोग करता हूं।

    आप देख सकते हैं कि दूसरे संस्करण के लिए भी कोई कार्यक्षमता बढ़ाने नहीं है।

    तो क्या विधि दो का उपयोग करने के लिए कोई अच्छे कारण हैं? यदि ऐसा है, तो क्या आप मुझे एक उदाहरण दे सकते हैं?

    लोग दूसरे दृष्टिकोण का उपयोग करते हैं क्योंकि यह एक बाइट बचाता है ( ! बनाम ( और ) )।


    Java Input - If Statement -


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

    • 23 उत्तर

    मैं प्रोग्रामिंग के लिए नया हूँ और मैंने जो कुछ कोड लिखे हैं, उसके लिए मदद की ज़रूरत है।

    यह है जो मैंने अभी तक किया है:

      import java.util.Scanner; सार्वजनिक वर्ग मुख्य {सार्वजनिक स्थैतिक शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {// टूडो ऑटो-जनरेटेड विधि स्टब स्कैनर स्कैन = नया स्कैनर (सिस्टम।); System.out.println ("प्रोग्राम शुरू हो रहा है, कृपया धैर्य रखें ..."); System.out.println ("क्या आप प्रोग्राम शुरू करना चाहते हैं? (Y / n):"); स्ट्रिंग इनपुट = Scan.nextLine (); अगर (इनपुट == "y") {System.out.println ("हैलो वर्ल्ड!"); } Else {System.out.println ("त्रुटि"); System.out.println (इनपुट + "मान्यता प्राप्त नहीं है!"); }}}  

    जब मैं इसे चलाता हूं, कोई त्रुटियां नहीं हैं, लेकिन जब मैं "y" टाइप करता हूँ तो यह "हैलो वर्ल्ड!" कहने के बजाय दूसरा भाग चलाता है जब मैं "y" में टाइप करता हूँ तो "नमस्कार दुनिया" कहां से मैं इसे ऐसा कर सकता हूं?

    ==

      के बजाय  स्ट्रिंग # बराबर  का उपयोग करें अगर (input.equals ("y")) {System.out.println ( "नमस्ते दुनिया!"); }  

    == संदर्भ की तुलना करता है जहां स्ट्रिंग # बराबर () स्ट्रिंग ऑब्जेक्ट में मान की तुलना करता है


    testing - Mark test as skipped during test execution -


    I have a test that depends on the persistence of fixture . It's almost his code:

      def test_optional_cool_feature (stability): If there is no stability. Supports_cool_feature (): Return cool_feature () == Expected_Security  

    here emphasizes fixtures is a parametric fixtures which are present in the en variants and it has been declared @py.test.fixture (scope = "session", parameters = ["type 1" ...]) DF efx (request): if request.param = "type1": Return Type1 () elif ...

    But it would also be nice to see it as a test in pySED output py.test When the output is left in Storm is against what does not support cool_feature Unfortunately, it can not be obtained with the @ py.test.mark.skipif (not the 'stability. Supports_cool_feature ()' ) Because stability still has a function at execution skipif , not the replacement test parameter.

    Answer to my own question because I remembered part of skip That's what I want to say:

    Skip mandatory from within a test or setup function

    If for some reason you can not declare leave conditions You can leave a result from within the examination or setup code. Example:

      def test_function (): if not valid_config (): pytest.skip ("unsupported configuration")  

    c# - Drag selection box in WPF -


    Is it possible to drag selection hover box hovering over selected object Mouse Overs and a circle by dragging and WPF. Do I especially want the users to hover over a button with a hover, then click this button as a specific action. Can you give a little sample code or a link?

    This is an advanced topic and its use contains more information here:

    and

    a small example where I use it:

    public class selector: Bender (public selection selector (Uaiilement Graceful Element): base (adorned had Element) {} protected override Rikorder (drawing depicting Citrkthaan) {Rikd Adnented Elementrekt = New Rikt (0,0, Wast Ikwarth actual height); // some arbitrary drawing tools. Solid Kolrbrs render brush = new Solid Caller brushes (colors. Green); RenderBrush.Opacity = 0.2; pen render pen = new Pen (New Solid Caller Brush (Colors. Latest) , 1.5); Double render Radius = 5.0; // Draw a circle on each corner DrawingContext.DrawEllipse (Renderbrs render pens, decorated Element Rikst. Lopft render radius render Radius); DrawingContext.DrawEllipse (Renderbrs, render Pens, decorated elements Iclait. Oprait render radius render Radius); DrawingContext.DrawEllipse (Renderbrs render pen, Radius decorated Elementrektkbotm left, render, render radius); DrawingContext.DrawEllipse (Renderbrs render pen, Radius decorated Elementrekt. Botmrait, render, render radius); }}

    java - Calling a method adding input -


    I'm having trouble finding out how to get output based on user input for my main category. I already have a keyboard entry, where users can enter a value, which will be organized. I'm guessing I'll need to use it, for example (input.input1 ()); . However, I need to include the method which calculates the result, such as calculations.theAverageMassFfTheVehicle from the CalculatingRocketFlightProfile class, I do not know how to combine both to get results.

    // Calculation class

      public class CalculatingRocketFlightProfile {// calculation class // declared the total number of public sector declaration; Public double average reward; Public double time assessment charger; Public double mass extract; Public double engine; Public double fuel economy; // Declare the variable to the output massively; double theAverageMassOfTheVehicle; Janata double the Wehlx post-horoscope; Public Calculating RCofProfile Profile (Double Total Impulse, Double Imperial Impulse, Double Time Execution Charger, Double Mass Actiale, Double Engagement, Double Fuel Mess) {// Constructor for this class. IIPUL = Total Impulse; This.averageImpulse = averageImpulse; This.timeEjectionChargeFires = Time EjectionChargeFires; This.massEmptyVehicle = massEmptyVehicle; This.engineMass = engineMass; This.fuelMass = fuelMass; } // Mutators and Accessors // Accessors // Methods for calculation - Calculate output, using inputs. Public Double The Evergence Mass of the World () {Return people Actual Vehicle + ((Engines + + (Engine-Fuel Mass)) / 2); // Formula to calculate the average mass. // Method Public Double ValuesMost () {// Formula / Total / Anticipation / Receipts for calculating the maximum velocity and generation of the wheel (); } // method / / return - get public double contentmovfifewheel () {returnAvulesModoffTheVehicle; } // Method Get Public DoubleWilliamsHistory () {VHXXMXMXXTVT; } // method} // class  

    // main category

      public class main {// master class public static zero main (string array [] ) // standard headers for main method {kbentry input = new kbentry (); System.out.print ("\ nPlease enter numbers for total impulse"); System.out.println ("You are logged in:" + input.input1 ()); System.out.print ("\ nPlease enter numbers for average impulse"); System.out.println ("You are logged in:" + input.input2 ()); System.out.print ("Please enter the number for time injection fee:"); System.out.println ("You are logged in:" + input.input3 ()); System.out.print ("Please enter the number for the vehicle's month:"); System.out.println ("You are logged in:" + input.input4 ()); System.out.print ("Please enter a number for the engine's person:"); System.out.println ("You have entered:" + input.input5 ()); System.out.print ("Please enter \ n for the fuel month"); System.out.println ("You are logged in:" + input.input6 ()); // Output calculation RocketFlightProfile calculation = New CalculatingRocketFlightProfile (); System.out.println ("\ nAverage mass of vehicle:" + Calculations. Everest of the Wheelick () + "\ nMaximum speed of vehicles: ++ Calculations .VavilxMost Festival Speed ​​());}}  

    // kbentry

      public class kbentry {double input1 () {BufferedReader = new BufferedReader (New InputStreamReader (System.in)); // Total Impulse entry string strTotalImpulse = null ; // This must be mandatory int intialImpulse = 0; //System.out.print("Please enter a number for the total impulse: "); string value from the //system.out.flush (); // keyboard Read {strTotalImpulse = in.readLine ();} Puck {IOException ioe} {// Ignore Exception} // Change it to Integer {intTotalImpulse = Integer.parseInt (strTotalImpulse);} Hold (Number Format Exposition Enough) {System.out.println ("Error! Please enter number!" + Nfe.toString ());}  

    The problem is that you have the CalcultingRocketFlightProfile class parameter Required, but you should store those inputs in the variable, then they will convert the variable to the constructor in its new CalCLinkRocketFlipProfile Confidence must that you declared.

    / html>

    netbeans - Why the keypress is not work correctly in java -


      निजी void textFieldNameKeyPressed (java.awt.event.KeyEvent evt) {// TODO यहां अपना हैंडलिंग कोड जोड़ें: यदि (! TextFieldName.getText ()। IsEmpty ()) बटन Finish.setEnabled (सत्य); Else बटन Finish.setEnabled (false); }  

    मैं बस buttonFinish को नियंत्रित कराना चाहता हूं, अगर यह textFieldName में पाठ है।

    हालांकि, जब मैं इसका परीक्षण करता हूं, तब हमेशा गलत होता है जब मैं एक इनपुट इनपुट करता हूं, सेट सक्षम किया जाता है नहीं बदलता।

    यदि इनपुट अधिक हो तो यह सही होगा। साथ ही जब मैं बैकस्पेस का उपयोग करता हूं, या जब सभी अक्षर साफ़ होते हैं तो यह setEnabled को झूठी वापस नहीं बदलेगा। केवल जब मैं बैकस्पेस पर एक बार फिर क्लिक करता हूं, तब यह बदल जाएगा। मैं क्या कर रहा हूं गलत?

    कुंजी रीलीज़ विधि का उपयोग करने की कोशिश करें

      निजी शून्य पाठफिल्डनामकेयरेलेटेड (java.awt.event.KeyEvent evt) {// TODO यहाँ अपने हैंडलिंग कोड जोड़ें:}  

    जब आप < कोड> कुंजी दबाया गया विधि, यह मान से पहले या उस मान को हटाने से पहले निष्पादित होता है कुंजी का उपयोग कर हटाया गया इसके बाद निष्पादित होगा।


    c# - Merging two list from different WCF ServiceClients which have the same object-type -


    I have an orbit library that has a class named "club" in which two WCF services are used by each one The same return type is a list of club-object: list & lt; Club & gt; .

    When I call both methods in a webform, then with two lists, these club objects, I can not merge those lists with the help of the concert because a list is viewed as a service list 1. She goes. List Club & gt; and another is seen as a serviceclatient 2. List and not just list & lt; Club & gt; .

      var resultService1 = service1Client.GetClubByName (search) .toList (); Var resultService2 = service2Client.GetClubByName (search) .toList (); Var endResult = resultService1.Concat (resultService2);  

    I have tried to change var with casting and specific object type, but with no results. How can I decide this because I want to show results in a grid from both services.

    Thanks in advance!

    A solution is to create a new anonymous type in which you have the necessary properties.

      var endResult = resultService1 Select (x = & gt; new {x.Prop1, x.Prop2}) .Concat (select resultService 2. Select (x => New {x.Prop1, x.Prop2}));  

    Google Analytics: is there any value in adding the URL to a Click Event Category, Action or Label? -


    There is slight disagreement in place of our work here. Our Metrics team has put the URL in Google Analytics event category , verb " or label . As far as I can tell, this is unnecessary because then in dl the query string parameter appears when I look at the click event on Devtool's network panel. Any value or reason for adding page url to event category, label or action?


    ios - VM:Allocation causes app to crash -


    मेरा ऐप NSTimer चर का उपयोग करता है जो NSNotificationCenter.postNotificationName का उपयोग करता है, प्रत्येक सेकंड में UIViewController वर्ग में सूचना पोस्ट करने के लिए।

    समस्या यह है कि ऐप एक समय में एक बार नहीं होता है जिसमें कोई स्टैकट्र्रेस नहीं होता है जिसका अर्थ यह स्मृति समस्या है।

    उपकरण से, ऐसा इसलिए होता है क्योंकि वीएम में 1.78 एमबी वृद्धि: आवंटन। यह आवंटन बेतरतीब ढंग से होता है।

    मैं टाइमर शुरू करने के बाद यहां सही है: यहां छवि विवरण दर्ज करें

    यह तब है जब मैं कुछ मिनटों के लिए टाइमर शुरू करता हूं तो,

    1. मुझे स्टैकट्र्रेस या कुछ भी नहीं दिखाई देता है मैं इसे डीबग करने के बारे में कैसे जाना है?

    2. ऐप केवल 7.3 एमबी का उपयोग करता है और अग्रभूमि में है, यह क्यों मारता है ?? : (

    3. मैं अभी टाइमर चल रहा हूं, केवल मौजूदा चर को अद्यतन करने वाला तरीका, जो इस वीएम को ट्रिगर करता है: आबंटन ???

    मैं स्विफ्ट का उपयोग करता हूं , यदि यह मामला

    धन्यवाद,

    समस्या को चालू करें < कोड> के लिए लूप। मेरे पास लूप के लिए एक बड़ा था जो कि बहुत सी असाइनमेंट करता है, एपीआई कॉल करता है, हर बार NSTimer फ़ंक्शन को कुछ समय के लिए कहा जाता है जब पुनरावृत्तियों की संख्या थोड़ा अधिक होती है तो वीएम आबंटन में किक होता है।

    मेरा मानना ​​है कि autoreleasepool {} के अंदर के लिए का उपयोग करना है > लूप। तब से कोई दुर्घटना नहीं हुई है। इन WWDC2013 वीडियो को देखकर विचारों की अवधि में थोड़ी मदद मिलती है लेकिन सीधे नहीं।