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.