Daily Archives

Articles indexed Monday April 19 2010

Page 13/113 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • jquery on localhost

    - by ace
    I am using Linuxmint (= ubuntu linux 9.10) I installed LAmp server which have apache,php mysql and now i am trying to write jquery code i made a file and it worked perfectly with this link : file:///var/www/jquery/jquery.html but when i use this link, then it doesnt work anymore : http://localhost/jquery/jquery.html the file jquery.min.js is in the same folder and i already changed the src of it in source code to <script type="text/javascript" src="/var/www/jquery/jquery.min.js"></script> <script type="text/javascript" src="jquery.min.js"></script> but none of them works (with localhost link) using firebug I saw these errors: The requested URL /var/www/jquery/jquery.min.js was not found on this server. You don't have permission to access /jquery/jquery.min.js on this server. Apache/2.2.12 (Ubuntu) Server at localhost Port 80 so what do I have to do to make it run?

    Read the article

  • Criteria query returns hydrated object in SQLite but not SqlServer

    - by Berryl
    I have a method that returns a resource fully hydrated when the db is SQLite but when the identical code is used by SqlServer the object is not fully hydrated. I'll explain that with the code after some brief background. I my domain various otherwise unrelated things like an Employee or a Machine can be used as a Resource that can be allocated to. In the object model an example of this would be: /// <summary>Wraps a <see cref="StaffMember"/> in a <see cref="ResourceBase"/>. </summary> public class StaffMemberResource : ResourceBase { public virtual StaffMember StaffMember { get; private set; } public StaffMemberResource(StaffMember staffMember) { Check.RequireNotNull<StaffMember>(staffMember); base.BusinessId = staffMember.Number.ToString(); base.Name = staffMember.Name.ToString(); base.OrganizationName = staffMember.Department.Name; StaffMember = staffMember; } [UsedImplicitly] protected StaffMemberResource() { } } And in the db tables, there is a table per class inheritance where the ResourceBase has a discriminator and the id of the actual resource (ie, StaffMember) StaffMember - 1 ---- M- ResourceBase - 1 ----- M - Allocation The Code public override StaffMemberResource BuildResource(IActivityService activityService) { var sessionFactory = _GetSessionFactory(); var session = sessionFactory.GetCurrentSession(); StaffMemberResource result; using (var tx = session.BeginTransaction()) { var propertyName = ExprHelper.GetPropertyName<StaffMember>(x => x.Number); var staff = session.CreateCriteria<StaffMember>() .Add(Restrictions.Eq(propertyName, new EmployeeNumber(_testData.Resource_1.BusinessId))) .UniqueResult<StaffMember>(); if (staff == null) { ... build up a staff member result = new StaffMemberResource(staff); } else { ////////// var property = ExprHelper.GetPropertyName<StaffMemberResource>(x => x.StaffMember); result = session.CreateCriteria<StaffMemberResource>() .Add(Restrictions.Eq(property, staff)) .UniqueResult<StaffMemberResource>(); } /////////// tx.Commit(); } return result; } It's that second criteria query that works "properly" with SQLite but not with SqlServer. By properly I mean that the employee numer is translated into a ResourceBase.BusinessId, Name is flattened out into a ResourceBase.Name, etc. Does anyone know why this might be? Cheers, Berryl

    Read the article

  • Javascript debugging: stopping/breaking at every javascript invocation

    - by portoalet
    I am dealing with a complex legacy javascript code base, and it's difficult to figure out where to put breakpoint (I have to find the files, put a breakpoint in firebug etc). Is there a way so that Firebug breaks on the first javascript execution that it encounters every time? In other words, every time I click on something on the page, and if a javascript code is executed, I want Firebug to break on that line? Of course I don't want Firebug to stop when it executes it's internal javascript. Is this possible?

    Read the article

  • Regular expression to match non-negative integers in PHP?

    - by kavoir.com
    I seem to get it to work with the following regexp by preg_match(): @^(?:[1-9][0-9]*)|0$@ Yet it's weird that it matches '-0', considering there are no '-' allowed at all in the regexp. Why? What's more weird is that if you switch the parts divided by |: @^0|(?:[1-9][0-9]*)$@ It matches all negative integers such as '-2' and '-10', etc. What am I missing here? Any better regexp for non-negative integer?

    Read the article

  • where to get this Java.exe file for ORacle installation

    - by vas
    Hi just installed oracle 11g and tried to start the "Oracle SQL developer" so as to start writing queries. Its asking me Enter the full pathname for the java.exe file . Where do i find this. I did a global search for java.exe and am sure did not got some oracle related pdf files. Also my Oracle is installed out of users/vas

    Read the article

  • resizing row's height in QTreeWidget/QTreeView

    - by serge
    Hi everyone, I have some problems with sizing row's height in QTreeWidget. I use QStyledItemDelegate with QPlainTextEdit. During editing text in QPlainTextEdit i check for changes with a help of: rect = self.blockBoundingRect(self.firstVisibleBlock()) and if text's height changes i resize editor size and need row in QTreeWidget also resizing. But i don't know how to inform TreeWidget or a Delegate about changes. I tried to initialize editor with index, that i could use in a future, but Delegate creates new editor every time and i failed to use signals. Also I used following function to catch resize event, but it' doesn't: bool QAbstractItemDelegate::editorEvent ( QEvent * event, QAbstractItemModel * model, const QStyleOptionViewItem & option, const QModelIndex & index ) How can i bound editor's size changes with TreeWidget? And one more thing, by default all items (cells) in TreeWidget have -1 or some big value as default width. I need whole text in cell to be visible, so how can i limit cells width only by visible range and make it expand in height? I want for it the same behavior as in instance a table in MSWord. Thank you in advance, Serge

    Read the article

  • Bulgogi to Beignets

    - by Randy Walker
    While it’s still a full month away, I’m getting super excited about my upcoming trips. May and June are chock full of events, two of which I’ll have full announcements for within the week.  In mid May I’ll be driving to Dallas to take my 2nd trip to Korea (the bulgogi part).  Seeing a bunch of old friends from my first trip as well as taking a week for some deeper personal things. While in my absence, June 1st-4th, I’ve setup a tour across Arkansas and Texas for two Microsoft employees who work on the Visual Studio & Visual Basic team to talk at various user groups and companies.  Look for my announcement within the next couple of days. As soon as I get back from Korea, I’m off to New Orleans!  It’s been years since I’ve been there (pre-Katrina), and I have a hankering for some Beignets and Cafe Ole from Cafe Du Monde.  The big news?  I’m hosting a PARTY on Bourbon Street!  The party will be very exclusive, featuring a crawfish and shrimp boil, various Cajun dishes, and an open bar.  Huge thanks to Infragistics for putting up the initial sponsor money.  See you guys at Microsoft’s TechEd 2010!

    Read the article

  • IP Helper service uses 50-60% CPU every 1 minute for 3-4 seconds on Windows 7

    - by Sarveshwar
    I have checked everything - all the processes in the process explorer. IP Helper service is causing CPU usage of over 50 % every 1 minute for 3-4 seconds then comes back to normal. In the task manager, the process is svchost.exe and the service is iphlpsvc. Here's the result of "ipconfig /all" command: ![alt text][1] [1]: From Snapshots Here's a screenshot of "netsh interface teredo show state" command: ![alt text][1] [1]: From Snapshots Please help me resolve this. Also utorrent is not showing the teredo address.

    Read the article

  • Javascript Problem

    - by Tareq
    I am trying to show a script in a div tag. But in the div tag the script does not run. Here is my Code: <div id="div0" align="right"> <script type="text/javascript"> <!-- alert("Hi"); --> </script> </div> It does not work for me. Please anybody tell me, what is the problem?

    Read the article

  • Rails on Google App Engine - Error on OS X development machine

    - by Phillip Parker
    Hi, I'm running through the Ruby on Rails tutorial at http://guides.rubyonrails.org/getting_started.html (adjusting where appropriate for Google's App Engine). All is well up till section 6.3: when I try to click "New Post", I get the following error: Internal Server Error (500) Request Method: GET Request URL: http://localhost:8080/500.html access denied (java.io.FilePermission /dev/urandom read) It works fine when I upload the application to Google's App Engine; it's just on my development machine (OS X 10.6) that it doesn't work. Thanks in advance.

    Read the article

  • Hooking a synchronous event handler on a form submit button in JS

    - by Xzhsh
    Hi, I'm working on a security project in javascript (something I honestly have not used), and I'm having some trouble with EventListeners. My code looks something like this: function prevclick(evt) { evt.preventDefault(); document.loginform.submitbtn.removeEventListener('click',prevclick,false); var req = new XMLHttpRequest(); req.open("GET","testlog.php?submission=complete",false); req.send(); document.loginform.submitbtn.click(); //tried this and loginform.submit() } document.loginform.submitbtn.addEventListener('click',prevclick,false); But the problem is, the submit button doesn't submit the form on the first click (it does, however, send the http request on the first click), and on the second click of the submit button, it works as normal. I think there is a problem with the synchronization, but I do need to have the request processed before forwarding the user to the next page. Any ideas on this would be great. Thanks in advance.

    Read the article

  • Image Conversion from Bitmap to Icon doesn't seem to work

    - by contactmatt
    I have a simple function that takes a bitmap, and converts the bitmap to an ICON format. Below is the function. (I placed literal values in place of the variables) Bitmap tempBmp = new Bitmap(@"C:\temp\mypicture.jpeg"); Bitmap bmp = new Bitmap(tempBmp, 16, 16); bmp.Save("@C:\temp\mypicture2.ico", ImageFormat.Icon) It doesn't seem to be converting correctly...or so I think. After the image is converted, some browsers do not reconigze the image as a true "ICON" , and even Visual Studio 2008 doesn't reconigze the image as an icon after its converted to an Icon format. For example, I was going to set the Icon property for my Win32 form app with the Icon i just converted. I open the dialouge box and select the icon I just converted and get the following error. -- "Argument 'picture' must be a picture that can be used as a Icon." I've browsed the web and come across complicated code where people take the time to manually convert the bitmap to different formats, but I would think the above code should work, and that the .NET framework would take care of this conversion.

    Read the article

  • Android NDK Question

    - by Kyle
    The NDK does not contain very many shared libraries for you to access. As a result, I must build many sources myself and link them into my shared library via static/shared libraries. I want to compile libpng as a Static Library. Trouble is, I have absolutely no idea how, nor does google instruct you how to do so in their NDK. I'm no expert on the NDK even after reading everything I can find, so I would really appreciate someone who actually knows how this is done. I do have the Android.mk file for libpng, as google's Android OS source contains it. Infact, I got the entire directory on the android OS source for libpng and it's dependent libraries. It was somewhat of a shortcut instead of making one myself. I don't know how to make a particular directory which contains this file, though. Thanks for reading!

    Read the article

  • Adding element to existing XML node

    - by Sathish
    Where am i going wrong??? I have an xml file with OppDetails as a tag already as shown below <OppDetails> <OMID>245414</OMID> <ClientName>Best Buy</ClientName> <OppName>International Rate Card</OppName> <CTALinkType>AO,IO,MC,TC</CTALinkType> </OppDetails> </OppFact> Now i am trying to add another element to it but getting an error in AppendChild method please help XmlNode rootNode = xmlDoc.SelectSingleNode("OppDetails"); XmlElement xmlEle = xmlDoc.CreateElement("CTAStartDate"); xmlEle.InnerText = ExcelUtility.GetCTAStartDate(); rootNode.AppendChild(xmlEle); xmlDoc.Save("C:\\test.xml");

    Read the article

  • jQuery-ui tabs: interference between tabs

    - by powerboy
    I use the jQuery-ui tabs widget as a navigation. Contents of all tabs are load via ajax. Seems that there is interference between tabs. I mean, for example, if in page1 in tab1, there is an element whose ID is foo, and in page2 in tab2, there is an element with the same ID. And in both page, there is javascript code to manipulate the element with ID foo, then weird things will happen. How to deal with this situation?

    Read the article

  • Rails - using :include to find objects based on their child's attributes

    - by adam
    I have a sentence and correction model class Sentence < ActiveRecord::Base has_one :correction class Correction < ActiveRecord::Base belongs_to :sentence and I'm trying find all sentences which don't have a correction. To do this I'm simply looking for corrections which don't exist i.e. whose id = nil. But it is failing and i can't figure out why Sentence.find :all, :include => :correction, :conditions => {:correction => {:id => nil}} Perhaps its the syntax or maybe just the overall approach. Can anyone help?

    Read the article

  • Call for Abstracts Now Open for Microsoft ASP.NET Connections (Closing April 26)

    - by plitwin
    We are putting out a call for abstracts to present at the Fall 2010 Microsoft ASP.NET Connections conference in Las Vegas, Nov 9-13 2009. The due date for submissions is April 26, 2010. For submitting sessions, please use this URL: http://www.deeptraining.com/devconnections/abstracts Please keep the abstracts under 200 words each and in one paragraph. No bulleted items and line breaks, and please use a spell-checker. Do not email abstracts, you need to use the web-based tool to submit them. Please submit at least 3 abstracts, but it would help your chances of being selected if you submitted 5 or more abstracts. Also, you are encouraged to suggest all-day pre or post conference workshops as well. We need to finalize the conference content and the tracks layout in just a few short weeks, so we need your abstracts by April 26th. No exceptions will be granted on late submissions! Topics of interest include (but are not limited to):* ASP.NET Webforms* ASP.NET AJAX* ASP.NET MVC* Dynamic Data* Anything else related to ASP.NET For Fall 2010, we are having a seperate Silverlight conference where you can submit abstracts for Silverlight and Windows 7 Phone Development. In fact, you can use the same URL to submit sessions to Microsoft ASP.NET Connections, Silverlight Connections, Visual Studio Connections, or SQL Server Connections. The URL again is:http://www.deeptraining.com/devconnections/abstracts Please realize that while we want a lot of the new and the cool, it's also okay to propose sessions on the more mundane "real world" stuff as it pertains to ASP.NET. What you will get if selected:* $500 per regular conference talk.* Compensation for full-day workshops ranges from $500 for 1-20 attendees to $2500 for 200+ attendees.* Coach airfare and hotel stay paid by the conference.* Free admission to all of the co-located conferences* Speaker party* The adoration of attendees* etc. Your continued suport of Microsoft ASP.NET Connections and the other DevConnections conferences is appreciated. Good luck and thank you,Paul LitwinMicrosoft ASP.NET Conference Chair

    Read the article

  • How to insert <br/> after each 5 results?

    - by Axel
    This is my code: $query = mysql_query("SELECT * FROM books ORDER BY id") or die(mysql_error()); while($row = mysql_fetch_assoc($query)) { echo $row["bookname"]." - "; } How to make only 5 books displayed in each line, by inserting a at the start if the row is 5 or 10 or 15 etc... Thanks

    Read the article

  • php parse without replacing

    - by David
    i have seen some parsing code, thats really long, but it doesn't involve replacing stuff inside an opened file using file_get_contents() for example. im talking about say parsing a .doc into .html format, they read the file then output it in html. i have tried this using arrays and preg_replace but it just doesn't seem as clean as other code. anyone know the basic concept of parsing? thanks, tell me if im not clear

    Read the article

  • Using PInvoke vs .NET provided functions

    - by Jonathan Shepherd
    From version to version of .NET the more function that's equal to P/Invoke is added to .NET Now there are 2 questions in my mine. 1) Which one is prefer other the other in term of speed, normally I use .Net function but in tight loop I don't really know which one is going to be faster. 2) Is there any website that provide the list of counter-parts?

    Read the article

  • IXmlSerializable Dictionary problem

    - by Shimmy
    I was trying to create a generic Dictionary that implements IXmlSerializable. Here is my trial: Sub Main() Dim z As New SerializableDictionary(Of String, String) z.Add("asdf", "asd") Console.WriteLine(z.Serialize) End Sub Result: <?xml version="1.0" encoding="utf-16"?><Entry key="asdf" value="asd" /> I placed a breakpoint on top of the WriteXml method and I see that when it stops, the writer contains no data at all, and IMHO it should contain the root element and the xml declaration. <Serializable()> _ Public Class SerializableDictionary(Of TKey, TValue) : Inherits Dictionary(Of TKey, TValue) : Implements IXmlSerializable Private Const EntryString As String = "Entry" Private Const KeyString As String = "key" Private Const ValueString As String = "value" Private Shared ReadOnly AttributableTypes As Type() = New Type() {GetType(Boolean), GetType(Byte), GetType(Char), GetType(DateTime), GetType(Decimal), GetType(Double), GetType([Enum]), GetType(Guid), GetType(Int16), GetType(Int32), GetType(Int64), GetType(SByte), GetType(Single), GetType(String), GetType(TimeSpan), GetType(UInt16), GetType(UInt32), GetType(UInt64)} Private Shared ReadOnly GetIsAttributable As Predicate(Of Type) = Function(t) AttributableTypes.Contains(t) Private Shared ReadOnly IsKeyAttributable As Boolean = GetIsAttributable(GetType(TKey)) Private Shared ReadOnly IsValueAttributable As Boolean = GetIsAttributable(GetType(TValue)) Private Shared ReadOnly GetElementName As Func(Of Boolean, String) = Function(isKey) If(isKey, KeyString, ValueString) Public Function GetSchema() As System.Xml.Schema.XmlSchema Implements System.Xml.Serialization.IXmlSerializable.GetSchema Return Nothing End Function Public Sub WriteXml(ByVal writer As XmlWriter) Implements IXmlSerializable.WriteXml For Each entry In Me writer.WriteStartElement(EntryString) WriteData(IsKeyAttributable, writer, True, entry.Key) WriteData(IsValueAttributable, writer, False, entry.Value) writer.WriteEndElement() Next End Sub Private Sub WriteData(Of T)(ByVal attributable As Boolean, ByVal writer As XmlWriter, ByVal isKey As Boolean, ByVal value As T) Dim name = GetElementName(isKey) If attributable Then writer.WriteAttributeString(name, value.ToString) Else Dim serializer As New XmlSerializer(GetType(T)) writer.WriteStartElement(name) serializer.Serialize(writer, value) writer.WriteEndElement() End If End Sub Public Sub ReadXml(ByVal reader As XmlReader) Implements IXmlSerializable.ReadXml Dim empty = reader.IsEmptyElement reader.Read() If empty Then Exit Sub Clear() While reader.NodeType <> XmlNodeType.EndElement While reader.NodeType = XmlNodeType.Whitespace reader.Read() Dim key = ReadData(Of TKey)(IsKeyAttributable, reader, True) Dim value = ReadData(Of TValue)(IsValueAttributable, reader, False) Add(key, value) If Not IsKeyAttributable AndAlso Not IsValueAttributable Then reader.ReadEndElement() Else reader.Read() While reader.NodeType = XmlNodeType.Whitespace reader.Read() End While End While reader.ReadEndElement() End While End Sub Private Function ReadData(Of T)(ByVal attributable As Boolean, ByVal reader As XmlReader, ByVal isKey As Boolean) As T Dim name = GetElementName(isKey) Dim type = GetType(T) If attributable Then Return Convert.ChangeType(reader.GetAttribute(name), type) Else Dim serializer As New XmlSerializer(type) While reader.Name <> name reader.Read() End While reader.ReadStartElement(name) Dim value = serializer.Deserialize(reader) reader.ReadEndElement() Return value End If End Function Public Shared Function Serialize(ByVal dictionary As SerializableDictionary(Of TKey, TValue)) As String Dim sb As New StringBuilder(1024) Dim sw As New StringWriter(sb) Dim xs As New XmlSerializer(GetType(SerializableDictionary(Of TKey, TValue))) xs.Serialize(sw, dictionary) sw.Dispose() Return sb.ToString End Function Public Shared Function Deserialize(ByVal xml As String) As SerializableDictionary(Of TKey, TValue) Dim xs As New XmlSerializer(GetType(SerializableDictionary(Of TKey, TValue))) Dim xr As New XmlTextReader(xml, XmlNodeType.Document, Nothing) Return xs.Deserialize(xr) xr.Close() End Function Public Function Serialize() As String Dim sb As New StringBuilder Dim xw = XmlWriter.Create(sb) WriteXml(xw) xw.Close() Return sb.ToString End Function Public Sub Parse(ByVal xml As String) Dim xr As New XmlTextReader(xml, XmlNodeType.Document, Nothing) ReadXml(xr) xr.Close() End Sub End Class

    Read the article

  • strstr whole string match

    - by clay
    I'm trying to match the whole string and not just part of it. For instance, if the needle is 2, I would like to match just the string 2 and not 20, 02, or 22 or anything related. I'm using strstr as: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { FILE *file; char l[BUFSIZ]; int linenumber = 1; char term[6] = "2"; file = fopen(argv[1], "r"); if(file != NULL) { while(fgets(l, sizeof(l), file)){ if(strstr(l, term) != NULL) { printf("Search Term Found at %d!\n", linenumber); } ++linenumber; } } else { perror(argv[1]); } fclose(file); return 0; }

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >