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 ",