Search Results

Search found 287 results on 12 pages for 'alvin sim'.

Page 5/12 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to change aif to be able to access 'it' within the macrocall without making 'it' public in the package

    - by Sim
    If you put the aif code presented in onlisp in a package and try to use it in another you run in the problem that packagename:it is not external. (in-package :packagename) (defmacro aif (test-form then-form &optional else-form) ‘(let ((it ,test-form)) (if it ,then-form ,else-form))) wanted call syntax (in-package :otherpackage) (aif (do-stuff) (FORMAT t "~a~%" it) (FORMAT t "just got nil~%")) How can I fix this behavior in code, without making the variable it external in the package declaration and beeing able to access it just by it instead of packagename:it?

    Read the article

  • Selectively turning off Devise's flash notices in Rails 3

    - by Sim
    The Devise authentication framework uses flash notices everywhere. This makes it easy to integrate with apps but it leads to poor user experience sometimes. I am wondering what's an easy way to selectively turn off some of the Devise flash notices in my Rails 3 app. In particular, I'd like to get rid of the blatantly obvious signed_in and signed_out flashes. Some searching suggested subclassing the session controller or use something like this but I haven't been able to find any simple solutions to this problem.

    Read the article

  • A Surface view and a canvas to move Bitmap

    - by John Apple Sim
    I have a SurfaceView and I want the Bitmap Logo inside it in the canvas to be movable What I'm doing wrong ? static float x, y; Bitmap logo; SurfaceView ss = (SurfaceView) findViewById(R.id.svSS); logo = BitmapFactory.decodeResource(getResources(), R.drawable.logo); x = 40; y = 415; ss.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent me) { try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } switch(me.getAction()) { case MotionEvent.ACTION_DOWN: x = me.getX(); y = me.getY(); break; case MotionEvent.ACTION_UP: x = me.getX(); y = me.getY(); break; case MotionEvent.ACTION_MOVE: x = me.getX(); y = me.getY(); break; } return true; } }); public class OurView extends SurfaceView implements Runnable{ Thread t = null; SurfaceHolder holder; boolean isItOK = false; public OurView(Context context) { super(context); holder = getHolder(); } public void run (){ while (isItOK == true){ //canvas DRAWING if (!holder.getSurface().isValid()){ continue; } Canvas c = holder.lockCanvas(); c.drawARGB(255, 200, 100, 100); c.drawBitmap(logo, x,y,null); holder.unlockCanvasAndPost(c); } } public void pause(){ isItOK = false; while(true){ try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } break; } t = null; } public void resume(){ isItOK = true; t = new Thread(this); t.start(); } } Now the surface view is just black .. nothing happens also its not colored 200, 100, 100

    Read the article

  • phrase split algorithm in PHP

    - by Eric Sim
    Not sure how to explain. Let's use an example. Say I want to split the sentence "Today is a great day." into today today is today is a today is a great today is a great day is is a is a great is a great day a a great a great day great great day day The idea is to get all the sequential combination in a sentence. I have been thinking what's the best way to do it in PHP. Any idea is welcome.

    Read the article

  • Add Page Tab dialog not working

    - by Sim
    I was always using the direct Add to Page Tab URL like this: http://www.facebook.com/dialog/pagetab?app_id=238557109577754&redirect_uri=http://www.facebook.com And today that URL gives me "Sorry, something went wrong.". Did something changed on Facebook side? Or is it a temporary bug? Note that I have tried other redirect_uri params, such as the URL of the location where the app is hosted. It does always result in the same error.

    Read the article

  • How yo set up a Sony Vaio PCG-4121EM 3G modem?

    - by Ivan
    We've bought a Sony Vaio PCG-4121EM supposed to have a built-in 3G modem. It has a SIM-card slot at its bottom. We've inserted a newly-bought SIM-card but nothing happened and the modem is still not visible among the computer devices (neither in Windows device manager nor in "Modems" Control Panel applet). How to turn it on? I would usually seek to turn a built-in device in the BIOS setup, but there seem to be no BIOS setup on this Vaio - Windows 7 splash screen appears immediately as I turn the computer on.

    Read the article

  • Low FPS in some games, but hardware not fully used

    - by Mario De Schaepmeester
    I just did a little funny experiment in the game/sim "Train Simulator 2013". I normally have good FPS in it (around 30) at full settings. What I did was make a really, really long train so that the calculations the sim needed to make were enormous (the sim is quite realistic, it takes all things into account like speed/acceleration, G-forces, comfort levels, possible wheel slip and many more, and most of those things on each carriage seperately). This resulted in only 14FPS as reported by the game, but it felt more like 8FPS or so. I have a Logitech G15 keyboard which has an LCD, and it allows me to monitor CPU/RAM and video card load on it. The strange thing is, all CPU cores were busy, but the total load was only about 60% maximum at all times. The video card was only on 30% load (possibly an important note, the memory was full, which is however not unusual for the game in question). The RAM had plenty of room and there weren't many operations as it didn't grow or shrink much. I just have the feeling that the game would run smoother if it used more of my hardware power. Why is it not doing so? I had the same in another game, The Elder Scrolls: Morrowind when using more than 100 mods (that all use scripting) and a few high res texture mods, + a full-on graphics improvement program. The engine is very old (2003), and so I thought this might be the cause (not being optimised for multithreading). I had thought of possible causes, like: The operating system doesn't let the games use all the resources. It doesn't make use of multi-threading appropriately. To eliminate the former, I tried a CPU stress tool and that got 100% CPU juice as I let it run, so the OS is not the problem. I gave its thread the "higher" priority though. My actual question In both games, I did things the engine was not really built to do or support. Can those games' framerate be limited cause of their own engine not being able to cope? What is the real reason and more importantly, can I help it? And in any case, could something actually be wrong with my hardware? It's all reasonably new, a couple of months, and I (almost) never experience any other trouble. Modern and much more demanding games work absolutely fine. Specs CPU: AMD Phenom II 965 X4 @ 3.4gHz RAM: 8GB of DDR3 RAM Video: MSI GTX560 (nVidia chip) with 1GB of GDDR5 memory OS: Windows 7 Ultimate 64 bit Nothing overclocked.

    Read the article

  • Problem with Json in Jquery

    - by Davidslv
    Hi everyone, I have a small survey, but when i submit it says that the msg is null, i don't see where is my error. If you could help me i apreciate it. Thank you My Form with Jquery and Ajax Function <!DOCTYPE HTML> <hmtl lang="pt-PT"> <head> <title>Formul&aacute;rio</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> </head> <body> <hr /> <h3>Formulario</h3> <script type="text/javascript" charset="utf-8"> $(function () { $('#submiter').click( function() { $.ajax({ type: "POST", url: 'validar.php', dataType: 'json', success: function(msg) { alert('Mensagem '+ msg.mensagem); }, error : function () { alert('Ocorreu um erro'); } }); }); }); </script> <form id="formulario" action="" method="post" accept-charset="utf-8"> <p>Pergunta 1</p> <label for="pergunta1">sim</label><input type="radio" id="p1" name="pergunta1" value="1" /><br /> <label for="pergunta1">n&atilde;o</label><input type="radio" id="p1" name="pergunta1" value="0" /> <br /> <p>Pergunta 2</p> <label for="pergunta2">sim</label><input type="radio" name="pergunta2" value="0" /><br /> <label for="pergunta2">n&atilde;o</label><input type="radio" name="pergunta2" value="1" /> <br /> <p>Pergunta 3</p> <label for="pergunta3">sim</label><input type="radio" name="pergunta3" value="0" /><br /> <label for="pergunta3">n&atilde;o</label><input type="radio" name="pergunta3" value="1" /> <br /> <p>Pergunta 4</p> <label for="pergunta4">sim</label><input type="radio" name="pergunta4" value="0" /><br /> <label for="pergunta4">n&atilde;o</label><input type="radio" name="pergunta4" value="1" /> <br /> <p><input type="submit" id="submiter" value="Continue &rarr;"></p> </form> </body> </html> My PHP <?php if($_POST) { $pergunta1 = $_POST['pergunta1']; $pergunta2 = $_POST['pergunta2']; $pergunta3 = $_POST['pergunta3']; $pergunta4 = $_POST['pergunta4']; $calcular = $pergunta1 + $pergunta2 + $pergunta3 + $pergunta4; $var = array ('mensagem' => $calcular); echo json_encode($var); } else { $var2 = array('mensagem' => 'sem resultado'); echo json_encode($var2); } ?>

    Read the article

  • Disabling checkboxes based on selection of another checkbox in jquery

    - by Prady
    Hi, I want to disable a set of checkbox based on selection of one textbox and enable the disabled ones if the checkbox is unchecked. In the code below. If someone checks the checkbox for project cost under change this parameter then checkbox for project cost under Generate simulated value for this param should be disabled and all the checkboxes under change this parameter should be disabled except for checked one. Similarly this should be done each parameter like Project cost,avg hours,Project completion date, hourly rate etc. One way i could think of was of on the click function disable each checkbox by the id. Is there a better way of doing it? <table> <tr> <td></td> <td></td> <td>Change this parameter</td> <td>Generate simulated value for this param</td> </tr> <tr> <td>Project cost</td> <td><input type ="text" id ="pc"/></td> <td><input class="change" type="checkbox" name="chkBox" id="chkBox"></input></td> <td><input class="sim" type="checkbox" name="chkBox1" id="chkBox1"></input></td> </tr> <tr> <td>Avg hours</td> <td><input type ="text" id ="avghrs"/></td> <td><input class="change" type="checkbox" name="chkBoxa" id="chkBoxa"></input></td> <td><input class="sim" type="checkbox" name="chkBox1a" id="chkBox1a"></input></td> </tr> <tr> <td>Project completion date</td> <td><input type ="text" id ="cd"/></td> <td><input class="change" type="checkbox" name="chkBoxb" id="chkBoxb"></input></td> <td><input class="sim" type="checkbox" name="chkBox1b" id="chkBox1b"></input></td> </tr> <tr> <td>Hourly rate</td> <td><input type ="text" id ="hr"/></td> <td><input class="change" type="checkbox" name="chkBoxc" id="chkBoxc"></input></td> <td><input class="sim" type="checkbox" name="chkBox1c" id="chkBox1c"></input></td> </tr> </table> Thanks Prady

    Read the article

  • Due to the Classes

    - by Ratman21
    Why does it seem that I am always saying sorry (or in Japanese Gomennasi)?  Well I am late again for blog as you can see. The CCNA class’s part 1 (also known as CCENT) was, well more intense than all of the certification classes before it.   The teacher was cramming as much as he could into us during the week and it was hard to come home and do much more than fall into bed (Well I was doing still doing my Job search and checking up on my web sites and groups).   But I didn’t have much left in the way of blogging (Which by the way is now in 3 different sites). Even though it was hard some times, I really liked the fact I was getting back to something like (and mean really like, in fact I like Cisco routers than some people I know). At the class, I got some software that allows me to simulate setting up and troubles shoot Lan’s or Wan’s.   When we weren’t getting facts for the test thrown at us, we were doing labs with this software. It was fun for me to be able to use the CISCO router commands and trouble shoot router issues. Even if it was just a sim. So now it is study, study, take practices tests and do the labs. I took the week end and more off after cram CCENT week but, now I am back at it.  Also I could not keep up with my Love Dare book during week of the class. No I did not stop or forget what I already learned. I just put the next dare on hold. Well the hold is off starting tomorrow and tonight I think I am going to write a new cover letter. Let’s see what else I can get done tonight. Hmm I think I will try to do a sim of my home wireless LAN and study for CCENT test in about 3 weeks.   So see you tomorrow (I hope).

    Read the article

  • Going on 15 months for me...

    - by Ratman21
    About 5 face to face interviews, 4 telephone ones and except for the two weeks Census Job. But, after 15 months looking for work, I am still with out a JOB. What is wrong here or with me? Let’s see, hard worker (check), self motivated to do well on a Job (Check), Certified CompTIA A+, Security+  and Network+ Technician (Check), 20 + years experience in “IT” (CHECK), in good health, in 20 years of work only 15 days off due to health issues (Check), 18 years experience as technical Help Desk support (Check), can still work better than younger personal (Check), Strong trouble shooting skills for software, computer hard ware and circuit issues (Check) and Multiple software languages (Hey I have done some programming) Check. Hmm I don’t see any problem with me (of course I could have missed something, please let me know if you see what I am missing).    Now as to what have I been up to since I last blogged. The same things of course, Job hunting, job hunting and study.   I have set up sim of my home LAN and will be adding a wireless print server to the sim and in real life, soon.  I was able to pull up and copy the examples of Cisco router commands that I had on my old lap top, to my newer PC. Every time I used a new command while working the NOC on my last job.   I would cut and past a copy of the command on the router (and what it did) I was working on.  Along with notes on the problem and commands use for same router. I used these to make documentation for on how to handle these types of issues, for the other Operation Techs. My old notes are helping me in studying for the CCENT test.    As to Love Dare, I think it will take more like 40 weeks, than the 40 days of the book. Yes I am making progress, slow but, it is progress. I will have more on that in my next blog.

    Read the article

  • Can I use my prepaid phone balance (in pesos) to buy from the Software Centre?

    - by obetus
    Using local network broadband, we can use it to buy games and applications from load balance. Is there any possible ways to use it also in Ubuntu software Center? additional: I'm using mobile broadband for the internet connection,this broadband has a sim card and account number where you can download money from buying a prepaid card worth 100 pesos,300 pesos or 500 pesos, provided by our local network. We use this mobile broadband when there is no wifi connection. There are two kinds of mobile broadband, one is postpaid account and the other is prepaid account. I use prepaid account, this kind of account can load a money for transaction like data plans, from 10 pesos for 30 minutes internet connection or 200 pesos for 5 days internet connection., and this prepaid account can load 5 pesos up to thousands of pesos. Now, if this prepaid mobile broadband can provide money in pesos and has internet connection, I think it can also use it for buying goods or applications or games via internet. i think its only need a software that can detect the sim card number and the money balance for transactions. Sorry for my bad english but I hope you got my point.

    Read the article

  • Icecast/shoutcast streaming on Android

    - by Alvin
    Is there a way to stream shoutcast/icecast on the android? Passing the icecast URL to the mediaplayer does not work and after researching the topic it seems it is because android can't play raw aac files without a media container. What can I do to get around this? Thanks

    Read the article

  • What is the "standard" JQuery treeview that most people use? It seems the most popular plugin isn't

    - by Pete Alvin
    I've chosen JQuery as my JavaScript library but now I'm a bit frustrated by the JQuery plugin site... the site kinda sucks... the plugin area isn't designed very well and I can only find a few treeviews. The one with the most votes (link text) isn't supported anymore. Can someone please point me to an industrial strength treeview? Desired Features: 1. stable 2. async / ajax would be nice 3. drag and drop nodes would be nice I've been delighted so far with JQueryUI--nice design. But, how come it doesn't come with a standard tree view? Pete

    Read the article

  • Why is WCF Stream response getting corrupted on write to disk?

    - by Alvin S
    I am wanting to write a WCF web service that can send files over the wire to the client. So I have one setup that sends a Stream response. Here is my code on the client: private void button1_Click(object sender, EventArgs e) { string filename = System.Environment.CurrentDirectory + "\\Picture.jpg"; if (File.Exists(filename)) File.Delete(filename); StreamServiceClient client = new StreamServiceClient(); int length = 256; byte[] buffer = new byte[length]; FileStream sink = new FileStream(filename, FileMode.CreateNew, FileAccess.Write); Stream source = client.GetData(); int bytesRead; while ((bytesRead = source.Read(buffer,0,length))> 0) { sink.Write(buffer,0,length); } source.Close(); sink.Close(); MessageBox.Show("All done"); } Everything processes fine with no errors or exceptions. The problem is that the .jpg file that is getting transferred is reported as being "corrupted or too large" when I open it. What am I doing wrong? On the server side, here is the method that is sending the file. public Stream GetData() { string filename = Environment.CurrentDirectory+"\\Chrysanthemum.jpg"; FileStream myfile = File.OpenRead(filename); return myfile; } I have the server configured with basicHttp binding with Transfermode.StreamedResponse.

    Read the article

  • WPF DataGridTextColumn Can't type point for float data

    - by Alvin
    I had a WPF DataGrid and use DataGridTextColumn Binding to a Collection. The items in Collection had some float property. When my program launched, I modify the value of float property in DataGrid, if I type a integer value, it works well. But if I type char . for a float value, char . can't be typed. I had to type all the numbers first, and then jump to the . position to type char . to finish my input. So how can I type . in my situation? Thanks.

    Read the article

  • C# Check if character exists in encoding

    - by Alvin Wong
    I am writing a program that a part renders a bitmap font in CP437. In a function that renders the text with I want to be able to check whether a char is available in CP437 before the encoding conversion, like: public static void DrawCharacter(this Graphics g, char c) { if (char_exist_in_encoding(Encoding.GetEncoding(437), c) { byte[] src = Encoding.Unicode.GetBytes(c.ToString()); byte[] dest = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(437), src); DrawCharacter(g, dest[0]); // Call the void(this Graphics, byte) overload } } Without the check, any characters outside CP437 will result in a '?' (63, 0x3F). I want to hide any invalid characters completely. Is there an implementation of char_exist_in_encoding other than the following stupid approach? public static bool char_exist_in_encoding(Encoding e, char c) { if (c == '?') return true; byte[] src = Encoding.Unicode.GetBytes(c.ToString()); byte[] dest = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(437), src); if (dest[0] == 0x3F) return false; return true; } Perhaps not very relevant, but the bitmap is created like this: Bitmap b = new Bitmap(256 * 8, 16); Graphics g = Graphics.FromImage(b); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; Font f = new Font("Whatever 8x16 bitmap font", 16, GraphicsUnit.Pixel); for (byte i = 0; i < 255; i++) { byte[] arr = Encoding.Convert(Encoding.GetEncoding(437), Encoding.Unicode, new byte[] { i }); char c = Encoding.Unicode.GetChars(arr)[0]; g.DrawString(c.ToString(), f, Brushes.Black, i * 8 - 3, 0); // Don't know why it needs a 3px offset } b.Save(@"D:\chars.png");

    Read the article

  • Windows7 IIS7: zips don't have php5isapi.dll Can I use php.dll instead?

    - by Pete Alvin
    The page: How to Install PHP 5.2 on IIS 7and Windows Vista (and a few others) reference a mysterious php5isapi.dll which is not in the Windows install, or the zip files: php-5.3.2-Win32-VC9-x86.zip - VC9 x86 Thread Safe php-5.3.2-nts-Win32-VC9-x86.zip - VC9 x86 Non Thread Safe There was another post on stackoverflow that said it's obsolete and replaced by "fastapi" but no instructions mention this. I did find a php.dll in the zip file. Can I use that instead of php5isapi.dll? It's very frustrating trying to install basic PHP5 on Windows with MySQL.

    Read the article

  • Lucene.Net support phrases?: What is best approach to tokenize comma-delimited data (atomically) in

    - by Pete Alvin
    I have a database with a column I wish to index that has comma-delimited names, e.g., User.FullNameList = "Helen Ready, Phil Collins, Brad Paisley" I prefer to tokenize each name atomically (name as a whole searchable entity). What is the best approach for this? Did I miss a simple option to set the tokenize delimiter? Do I have to subclass or write my own class that to roll my own tokenizer? Something else? ;) Or does Lucene.net not support phrases? Or is it smart enough to handle this use case automatically? I'm sure I'm not the first person to have to do this. Googling produced no noticeable solutions.

    Read the article

  • Django custom SQL returning single row of results when query returns 2?

    - by Alvin
    I have a custom SQL call that is returning different results to the template than I get when I run the same query against the database directly, 1 row vs 2 Query - copied from Django Debug Toolbar: SELECT ((Sum(new_recruit_interviews) / Sum(opportunities_offered)) * 100) as avg_recruit, ((Sum(inspections) / Sum(presentations)) * 100) as avg_inspect, ((Sum(contracts_signed) / Sum(roof_approvals)) * 100) as avg_contracts, ((Sum(adjusters) / Sum(contracts_signed)) * 100) as avg_adjusters, ((Sum(roof_approvals) / Sum(adjusters)) *100) as roof_approval_avg, ((Sum(roof_turned_in) / Sum(adjusters)) * 100) as roof_jobs_avg, Sum(roof_turned_in) as roof_jobs_total, ((Sum(siding_approvals) / Sum(adjusters)) *100) as siding_approval_avg, ((Sum(siding_turned_in) / Sum(adjusters)) * 100) as siding_jobs_avg, Sum(siding_turned_in) as siding_jobs_total, ((Sum(gutter_approvals) / Sum(adjusters)) *100) as gutter_approval_avg, ((Sum(gutter_turned_in) / Sum(adjusters)) * 100) as gutter_jobs_avg, Sum(gutter_turned_in) as gutter_jobs_total, ((Sum(window_approvals) / Sum(adjusters)) *100) as window_approval_avg, ((Sum(window_turned_in) / Sum(adjusters)) * 100) as window_jobs_avg, Sum(window_turned_in) as window_jobs_total, (Sum(roof_turned_in) + Sum(siding_turned_in) + Sum(gutter_turned_in) + Sum(window_turned_in)) as total_jobs, (((Sum(collections_jobs_new) + Sum(collections_jobs_previous)) / (Sum(roof_turned_in) + Sum(siding_turned_in) + Sum(gutter_turned_in) + Sum(window_turned_in))) * 100) as total_collections, sales_report_salesmen.location_id as detail_id, business_unit_location.title as title FROM sales_report_salesmen Inner Join auth_user ON sales_report_salesmen.user_id = auth_user.id Inner Join business_unit_location ON sales_report_salesmen.location_id = business_unit_location.id GROUP BY location_id Results from direct query running the above query: INSERT INTO `` (`avg_recruit`, `avg_inspect`, `avg_contracts`, `avg_adjusters`, `roof_approval_avg`, `roof_jobs_avg`, `roof_jobs_total`, `siding_approval_avg`, `siding_jobs_avg`, `siding_jobs_total`, `gutter_approval_avg`, `gutter_jobs_avg`, `gutter_jobs_total`, `window_approval_avg`, `window_jobs_avg`, `window_jobs_total`, `total_jobs`, `total_collections`, `detail_id`, `title`) VALUES (95.3968, 92.8178, 106.9622, 90.2928, 103.5420, 103.5670, 4152, 100.2494, 106.8845, 4285, 120.1297, 86.2559, 3458, 92.9658, 106.1611, 4256, 16151, 4.281469, 12, 'St Paul, MN'); VALUES (90.2982, 73.3723, 97.8474, 104.5433, 97.7585, 86.1848, 1884, 109.9268, 109.3321, 2390, 81.0156, 96.4318, 2108, 91.7200, 123.8792, 2708, 9090, 4.531573, 13, 'Denver, CO'); Results from template: {'roof_jobs_total': Decimal('4152'), 'gutter_jobs_total': Decimal('3458'), 'avg_adjusters': Decimal('90.2928'), 'title': u'St Paul, MN', 'window_approval_avg': Decimal('92.9658'), 'total_collections': Decimal('4.281469'), 'gutter_approval_avg': Decimal('120.1297'), 'avg_recruit': Decimal('95.3968'), 'siding_approval_avg': Decimal('100.2494'), 'window_jobs_total': Decimal('4256'), 'detail_id': 12L, 'siding_jobs_avg': Decimal('106.8845'), 'avg_inspect': Decimal('92.8178'), 'roof_approval_avg': Decimal('103.5420'), 'roof_jobs_avg': Decimal('103.5670'), 'total_jobs': Decimal('16151'), 'window_jobs_avg': Decimal('106.1611'), 'avg_contracts': Decimal('106.9622'), 'gutter_jobs_avg': Decimal('86.2559'), 'siding_jobs_total': Decimal('4285')} Tried tweaking it a few ways and running the results through various for loops, keep getting the same result where my results are a single row through the Django template and the expected results (through console) have 2 rows The row that is coming back is the same as the first row returned through the console query so I'm thinking that it is running correctly just a matter of passing the results through... for good measure this is the code I'm using to generate the query (yes it's a bit ugly, been playing with it) def sql_grouped(table, fields, group_by=False, where=False): from django.db import connection query = 'SELECT %s FROM %s' % (fields, table) if where: query = query + ' WHERE %s' % (where) if group_by: query = query + ' GROUP BY %s' % (group_by) cursor = connection.cursor() cursor.execute(query) desc = cursor.description data = [dict(zip([col[0] for col in desc], row)) for row in cursor.fetchall()] return data[0] any feedback is greatly appreciated - been tinkering with this since I realized I could skip a few steps by generating my averages directly within the SQL rather than post-process

    Read the article

  • For "draggable" div tags that are NOT nested: JQuery/JavaScript div tag “containment” approach/algor

    - by Pete Alvin
    Background: I've created an online circuit design application where .draggable() div tags are containers that contain smaller div containers and so forth. Question: For any particular div tag I need to quickly identify if it contains other div tags (that may in turn contain other div tags). -- Since the div tags are draggable, in the DOM they are NOT nested inside each other but I think are absolutely positioned. So I think that a "hit testing" approach is the only way to determine containment, unless there is some "secret" routine built-in somewhere that could help with this. I've searched JQuery and I don't see any built-in routine for this. Does anyone know of an algorithm that's quicker than O(n^2)? Seems like I have to walk the list of div tags in an outer loop (n) and have an inner loop (another n) to compare against all other div tags and do a "containment test" (position, width, height), building a list of contained div tags. That's n-squared. Then I have to build a list of all nested div tags by concatenating contained lists. So the total would be O(n^2)+n. There must be a better way?

    Read the article

  • Is Lucern.net good choice for website search of 1M item product database? (giving up on SQL Server

    - by Pete Alvin
    We currently have in production SQL Server 2005 and we use it's full text search for a eCommerce site search of a million product database. I've optimized it as much as possible (I think) and we're still seeing search times of five seconds. (We don't need site scrawl or PDF (etc.) document indexing features... JUST "Google" speed for site search.) I was going to buy dtSearch but now I realize I can just use Lucerne.net and save the $2,500 for two server license. I read on a post that Lucerne.Net is not good for website searches. Has anyone else used Lucerne.Net from ASP.Net? Does it take a lot of memory? Any problems? Any comments?

    Read the article

  • HTTP method GET is not supported by this URL

    - by Alvin
    Hi, I'm calling servlets which has implemented CometProcessor interface, and whenever I try to call the servlets with get request, I'm getting the above error. May I know the reason? public class ChatServlets extends HttpServlet implements CometProcessor { public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); HttpServletResponse response = event.getHttpServletResponse(); if (event.getEventType() == CometEvent.EventType.BEGIN) { response.getWriter().println("Welcome "); } else if (event.getEventType() == CometEvent.EventType.READ) { response.getWriter().println("Bye"); } } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >