Daily Archives

Articles indexed Friday May 7 2010

Page 34/110 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Associative Array / Object can't be read in functions

    - by Matrym
    At the very beginning of the javascript file, I have: var lbp = {}; lbp.defaults = { minLength: 40 }; I can successfully alert it afterwards, with: alert(lbp.defaults.minLength); But as soon as I put it inside a function, when I alert, I get "Undefined". What gives, and how do I avoid this? Is it absolutely necessary to pass this variable into each function, for example, by doing: function(lbp) { alert(lbp.defaults.minLength); } I would have thought that defining it first, it would attain global scope and not be required to be passed in? Thanks in advance for enlightening me :) ==================================== EDIT: The problem seems like it might be my initialize function is itself defined within lbp. Is there any way to use this function var, and still use lbp vars inside it? lbp.initialize = function() { alert(lbp.defaults.minLength); }; The full bit of code looks like this: <script type="text/javascript"> var lbp = { defaults: { minLength: 40 } }; lbp.initialize = function() { alert(lbp.defaults.minLength); }; window.onload = lbp.initialize; </script>

    Read the article

  • Alternative to sql NOT IN?

    - by Alex
    Hi, I am trying to make a materialized view in Oracle (I am a newbie, btw). For some reason, it doesn't like the presence of sub-query in it. I've been trying to use LEFT OUTER JOIN instead, but it's returning different data set now. Put simply, here's the code I'm trying to modify: SELECT * FROM table1 ros, table2 bal, table3 flx WHERE flx.name = 'XXX' AND flx.value = bal.value AND NVL (ros.ret, 'D') = Nvl (flx.attr16, 'D') AND ros.value = bal.segment3 AND ros.type IN ( 'AL', 'AS', 'PL' ) AND bal.period = 13 AND bal.code NOT IN (SELECT bal1.code FROM table2 bal1 WHERE bal1.value = flx.value AND bal1.segment3 = ros.value AND bal1.flag = bal.flag AND bal1.period = 12 AND bal1.year = bal.year) And here's one of my attempt: SELECT * FROM table1 ros, table2 bal, table3 flx LEFT OUTER JOIN table2 bal1 ON bal.code = bal1.code WHERE bal1.code is null AND bal1.segment3 = ros.value AND bal.segment3 = ros.value AND bal1.flag = bal.flag AND bal1.year = bal.year AND flx.name = 'XXX' AND flx.value = bal.value AND bal1.value = flx.value AND bal1.period_num = 12 AND NVL (ros.type, 'D') = NVL (flx.attr16, 'D') AND ros.value = bal.segment3 AND ros.type IN ( 'AL', 'AS', 'PL' ) AND bal.period = 13; This drives me nuts! Thanks in advance for the help :)

    Read the article

  • Android Service - Ping URL

    - by Chris
    How can I use Android Service to do a ping callback? I need to open a webpage on a button click, but in the background, go ping another url for stats collection. Code snippets will be greatly helpful Thanks Chris

    Read the article

  • jQuery.ajax success callback function not executed

    - by Frank Michael Kraft
    I have a JavaScript Ajax call (jQuery.ajax), that does not execute the success callback function. $.ajax({ url: target, contentType: 'application/json; charset=utf-8', type: 'POST', // type: 'GET', dataType: 'jsonp', error: function (xhr, status) { alert(status); }, success: function (result) { alert("Callback done!"); // grid.dataBind(result.results); // grid.dataBind(result); } }); I see in firebug, that the request is posted and the correct result in terms of the json is returned as expected. What is wrong?

    Read the article

  • Multipart Identifier And Functions

    - by The King
    Here is my Query... Here I'm using a function Fn_getStagesForProject()... For which I need to pass the SWProjectID from Projects Table... The function takes the ID as parameter and return all stages that corressponds to the project, on which I need to filer only the row that contains StageLevel as 0. Select A.SWProjectID, A.ShortTitle, C.StageName as StageName, B.ExpectedCompletionDate as BudgetedReleaseDate From Projects as A left outer join ProjectBudgets as B on A.SWProjectID = B.SWProjectID Left outer join Fn_getStagesForProject(Projects.SWProjectID) as C on B.StageID = C.StageID Where C.StageLevel = 0 The error is The multi-part identifier "Projects.SWProjectID" could not be bound. I tried changing it to A.SWProjectID, but I still get the error... Thanks in advance for your help. Let me know, incase you need the Table Structure Raja

    Read the article

  • Confirm function in codebehind

    - by Geetha
    Hi All, I am using the following code to show confirmation dialog box after finishing some update process in database. but it is not working for me. code: protected void imbtnUpdate_Click(object sender, ImageClickEventArgs e) { // Database process string javaScript = "<script language=JavaScript>\n " + "if(confirm('Do you want to update the files?'))window.location.href = \"Upload.aspx?ID=" + ID + "&pt=Gm&page=Gms\"; else return false;\n" + "</script>"; RegisterStartupScript("imbtnUpdate_Click", javaScript); }

    Read the article

  • Howto format a date as localized Short MonthDay string

    - by Wouter
    I would like to format a DateTime to a string containing the month name abbreviated and the date for use in axislabels in a graph. The default DateTime format strings do not contain abbreviated month. I guess there is no standard but I could take a substring of the first 3 characters of the month name and replace this into the MonthDay format. The reason I would use MonthDay is that the ordering of month and date is locale dependent. Does anyone have a better idea? http://msdn.microsoft.com/en-us/library/az4se3k1.aspx#MonthDay

    Read the article

  • jquery tabs problem

    - by alexarsh
    I have a jquery tabs with jquery multiselect in my second tab. My problem is that the multiselect doesn't load the css and js if it's in second tab. If I put in in a first tab it works fine. What am I doing wrong?

    Read the article

  • InstallShield-2009: Basic MSI: How to run a custom action after user cancels uninstall (rollback)

    - by Samir
    InstallShield-2009 Premier: Basic msi project: What to do when I want a custom action to run when user clicks cancel button during uninstall? I put a custom action (a C# exe which would just show a message box) with Action Type: Type: Launch an executable Location: Stored in the Binary table Action Parameters: Source: exe path Target: a b c (doesn't matter, I don't need it) Additional Options: Return Processing: Synchronous (Check exit code) Run Only During Path Uninstall: unchecked Respond Options: In-Script Execution: Rollback Execution in System Context Executing Scheduling: disabled Insert into Sequence: Install UI-Sequence: <Absent from sequence> Install Execute Sequence: After InstallServices (what should I set here?) Install Execute Condition: (do I need to set? I left it blank) but it didn't fire the message box when I canceled the uninstall. How?

    Read the article

  • ASP.NET ReportViewer Control Fonts to Century Gothic

    - by sajoshi
    We are using ASP.NET ReportViewer Control to render rdl files. In the rdl files we have set the font to “Century Gothic” and in preview mode it renders the fonts nicely. However – when it gets rendered on browser we see the fonts defaulted to “Times New Roman”. I tried couple of things without success: 1. Setting the font family of the page () 2. Setting the FontNames of the ReportViewer control Please let me know how we can render the fonts to Century Gothic. One more thing is I don't see Century Gothic in the list of available fonts in the HTML Editor inside Visual Studio 2010. Do I need to add them somewhere?

    Read the article

  • Create Django formset wihtout multiple queries

    - by Martin
    I need to display multiple forms (up to 10) of a model on a page. This is the code I use for to accomplish this. TheFormSet = formset_factory(SomeForm, extra=10) ... formset = TheFormSet(prefix='party') return render_to_response('template.html', { 'formset' : formset, }) The problem is, that it seems to me that Django queries the database for each of the forms in the formset, even though the data displayed in them is the same. Is this the way Formsets work or am I doing something wrong? Is there a way around it inside django or would I have to use JavaScript for a workaround?

    Read the article

  • [.NET] Line break in ListView work in Vista/7 but not in XP

    - by karol
    hi, I've got problem. I'm using ListView to show some data and I need to make two lines in one row. I've found solution to make row higher by adding ImageList with specified height and then I add Environment.NewLine to my text. It works in Vista and 7 but in XP instead of new line there are shown squares. I've been trying to add "\n" "\r\n" and ASCII char 10 but ther were still squares! After few days I still don't know what's wrong and I need your help.

    Read the article

  • How can a JSON object refer to values in itself?

    - by Erin Drummond
    Hi, Lets say I have the following javascript: var obj = { key1 : "it ", key2 : key1 + " works!" }; alert(obj.key2); This errors with "key1 is not defined". I have tried this.key1 this[key1] obj.key1 obj[key1] this["key1"] obj["key1"] and they never seem to be defined. How can I get key2 to refer to key1's value?

    Read the article

  • Glassfish 3: How do I get and use a developers build so I can navigate a stack trace including Glas

    - by Thorbjørn Ravn Andersen
    I am migrating a JSF 1.1 application to JEE 6 Web profile, and doing it in steps. I am in the process of moving from JSP with JSF 1.1 to Facelets under JSF 1.2 using the jsf-facelets.jar for JSF 1.2, and received an "interesting" stack trace when trying to lookup a key in a Map using a "{Bean.foo.map.key}" where the stacktrace complained about "key" not being a valid integer. (After code introspection I am workarounding it using a number as the key). That bug is not what this question is about. In such a situation it is essential to be able to navigate the source of every line in the stack trace. In Eclipse I normally attach a source jar to every jar on the build path, but in this particular case the Glassfish server adapter creates a library automatically containing the jars. Also there is to my knowledge no debug build of Glassfish where sources are included in the bundle. Glassfish is a non-trivial Maven project, and a bit picky too. I am not very familiar with maven, but have managed to checkout the code from Subversion and build it for the 3.0 tag according to http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions#section-V3FullBuildInstructions-CheckoutTheWorkspace - it appears to be the code corresponding to the official released 3.0 version. After finishing the "mvn -U install" part, I have then tried to create Eclipse projects by first using "mvn -DdownloadSources=true eclipse:eclipse" and then import them in Eclipse JEE 3.5.2 and specifying the M2_REPO variable but many of the projects still have compilation errors, and I cannot locate any instructions from Oracle about how to do this. I'd appreciate some help in just getting a functional IDE workspace reflecting the 3.0 version of Glassfish. I have Eclipse 3.5.2, Netbeans 6.8 and 6.9 beta, and IntelliJ IDEA 9, and Linux/Windows/OS X do do it on.

    Read the article

  • popup with dynamic menuitems, each menuitem is another popup

    - by encryptor
    I am building an extension that has a pop up whose elements are constructed by a function call everytime the mouse hovers over the popup option. I am able to achieve this. Now I need to have a popup for each of the menu item (inside the original popup) which is not dynamic though. I have this code, but it does not work: for (var m=0; m < localpubliclist.length; m++) { var newItem = document.createElement("menu"); newItem.setAttribute("label", publicdisplayname[m]); newItem.setAttribute("id", "public" + m); myMenuPopup.appendChild(newItem); var newpopup = document.createElement("menupopup"); newpopup.setAttribute("id","publicpop" + m); newItem.appendChild(newpopup); var new1= document.createElement("menuitem"); new1.setAttribute("label", "Home"); new1.setAttribute("id", "publichome" + m); newpopup.appendChild(new1); } doing this forms the first popup where i can see all my menu with names publicdisplayname[m]. each of these is to be a popup which displays "Home". This does not work. the second popup (popup on publicdisplayname[m]) does not open. i have been stuck on this for quite some time and have tried various things cut it doesnt work. Can we do this at all? can we have double dynamic popups?

    Read the article

  • How to implement thread timeout in J2ME?

    - by lilo
    I am using Connector in J2ME and found that sometimes it take a very long time to send a request, and sometime it may halt the whole process. So I try to put code related to Connector in a thread and try to set timeout to the thread. But I found out that it's very difficult to do this in J2ME because there's no join(long) in J2ME. Is there any way to do this? Or any better way to deal with network connection in J2ME? Thanks a lot in advance.

    Read the article

  • How to make flash file not downloadable?

    - by Nitz
    Hey friends, I want that my flash file on my website, can't be downloaded by anyone. Is there any way that i can do that? As Firefox and many browser has many add-ones which easily detect out flash content and after they can download the flash file?

    Read the article

  • Remove leading whitespaces using variable length lookbehind in RegExp

    - by Shizhidi
    Hello, I'm wondering if variable length lookbehind assertions are supported in JavaScript's RegExp engine? For example, I'm trying to match the string "variable length" in the string "[a lot of whitespaces and/or tabs]variable length lookbehind", and I have something like this but it does not go well in various RegExp testers: ^(?<=[ \t]+).+(?= lookbehind) If it's an illegal pattern, what would be a good workaround to it? Thanks!

    Read the article

  • SQL Server becomes slow after restart

    - by Tobi DM
    I already posted this one on stackoverflow but someone gave me the hint to that I might have more luck on serverfault. We use SQL Server 2005 on an Windwos Server 2008. Ther Server has 48 GB RAM. SQL Server is configured to use 40 GB RAM. There is only one database hosted (About 70 GB). The only app beside SQL Server is our App-Server which connects the clients to the database. Now we encounter the following problem: After a restart of the server our the performance is great. The server grabs the 40 GB RAM wich it is allowed to and then runs fast as hell. But after about 4 weeks the system becomes slower and slower. The execution of statements (seen in the profiler) is raising slowly. But I cannot see that there is something going wrong on the server. CPU usage is at about 20% I/O also seems to be no Problem The process monitor does also not show that there are strange apps or something like that. Eventlog does also have no interessting messages No open transactions or blockings to see We do not use cursors in our app We tried already the following things without effect: Droped the cache by using the statements DBCC FreeProcCache DBCC FREESYSTEMCACHE('ALL') DBCC DropCleanbuffers Restarted the Appserver we are using. Restart the sql server service But nothing did help exept restarting the whole server. Any ideas?

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >