In an iPhone app, when I compile for simulator everything is OK. However, when I compile for device, I get error on lines where I declare uint8 variables.
How is that possible?
I'm using JQuery to make an Ajax call. I used a sniffer to catch the response text:
{"error_code":0,"message":"SUCCESS","data":{"session_token":"3efd9dde-a839-4e91-9415-4c2f6cba5b7b"}}
But the response returned on the success callback is null. Anyone got any ideas? (see jquery code below.
Jquery code:
$.ajax({
type: "GET",
url: "http://184.72.58.99/matchaapi/API/User/Login",
data: { email: emailval, password: pwordval, developer_key: devkey },
dataType: "json",
cache: false,
beforeSend: function(xhr) {
xhr.setRequestHeader( "Content-Type", "application/json; charset=utf-8" );
},
success: function(resp) {
alert(resp);
$("#status p").html(resp.message);
}});
This is weird. I have a class that inherits from IEnumrable whose Count property is reporting 0 (zero) elements but the For Each loop steps into the loop body and tries to use the variable where it should just be moving on. My code:
On Error Resume Next
Dim d As Foo
For Each d In fooCollection
' use d and throws an exception
Next d
Weirder still, every time d is accessed i get an exception thrown in the output window:
A first chance exception of type
'System.NullReferenceException'
but i'm not stopping on the exception (not in a try/catch block).
Is "On Error Resume Next" causing this weirdness?
Weirdness found:
Per Rowland's and JohnH's comments i checked the Foo class:
The GetEnumerator method inside of Foo didn't actually return anything! It had an empty body. That coupled with the On Error Resume Next before the loop caused the havoc! Wow this was ugly. Thanks for the clues guys!
I have to call Javascript funtion based on the bean value. i use the following code
onmouseover="#{occasionBean.user.userPreference.defaultPreview==true?'':'Tip()'})"
I need to send some parameters in Tip() like this
Tip('')
Error i am getting is javax.servlet.jsp.JspException: javax.faces.el.EvaluationException: com.sun.faces.el.impl.parser.ParseException: Encountered "test" at line 1, column 60.
Was expecting one of:
"}" ...
"." ...
"" ...
"gt" ...
"<" ...
"lt" ...
"==" ...
"eq" ...
"<=" ...
"le" ...
"=" ...
"ge" ...
"!=" ...
"ne" ...
"[" ...
"+" ...
"-" ...
"*" ...
"/" ...
"div" ...
"%" ...
"mod" ...
"and" ...
"&&" ...
"or" ...
"||" ...
"?" ...
'
Is there a way that a javascript function can read the javascript source code in an html page, so that the function can do some checking job on the javascript source code?
I want to be able to provide a URL to a music track, and when that track is played on an iPhone, to show the cover art.
I've tried embedding the cover art as an ID3 v2.3 tag, and while desktop players like VLC and Windows Media Player can see it, it seems the iPhone doesn't.
Is this possible? Does anyone know of a way to achieve this - preferably a method which can be automated?
Edit: this may not be possible - even if I add cover art with iTunes, the resulting file will still not have the coverart displayed when played as a download :(
I have a html page with 10 columns but I don't have show all in same page instead I have to show only 4 column moreover I have to render those column on a button click call add column.
What is the best approach to render 1-4 column first ? Fist column render first and on clicking button say add will render 2nd column , than 3rd and fourth. Now when i will load 5th column ...I will have to hide 1st column so that i will accommodate 4 columns but data inside that column will stay ....my limit is to show 4 column at a time and hiding leftmost ....
any helpful javascript or jquery advice will be appreciated ..thanks!
I feel like this should be fairly obvious, or easy, but I just can't get it. What I want to do is apply a function to a list (using map) but only if a condition is held. Imagine you only wanted to divide the numbers which were even:
map (`div` 2) (even) [1,2,3,4]
And that would give out [1,1,3,2] since only the even numbers would have the function applied to them. Obviously this doesn't work, but is there a way to make this work without having to write a seperate function that you can give to map? Filter is almost there, except I also want to keep the elements which the condition doesn't hold for, and just not apply the function to them.
Thanks
We're about to embark on some ASP.NET MVC development and have been using our own entity framework for years. However we need to support more than our entity framework is capable of and so I'd like to get some opinions about using MVC with a more robust framework. We have narrowed down or choices to either NHibernate (with the Fluent APIs) or LINQ to SQL.
Which framework lends itself best to MVC style development (I know SO uses LINQ to SQL)?
If we want to support SQL Server, Oracle, MySQL - does that exclude LINQ to SQL?
Hey guys, I'm new to template editting. I'm trying to remove a table from the Amazon's WebStore template so i can start designing my own.
Anyone out there know how I can go about hiding/disabling/removing/bypassing it?
Apologies if this is a stupid question - I'm an Android and Ant newbie.
I have utf8 encoded source files that I need to compile with the Android Ant build system. By default, the encoding is set to ascii. I'd be very grateful for a pointer to whatever I need to do to let the build system know that my files are utf8.
Incidentally, it works fine if I build in Eclipse, but I need to build from the command line.
Thanks!
Hi, is it possible to access the InfoMessage event handler in a Linq2SQL data context? All of our code uses these messages to display useful information to the end user and since moving to Linq2SQL I cannot figure out how to show these messages. I have checked the connection object of the data context as well as the classes properties with no luck so I'm wondering if it is possible.
Thanks in advance.
When putting a favicon on your site, you can apparently use an animated gif, just by changing the gif file’s extension to .ico.
http://www.k-director.com/blog/how-to-add-an-animated-faviconico/
Have you encountered any problems doing this? Have you seen a browser get confused by a gif file with a .ico extension?
Problem:
I want to do this operation
select name from pragma table_info(my_awesome_table)
However, it yields a syntax error. I have the sneaking suspicion this is possible, but it doesn't seem to be documented as usable in the SELECT docs with sqlite.
I have added a long info screen to my iPhone app. The info is a long UIImageView, and it is contained inside a UIScrollView. They are both defined in .xib file.
At run-time, initially I set scrollview's position outside window, and when user clicks a button, set its position inside window. This part is OK. But scrollview displays the image but does not scroll. Isn't it enough to place in MainViewContoller.xib, set the contained content, and (at code) set its contentSize equal to the content's size?
BTW: I try it at simulator currently.
This is the code I use to display images.
<t:dataList var="item" value="#{occasionBean.messageInfo}" layout="simple">
<h:commandLink action="#{occasionBean.selectedImage}" >
<h:graphicImage styleClass="thumbnail" width="100" height="100"
url="#{item.imageSnapUrl}"
onclick="return setMsgId(this.id,#{item.img_id},'#{item.imageUrl}');"
id="test" onmouseover="" onmouseout="">
</h:graphicImage>
</h:commandLink>
</t:dataList>
Please give some solution.
I am building a framework where people will be able to save items that the created by inheriting a class of mine. I will be iterating over every type in the appdomain to find classes that I want to map to nhibernate. Every class that I find will be a subclass of the inherited type.
I know how to create sub types in FluentNhibernate, but every sub type requires its own ClassMap class. Since I won't know these untill runtime, there is no way I can do that.
Is there a way that I can add mappings to fluent nhibernate?
Note, I know this is possible without fluent nhibernate using the Cfg class, but I don't want to manage the same code two different ways.
I have a simple Windows Form that hosts property controls at runtime. To keep the window and its contents alive rather than killing it by handling the FormClosing event, cancel the event and simply hide the form.
That's fine but at close of the application I need to actually close the window. I implemented the below but it feels kludgey. Is there a simpler, more clever way to handle this situation? (The form's controller calls KillForm explicitly after it receives a closing event from the main window.)
Friend Class HostForm
Private _hideInsteadOfClosing As Boolean = True
Private Sub HostForm_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) _
Handles Me.FormClosing
If _hideInsteadOfClosing Then
Me.Hide()
e.Cancel = True
End If
End Sub
Public Sub KillForm()
_hideInsteadOfClosing = False
Me.Close()
End Sub
End Class
I have the following drop down list which is using the Ajax Toolkit to provide a combo box
<cc1:ComboBox ID="txtDrug" runat="server" style="font-size:8pt; width:267px;"
Font-Size="8pt" DropDownStyle="DropDownList"
AutoCompleteMode="SuggestAppend" AutoPostBack="True"
ontextchanged="txtDrug_TextChanged" />
Now I need to load this up with approx 7,000 records which takes a considerable time, and effects the response times when the page is posted back and forth.
The code which loads these records is as follows;
dtDrugs = wsHelper.spGetAllDrugs();
txtDrug.DataValueField = "pkDrugsID";
txtDrug.DataTextField = "drugName";
txtDrug.DataSource = dtDrugs;
txtDrug.DataBind();
However if I could get an event to fire when a letter is typed instead of having to load 7000 records it is reduced to less than 50 in most instances.
I think this can be done in Javascript. So the question is how can I get an event to fire such that when the form starts there is nothing in the drop down, but as soon as a key is pressed it searches for those records starting with that letter.
The .Net side of things I'm sure about - it is the Javascript I'm not.
Thanks in advance
UPDATE:
My model going into the save method is PartialViewModel, which in the save method, is pushed into the index's ContactViewModel and sent back. This wasn't clear.
I am playing around with MVC3, and have a contact controller with a SaveDetails action. The index cshtml has a partial with a form whose action is pointing to this controller.
When I submit the form not having completed it fully, thereby firing the validation, the url now contains the SaveDetails action name (http://localhost:7401/Contact/SaveDetails).
The form code is:
@using (Html.BeginForm("SaveDetails", "Contact")) {
...
}
The controller action looks like this:
public ActionResult SaveDetails(Models.PartialsViewModel pvm)
{
return View("Index", new ContactViewModel{ PartialsViewModel = pvm } );
}
What am I doing wrong?
I need to get out of a bad situation at my current work - I like the work, but they've been jerking me around with contract extensions coming at the last minute. I've been offered a job at a different company that doesn't look as interesting, but it's a chance to learn a few technologies I was interested in learning. It's "6 months contract to permanent" - does that mean that if I decide it's hopelessly boring and quit after the 6 month contract period that it won't reflect too badly on me and ruin my reputation in the town? What if I quit earlier than that?
Edit I should mention that I don't think there will be one right answer, so rather than accepting one answer, I'm going to vote up the good ones.
I'm looking for a way with no side effects.
Ideally, the following code would do the trick:
long currentCount = 0;
::ReleaseSemaphore(h, 0, ¤tCount);
But unfortunately 0 is not allowed as the value of lReleaseCount, so the call returns FALSE.
I'm using the following for $headers:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $from . "\r\n";
$headers .= "CC: [email protected]\r\n";
My html looks fine in Gmail, however, it appears as raw html in outlook.
Did I forget something in the header?