Search Results

Search found 8083 results on 324 pages for 'total newbie'.

Page 42/324 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Populate a column as a result of performing math on two columns in a jqGrid.

    - by HacksawOnRye
    Background: Our company selected a workflow tool that has some "interersting" UI restrictions. jqGrid has been identified as one of best ways to overcome these restrictions. Consequently, the answers to this question need to be restricted to functionlity available within the jqGrid space. It pains me to pose this question and I know you will tempted to go down a million other paths - most that we have already traveled before. :( Question: Can jqGrid populate a column as a result of performing math on two other columns. The source of those two columns is in our control so we can "guarantee" that numeric data will be returned. Also, the result is something that we simplay want to display on demand but not store yet. On the example below, is there a function that allow the 'total' column to be populated from the following calculation: 'amount' * 'tax' Example jqGrid javascript: jQuery("#list3").jqGrid({ url:'server.php?q=2', datatype: "json", colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id',index:'id', width:60, sorttype:"int"}, {name:'invdate',index:'invdate', width:90, sorttype:"date"}, {name:'name',index:'name', width:100}, {name:'amount',index:'amount', width:80, align:"right",sorttype:"float"}, {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"}, {name:'total',index:'total', width:80,align:"right",sorttype:"float"}, {name:'note',index:'note', width:150, sortable:false} ], rowNum:20, rowList:[10,20,30], pager: '#pager3', sortname: 'id', viewrecords: true, sortorder: "desc", loadonce: true, caption: "Load Once Example" });

    Read the article

  • Can I change the binding source to another source in XAML?

    - by No hay Problema
    Hi guys, I want to do a very simple thing, can you point me on the right direction? I want to change the source in XAML to another object source, let me put you an example: I have a Listview, bound to a "Model A", it has many properties, but one is called "Total". This property is not shown on the View Each ListviewItem has its own source (ItemsSource), BUT, one of the fields should show "Total" from "Model A" Caveat: I am implementing MVVM, so the "Model A" is assigned as a VM DataSource, XAML knows nothing about it. So, in my perfect world the XAML should look like this: <GridViewColumn Header="Total" Width="150"> <GridViewColumn.CellTemplate> <DataTemplate> <Label Content="{Binding Source=<The source of LISTVIEW> Path=Total}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> I have tried RelativeSource but that points me to the XAML object, I want the source of it, is it possible? Thanks

    Read the article

  • how to use shared variable using stored procedure in crystal reports

    - by sonia
    i have a parent report and it contains a two sub report. * subreport: item which get all fields from store procedure named spGetReportItem. like ItemName ItemQuantity TotalItemCost ab 4 45 dd 6 98 *subreport: Labour which get all fields from store procedure named spGetReportLabour. like labourName labourQuantity TotalLabourCost ab 44 455 dd 63 986 i want to find the total of totalitemcost and total of totallabourcost and then want grandtotal of totalitemcost and totallabourcost. i have seen many examples on internet in which shared variable is used in the formula bt the problem is that they have used the table but i m fetching data from stored procedure. so how can i access the stored procedure fields for calculation. like i have seen that many have used: shared numbervar total:=sum({tablename.ColumnName}); but i have used stored procedure instead of table so how could i find total of field that resultset returns from stored procedure.. plz give me answer as soon as possible.. i need it urgently. thanks..

    Read the article

  • PHP/Javascript limiting amount of checkboxes

    - by Carl294
    Hi everyone Im trying to limit the amount of checkboxes that can be checked, in this case only 3 can be checked. When using plain HTML this works fine. The code can be seen below. HTML example <td ><input type=checkbox name=ckb value=2 onclick='chkcontrol()';></td><td>Perl</td> Javascript Function <script type="text/javascript"> function chkcontrol(j) { var total=0; for(var i=0; i < document.form1.ckb.length; i++){ if(document.form1.ckb[i].checked){ total =total +1;} if(total > 3){ alert("Please Select only three") document.form1.ckb[j].checked = false; return false; } } } </script> The problem appears when replacing the fixed HTML values with values from a MYSQL database. All the information appears correctly, and can be posted to another page via a submit button. However, it seems like the 'value' assigned to each record from the database is not making its way too the javascript function. <td><input name="checkbox[]" type="checkbox" value="<?php echo $rows['TCA_QID'];?>" onclick="chkcontrol();"></td> I have tried changed the name in the javascript function to match the 'checkbox' name.Any advice would be greatly appreciated Thanks

    Read the article

  • Help with MySQL query... Need help ordering a group of rows

    - by user156814
    I can tell it best by explaining the query I have, and what I need. I need to be able to get a group of items from the database, grouped by category, manufacturer, and year made. The groupings need to be sorted based on total amount of items within the group. This part is done with the query below. Secondly, I need to be able to show an image of the most expensive item out of the group, which is why I use MAX(items.current_price). I thought MAX() gets the ENTIRE row corresponding to the largest column value. I was wrong, as MAX only gets the numeric value of the largest price. So the query doesnt work well for that. SELECT items.id, items.year, items.manufacturer, COUNT(items.id) AS total, MAX(items.current_price) AS price, items.gallery_url, FROM ebay AS items WHERE items.primary_category_id = 213 AND items.year <> '' AND items.manufacturer <> '' AND items.bad_item <> 1 GROUP BY items.primary_category_id, items.manufacturer, items.year ORDER BY total DESC, price ASC LIMIT 10 if that doesnt explain it well, the results should be something like this id 10548 year 1989 manufacturer bowman total 451 price 8500.00 (The price of the most expensive item in the table/ not the price of item 10548) gallery_url http://ebay.xxxxx (The image of item 10548) A little help please. Thanks

    Read the article

  • In Python, how to make sure database connection will always close before leaving a code block?

    - by Cawas
    I want to prevent database connection being open as much as possible, because this code will run on an intensive used server and people here already told me database connections should always be closed as soon as possible. def do_something_that_needs_database (): dbConnection = MySQLdb.connect(host=args['database_host'], user=args['database_user'], passwd=args['database_pass'], db=args['database_tabl'], cursorclass=MySQLdb.cursors.DictCursor) dbCursor = dbConnection.cursor() dbCursor.execute('SELECT COUNT(*) total FROM table') row = dbCursor.fetchone() if row['total'] == 0: print 'error: table have no records' dbCursor.execute('UPDATE table SET field="%s"', whatever_value) return None print 'table is ok' dbCursor.execute('UPDATE table SET field="%s"', another_value) # a lot more of workflow done here dbConnection.close() # even more stuff would come below I believe that leaves a database connection open when there is no row on the table, tho I'm still really not sure how it works. Anyway, maybe that is bad design in the sense that I could open and close a DB connection after each small block of execute. And sure, I could just add a close right before the return in that case... But how could I always properly close the DB without having to worry if I have that return, or a raise, or continue, or whatever in the middle? I'm thinking in something like a code block, similar to using try, like in the following suggestion, which obviously doesn't work: def do_something_that_needs_database (): dbConnection = MySQLdb.connect(host=args['database_host'], user=args['database_user'], passwd=args['database_pass'], db=args['database_tabl'], cursorclass=MySQLdb.cursors.DictCursor) try: dbCursor = dbConnection.cursor() dbCursor.execute('SELECT COUNT(*) total FROM table') row = dbCursor.fetchone() if row['total'] == 0: print 'error: table have no records' dbCursor.execute('UPDATE table SET field="%s"', whatever_value) return None print 'table is ok' dbCursor.execute('UPDATE table SET field="%s"', another_value) # again, that same lot of line codes done here except ExitingCodeBlock: closeDb(dbConnection) # still, that "even more stuff" from before would come below I don't think there is anything similar to ExitingCodeBlock for an exception, tho I know there is the try else, but I hope Python already have a similar feature... Or maybe someone can suggest me a paradigm move and tell me this is awful and highly advise me to never do that. Maybe this is just something to not worry about and let MySQLdb handle it, or is it?

    Read the article

  • Which of the following Java coding fragments is better?

    - by Simon
    This isn't meant to be subjective, I am looking for reasons based on resource utilisation, compiler performance, GC performance etc. rather than elegance. Oh, and the position of brackets doesn't count, so no stylistic comments please. Take the following loop; Integer total = new Integer(0); Integer i; for (String str : string_list) { i = Integer.parse(str); total += i; } versus... Integer total = 0; for (String str : string_list) { Integer i = Integer.parse(str); total += i; } In the first one i is function scoped whereas in the second it is scoped in the loop. I have always thought (believed) that the first one would be more efficient because it just references an existing variable already allocated on the stack, whereas the second one would be pushing and popping i each iteration of the loop. There are quite a lot of other cases where I tend to scope variables more broadly than perhaps necessary so I thought I would ask here to clear up a gap in my knowledge. Also notice that assignment of the variable on initialisation either involving the new operator or not. Do any of these sorts of semi-stylistic semi-optimisations make any difference at all?

    Read the article

  • Creating a Variable From Two Others

    - by John
    Hello, In the HTML table below, I would like to add a third column that equals $row["countSubmissions"] times 10 plus $row["countComments"]. How could I do this? Thanks in advance, John $sqlStr = "SELECT l.loginid, l.username, COALESCE(s.total, 0) AS countSubmissions, COALESCE(c.total, 0) AS countComments FROM login l LEFT JOIN ( SELECT loginid, COUNT(1) AS total FROM submission GROUP BY loginid ) s ON l.loginid = s.loginid LEFT JOIN ( SELECT loginid, COUNT(1) AS total FROM comment GROUP BY loginid ) c ON l.loginid = c.loginid GROUP BY l.loginid ORDER BY countSubmissions DESC LIMIT 10"; $result = mysql_query($sqlStr); $arr = array(); echo "<table class=\"samplesrec1edit\">"; while ($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td class="sitename1edit1"><a href="http://www...com/.../members/index.php?profile='.$row["username"].'">'.stripslashes($row["username"]).'</a></td>'; echo '<td class="sitename1edit2">'.stripslashes($row["countSubmissions"]).'</td>'; echo '<td class="sitename1edit2">'.stripslashes($row["countComments"]).'</td>'; echo '</tr>'; } echo "</table>";

    Read the article

  • lock statement not working when there is a loop inside it?

    - by Ngu Soon Hui
    See this code: public class multiply { public Thread myThread; public int Counter { get; private set; } public string name { get; private set; } public void RunConsolePrint() { lock(this) { RunLockCode("lock"); } } private void RunLockCode(string lockCode) { Console.WriteLine("Now thread "+lockCode+" " + name + " has started"); for (int i = 1; i <= Counter; i++) { Console.WriteLine(lockCode+" "+name + ": count has reached " + i + ": total count is " + Counter); } Console.WriteLine("Thread " + lockCode + " " + name + " has finished"); } public multiply(string pname, int pCounter) { name = pname; Counter = pCounter; myThread = new Thread(new ThreadStart(RunConsolePrint)); } } And this is the test run code: static void Main(string[] args) { int counter = 50; multiply m2 = new multiply("Second", counter); multiply m1 = new multiply("First", counter); m1.myThread.Start(); m2.myThread.Start(); Console.ReadLine(); } I would expect that m2 must execute from start to finish before m1 starts executing, or vice versa, because of the lock statement. But the result I found was the call to lock first and lock second was intermingled together, i.e., something like this Now thread lock First has started Now thread lock Second has started lock First: Count has reached 1: total count is 50 lock First: Count has reached 2: total count is 50 lock Second: Count has reached 1: total count is 50 What did I do wrong?

    Read the article

  • Data Formatters temporarily unavailable

    - by iphone newbie
    I'm currently working on an iPhone app. This app has a login screen, also a signup screen. After the user has successfully signed up, I dismiss the signup view, then the app automatically logs in using the created account. After which, the login view is dismissed, showing the main view. I'm trying to modify this by immediately dismissing the login view, since I already have the account details of the user when the signup is successful. Basically, the ideal flow is: after the user successfully signs up, I save the username and password in a singleton class, then dismiss the signup view. When I get to the parent view (which is the login screen), I have a variable that checks if there was a successful signup. If that variable is true, I want to immediately dismiss the login view. However, I come across this error message: Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib") I'm not really sure why this happens. I have no problems dismissing the login view when I go through the actual login procedure - which of course also dismisses the login view if the user inputs a correct username and password. I'm not exactly sure, but I'm starting to think that the iPhone cannot handle dismissing 2 view controllers almost at the same time. Is it possible that I'm dismissing the login view too quickly? Is that a factor? Is there anyway for me to be able to dismiss 2 view controllers almost simultaneously without coming across this error message?

    Read the article

  • Spring Security 3 - j_spring_security_check is not found

    - by newbie
    I use Spring Security with Spring Framework 3 and when I tyr to login from homepage I get following error: 2010-04-26 12:16:39,525 [tomcat-http--2] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/AppName/app/j_spring_security_check] in DispatcherServlet with name 'Spring MVC Dispatcher Servlet' Spring Security is initialized as loggings tell and there are no errors. So what could be reason for this error? I have understood that j_spring_security_check is default url for Spring Security login chekeing servlet.

    Read the article

  • Spring Framework 3 and session attributes

    - by newbie
    I have form object that I set to request in GET request handler in my Spring controller. First time user enters to page, a new form object should be made and set to request. If user sends form, then form object is populated from request and now form object has all user givern attributes. Then form is validated and if validation is ok, then form is saved to database. If form is not validated, I want to save form object to session and then redirect to GET request handling page. When request is redirected to GET handler, then it should check if session contains form object. I have figured out that there is @SessionAttributes("form") annotation in Spring, but for some reason following doesnt work, because at first time, session attribute form is null and it gives error: org.springframework.web.HttpSessionRequiredException: Session attribute 'form' required - not found in session Here is my controller: @RequestMapping(value="form", method=RequestMethod.GET) public ModelAndView viewForm(@ModelAttribute("form") Form form) { ModelAndView mav = new ModelAndView("form"); if(form == null) form = new Form(); mav.addObject("form", form); return mav; } @RequestMapping(value="form", method=RequestMethod.POST) @Transactional(readOnly = true) public ModelAndView saveForm(@ModelAttribute("form") Form form) { FormUtils.populate(form, request); if(form.validate()) { formDao.save(); } else { return viewForm(form); } return null; }

    Read the article

  • iPhone SDK UIScrollView doesn't get touch events after moving it

    - by newbie
    Hi! I'm subclassing UIScrollView and on the start I fill this ShowsScrollView with some items. After filling it, I setup frame and contentSize to this ShowsScrollView. Everything works fine for now, i get touches events, scrolling is working.. But after rotation to landscape, I change x and y coordinates of ShowsScrollView frame, to move it from bottom to top right corner. Then I resize it (change width and height of ShowsScrollView frame) and reorder items in this scroll. At the end I setup new contentSize. Now i get touches event only on first 1/4 of scrollview, scrolling also work only on 1/4 of scrollview, but scroll all items in scrollview. After all actions I write a log: NSLog(@"ViewController: setLandscape finished: size: %f, %f content: %f,%f",scrollView.frame.size.width,scrollView.frame.size.height, scrollView.contentSize.width, scrollView.contentSize.height ); Values are correct: ViewController: setLandscape finished: size: 390.000000, 723.000000 content: 390.000000,950.000000 On rotating back to portrait, I move and resize all thing back and everything works fine.. Please help!

    Read the article

  • Extract words from sentence(s) using TSQL(SQL SERVER 2005) [ SET BASED SOLUTION]

    - by Newbie
    I have the following input. INPUT: TableA ID Sentences --- ---------- 1 I am a student 2 Have a nice time guys! What I need to do is to extract the words from the sentence(s) and insert each individual word in another table OUTPUT: SentenceID WordOccurance Word ---------- ------------ ----- 1 1 I 1 2 am 1 3 a 1 4 student 2 1 Have 2 2 a 2 3 nice 2 4 time 2 5 guys! I am using SQL SERVER 2005. I am looking for a set based solution. Thanks

    Read the article

  • Entrepreneur Needs Programmers, Architects, or Engineers?

    - by brand-newbie
    Hi guys (Ladies included). I posted on a related site, but THIS is the place to be. I want to build a specialized website. I am an entrepreneur and refining valuations now for venture capitalsists: i.e., determining how much cash I will need. I need help in understanding what human resources I need (i.e., Software Programmers, Architects, Engineers, etc.)??? Trust me, I have read most--if not all--of the threads here on the subject, and I can tell you I am no closer to the answer than ever. Here's my technology problem: The website will include (2) main components: a search engine (web crawler)...and a very large database. The search engine will not be a competitor to google, obviously; however, it "will" require bots to scour the web. The website will be, basically, a statistical database....where users should be able to pull up any statistic from "numerous" fields. Like any entrepreneur with a web-based vision, I'm "hoping" to get 100+ million registered users eventually. However, practically, we will start as small as feasible. As regards the technology (database architecture, servers, etc.), I do want quality, quality, quality. My priorities are speed, and the capaility to be scalable...so that if I "did" get globally large, we could do it without having to re-engineer anything. In other words, I want the back-end and the "infrastructure" to be scalable and professional....with emphasis on quality. I am not an IT professional. Although I've built several Joomla-based websites, I'm just a rookie who's only used minor javascript coding to modify a few plug-ins and components. The business I'm trying to create requires specialization and experts. I want to define the problem and let a capable team create the final product, and I will stay totally hands off. So who do you guys suggest I hire to run this thing? A software engineer? I was thinking I would need a "database engineer," a "systems security engineer", and maybe 2 or 3 "programmers" for the search engine. Also a web designer...and maybe a part-time graphic designer...everyone working under a single software engineer. What do you guys think? Who should I hire?...I REALLY need help from some people in the industry (YOU guys) on this. Is this project do-able in 6 months? If so, how many people will I need? Who exactly needs to head up this thing?...Senior software engineer, an embedded engineer, a CC++ engineer, a java engineer, a database engineer? And do I build this thing is Ruby or Java?

    Read the article

  • addthis api? Is it possible to bookmark another URL?

    - by Newbie
    Hello! At the moment, I try to include addthis social-bookmarks to my site. My problem is, that I have to bookmark another link than the url on my site. Instead of www.example.com, I have to bookmark www.example.com?media=my-media-file. From the beginning: A User comes to my site. On my site are several movies. He can click on a movie thumbnail and watch the movie without reloading the site (javascript). Now he can click on my social bookmark icon to share this movie. Now the addthis framework thinks that the User want's to share www.example.com (cause this is whats in my url). But I want the user to share www.example.com?media=foo-bar . Opening www.example.com?media=foo-bar for the correct movie is still working, but no social bookmaring. I hope you understand my problem and can help me. I searched without success in the addthis api. So, can u help me?

    Read the article

  • Hello World bootloader not working!

    - by Newbie
    Hello. I've been working through the tutorials on this webpage which progressively creates a bootloader that displays Hello World. The 2nd tutorial (where we attempt to get an "A" to be output) works perfectly, and yet the 1st tutorial doesn't work for me at all! (The BIOS completely ignores the floppy disk and boots straight into Windows). This is less of an issue, although any explanations would be appreciated. The real problem is that I can't get the 3rd tutorial to work. Instead on outputting "Hello World", I get an unusual character (and blinking cursor) in the bottom-left corner of the screen. It looks a bit like a smiley face inside a rounded rectangle. Does anyone know how to get Hello World to display as it should?

    Read the article

  • Problem in calling Excel function

    - by Newbie
    I am facing a problem while making Excel's LinEST function. My program goes like MyExcel.Application xl = new MyExcel.Application(); MyExcel.WorksheetFunction wsf = xl.WorksheetFunction; List<int> x = new List<int> { 1, 2, 3, 4 }; List<int> y = new List<int> { 11, 12, 45, 42 }; object o = wsf.LinEst(x, y, true, true); And the namespace is using MyExcel = Microsoft.Office.Interop.Excel; The program is compiling smoothly but at runtime it is throwing an error {System.Runtime.InteropServices.COMException (0x80020005): Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) Actually this is the first time I am using Excel function .. so I am unable to proceed further. If any one has run thru this kind of situation and has solved, please help me. I am using C# 3.0 Thanks

    Read the article

  • Problem in populating a dictionary using Enumerable.Range()

    - by Newbie
    If I do for (int i = 0; i < appSettings.Count; i++) { string key = appSettings.Keys[i]; euFileDictionary.Add(key, appSettings[i]); } It is working fine. When I am trying the same thing using Enumerable.Range(0, appSettings.Count).Select(i => { string Key = appSettings.Keys[i]; string Value = appSettings[i]; euFileDictionary.Add(Key, Value); }).ToDictionary<string,string>(); I am getting a compile time error The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea? Using C#3.0 Thanks

    Read the article

  • jqtransform form selector (onchange) problem !!!!

    - by Newbie
    I'm styling a form with Jqtransform script. The form includes a selector which enlist some cities, when i click a one, it should update the selector below it with some locations within that city. here is the code of the selector <select name="city" id="city" class="wide" onchange="populateDestrict(this)"> It was working fine with default style , but after applying JQ, it lost it's functionality I asked a question before here LINK and i did as Dormilich did by writing: $(function() { $("form.jqtransform").jqTransform(); $("#city").change(populateDestrict(this)); }); But it didn't work ! here is also the code of the function if it helps <script language="javascript"> function populateDestrict(obj){ var city=obj.value; if(city!=""){ $.post('city_state.php',{ city: city},function(xml){ $("#state").removeOption(/./); $("district",xml).each(function() { $("#state").addOption($("key",this).text(), $("value",this).text()); }); }); } } </script> Any help people ???????? Thanks

    Read the article

  • jqtransform form events problem

    - by Newbie
    I'm a web designer with css experience, but I'm not a JS developer. I used jqtransform to style a search form , the problem is it removes all events from selectors and the search button . here is the code before jqtransform <input id="go-search" type="button" name="btn_search" value="search" onclick="searchLocations()" /> and after applying the script, the button doesn't do any thing I opened the page source and here how it looks like: <button class=" jqTransformButton" type="button" name="btn_search" id="go-search"><span><span>search</span></span></button> Please help me !

    Read the article

  • How can I convert OTF/TTF files to EOT format?

    - by newbie
    I need to use @font-face feature and my fonts are in OTF/TTF format and Microsoft browsers support only EOT format. I tried to use Microsoft tool WEFT, but it didn't work or I didn't understand how it works. Is there any other way to convert my fonts to EOT format?

    Read the article

  • Implementing a "special" Access database to Expression Web

    - by Newbie
    I have just got an answer to my question about combining the result of a SQL. This was done with "ConcatRelated". Now I want to implement this in Expression Web 3. The SQL's I used in Access: SELECT land.id, land.official_name, vaksiner.vaksiner FROM land INNER JOIN (vaksiner INNER JOIN land_sykdom ON vaksiner.id = land_sykdom.sykdom) ON land.kort = land_sykdom.land ORDER BY land.official_name; and SELECT DISTINCT id, official_name, ConcatRelated("vaksiner","qryVaksinerRaw","id = " & [id]) AS vaksiner FROM qryVaksinerRaw; The last is saved as vaksine_query This is the SQL that I want to add to Expression Web: SELECT vaksine_query.id, vaksine_query.official_name, vaksine_query.vaksiner FROM vaksine_query WHERE vaksine_query.id="?"; Expression Web gives me the error message "Undefined function 'ContactRelated' in expression.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >