Daily Archives

Articles indexed Sunday September 9 2012

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

  • Bad 3D Performance in Ubuntu 12.04

    - by Pandem
    I already posted a question before but I didn't really get any advice/help. I'll be a bit more brief/general in hope it'll help. I have an MSI HD 7850 with the Catalyst 12.4 drivers installed. I've found that I'm having bad 3D performance for some reason but I'm not entirely sure what. I suspect it may just that the graphics card is new and AMD just need to work on their drivers but it would be nice to get advice and narrow the problem down so that I can be sure rather than wait for driver updates that may not even help. I ran gxlgears to give some general idea of how bad the performance is. At default size it is averaging around 2000 FPS. The command glxinfo confirms the renderer is using AMD Radeon HD 7800 Series with OpenGL version 4.2. Edits below: As asked for others: lspci -v output is here. fglrxinfo output is here xvinfo output is here glxinfo | grep rendering says yes for direct rendering. These confirmed that everything was configured correctly. Within Unity and Gnome Classic: glxgears had an FPS of around 2000 FPS fgl_glxgears had an FPS of around 544 FPS Within LDXE: glxgears had an FPS of around 4600 FPS fgl_glxgears had an FPS of around 1600 FPS In the end it was discovered that Compiz was causing a large performance decrease and solution was simply to change window manager for the time being. Thanks to TechZilla for all his help!

    Read the article

  • AR242x / AR542x wireless card not working

    - by Pipan87
    My wifi worked perfect until I updated to the latest version of Ubuntu. Now I don't find any wireless connections at all. I have tried lots of guides on the internet but I can't get it to work. I did however start to work once after writing something I don't remember in Terminal, but after rebooting it stopped working again. Some info (don't know if you need more to help): 01:00.0 Ethernet controller: Atheros Communications AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) Subsystem: Acer Incorporated [ALI] Device 022c Flags: bus master, fast devsel, latency 0, IRQ 44 Memory at 55200000 (64-bit, non-prefetchable) [size=256K] I/O ports at 3000 [size=128] Capabilities: [40] Power Management version 2 Capabilities: [48] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [58] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [180] Device Serial Number ff-93-2e-de-00-23-8b-ff Kernel driver in use: ATL1E Kernel modules: atl1e 02:00.0 Ethernet controller: Atheros Communications Inc. AR242x / AR542x Wireless Network Adapter (PCI-Express) (rev 01) Subsystem: Foxconn International, Inc. Device e00d Flags: bus master, fast devsel, latency 0, IRQ 18 Memory at 54100000 (64-bit, non-prefetchable) [size=64K] Capabilities: [40] Power Management version 2 Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit- Capabilities: [60] Express Legacy Endpoint, MSI 00 Capabilities: [90] MSI-X: Enable- Count=1 Masked- Capabilities: [100] Advanced Error Reporting Capabilities: [140] Virtual Channel Kernel driver in use: ath5k Kernel modules: ath5k

    Read the article

  • access to site owner not working

    - by Daveo
    I made a website it works for everyone except for the site owner, who cannot access the site. He gets a server could not be found error. I went to his house and the issue occurs for all of his devices (PC, laptop, iPhone using WiFi) when I turn WiFi off the iPhone it works. So I thought it was a problem on his router so I reset is router to default factory settings but it still does not work, I have flushed his DNS cache and his browser cache. But nothing seems to help. He cannot even PING the server using the domain name. However when he uses the IP address he can see the site fine. I looked in cpanel for an blocked IP addresses but cannot see anything. What could be stopping just him from accessing the site via domainname and not the IP address? Site details are: PHP, osCommerce it is hosted by site5 on my reseller account.

    Read the article

  • Domain name only works with www. but not without the www

    - by Rodrigo Salazar
    I have searched for this problem numerous times but I can't quite apply the solution to my problem. The usual solution I find is that I need to add an A-record to my dns, currently I only have a C-name record for host 'www' to my DNS. The problem is, I'm having trouble understanding what goes in the 'host' section of the record when trying to create an A-record. Here is a screenshot to my domain registrar where I am trying to create the record. http://i.imgur.com/M18zm.png I have tried creating an A-record with the 'host' field set to *, but that is not a valid entry, nor is leaving it blank. Anyone have any suggestions? The domain is swageroo.com, but it's only reachable at http://www.swageroo.com (With the www)

    Read the article

  • Has anyone used game salad before and how does it compare with cocos2d in terms of 2d game development

    - by jih
    First a short intro. I am new to the game development space and want to make some 2d games for iOS. I first come across cocos2d and kobold but then wanted something more graphical for rapid prototyping. I then found Game Maker which doesn't support iOS but is fairly easy to learn and then found Game Salad which supports iOS as well as other platforms. I know this question has been ask before but I want to know in terms of the types of games I want to develop what an learning investment path would be best. The types of games genre I am interest are: Side scrollers Simple games like diamond dash or ninja fruits, shanghai, etc Old fashioned zelda or dragonquest type (nintendo fan here:-) 2d adventure RPG games (real time or turn based) Mystery turn based games like carmen sandiego, wizardry, myst etc. So now the question becomes Which game development environment should I invest my time in learning. Game Salad or cocos2d? It would seem game salad would be great for quickies being graphical but in terms of 2d platform games etc would there be speed/performance/feature penalties? Are there certain 2d games genre of the 4 above that Game salad is better at while certain type cocos2d would be better at? Anyone with experience of both can share some pointers? Thanks. inexperienced jih

    Read the article

  • D3DXMatrixDecompose gives different quaternion than D3DXQuaternionRotationMatrix

    - by Fraser
    In trying to solve this problem, I tracked down the problem to the conversion of the rotation matrix to quaternion. In particular, consider the following matrix: -0.02099178 0.9997436 -0.008475631 0 0.995325 0.02009799 -0.09446743 0 0.09427284 0.01041905 0.9954919 0 0 0 0 1 SlimDX.Quaternion.RotationMatrix (which calls D3DXQuaternionRotationMatrix gives a different answer than SlimDX.Matrix.Decompose (which uses D3DXMatrixDecompose). The answers they give (after being normalized) are: X Y Z W Quaternion.RotationMatrix -0.05244324 0.05137424 0.002209336 0.9972991 Matrix.Decompose 0.6989997 0.7135442 -0.03674842 -0.03006023 Which are totally different (note the signs of X, Z, and W are different). Note that these aren't q/-q (two quaternions that represent the same rotation); they face completely different directions. I've noticed that with matrices for rotations very close to that one (successive frames in the animation) that the Matrix.Decompose version gives a solution that flips around wildly and occasionally goes into the desired position, while the Quaternion.RotationMatrix version gives solutions that are stable but go in the wrong direction. This is only for the right arm in my animation -- for the left arm, both functions give the correct solution, which is the same quaternion within error tolerances. This makes me think that there's some sort of numeric instability or weird stuff with signs going on. I tried implementing this and then this, but both gave me a completely incorrect solution (even for the matricies where the SlimDX ones were working correctly) -- maybe the rows and columns are flipped?

    Read the article

  • Java and Eclipse setup properly, how do I install JOGL or LWJGL?

    - by shadowprotocol
    I have my Java environment installed alongside Eclipse, and I was successfully able to create and run a new project (simple System.out.println("Yay I work!"); I have the OpenGL SuperBible, and I primarily want to code 3D things (I'll take my time using the book to learn how to draw shapes in 3D space, etc..) Can you help me get setup with OpenGL in Java? I dont really need LWJGL, although I WILL make games eventually. I just can't even figure out with all of these terrible (and old) tutorials floating around on the net how to install either JOGL or LWJGL. If you can give me a hand with that, I'd appreciate it. I'd like to feel I contributed by having this page show the answer to the question, so that other poor souls googling for this same information can benefit.

    Read the article

  • Problems with this code?

    - by J4C3N-14
    I'm trying to use this code which is an example taken from here https://gist.github.com/2383248 , but it is coming up with a error on the public void onClick which is Multiple markers at this line - implements android.view.View.OnClickListener.onClick - Syntax error, insert "}" to complete MethodBody, but when I add the brace it just throws another error after many tries and fails of different suggestions and ideas. It may be a syntax error and bad coding from me (just started learning to program) but does anyone have any ideas how to resolve this or point me in the right direction I would be very grateful. public class ICSCalendarActivity extends Activity implements View.OnClickListener{ Button button1; int year1; int month1; int day1; int ShiftPattern; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button1 = (Button)findViewById(R.id.openButton); button1.setText("open"); button1.setOnClickListener(this); Bundle extras = getIntent().getExtras(); year1 = extras.getInt("year1"); day1 = extras.getInt("day1"); month1 = extras.getInt("month1"); ShiftPattern = extras.getInt("ShiftPattern"); } public void onClick(View v){ private static void addToCalendar(Context ICSCalendarActivity, final String title, final long dtstart, final long dtend) { final ContentResolver cr = ICSCalendarActivity.getContentResolver(); Cursor cursor ; if (Integer.parseInt(Build.VERSION.SDK) >= 8 ) cursor = cr.query(Uri.parse("content://com.android.calendar/calendars"), new String[]{ "_id", "displayname" }, null, null, null); else cursor = cr.query(Uri.parse("content://calendar/calendars"), new String[]{ "_id", "displayname" }, null, null, null); if ( cursor.moveToFirst() ) { final String[] calNames = new String[cursor.getCount()]; final int[] calIds = new int[cursor.getCount()]; for (int i = 0; i < calNames.length; i++) { calIds[i] = cursor.getInt(0); calNames[i] = cursor.getString(1); cursor.moveToNext(); } AlertDialog.Builder builder = new AlertDialog.Builder(ICSCalendarActivity); builder.setSingleChoiceItems(calNames, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ContentValues cv = new ContentValues(); cv.put("calendar_id", calIds[which]); cv.put("title", title); cv.put("dtstart", dtstart ); cv.put("hasAlarm", 1); cv.put("dtend", dtend); Uri newEvent ; if (Integer.parseInt(Build.VERSION.SDK) >= 8 ) newEvent = cr.insert(Uri.parse("content://com.android.calendar/events"), cv); else newEvent = cr.insert(Uri.parse("content://calendar/events"), cv); if (newEvent != null) { long id = Long.parseLong( newEvent.getLastPathSegment() ); ContentValues values = new ContentValues(); values.put( "event_id", id ); values.put( "method", 1 ); values.put( "minutes", 15 ); // 15 minutes if (Integer.parseInt(Build.VERSION.SDK) >= 8 ) cr.insert( Uri.parse( "content://com.android.calendar/reminders" ), values ); else cr.insert( Uri.parse( "content://calendar/reminders" ), values ); } dialog.cancel(); } }); builder.create().show(); } cursor.close(); } } Thank you.

    Read the article

  • Jquery UI dialog does not disappear

    - by iamrohitbanga
    I am using jquery-ui tabs and dialog functionality. Each tab has a button on the page which opens a dialog. This works for one of the tabs. However if I go the second tab, the button does not work there. When I come back to the first tab, the dialog does show up but the problem is I notice as I make switches back and forth to the first tab, it keeps on inserting new div's while the old div's have display:none set on them. I am doing this using JSP. This is how the reusable jsp looks like: <script> $(function() { var formData = null; $.ajax({ url : "addFormGenerator.html", success : function(data) { formData = data; $("#addFormDialog").html(data); $("#addFormDialog").dialog({ autoOpen : false, height : 300, width : 350, modal : true, buttons : { "Add" : function() { $(this).dialog("close"); }, Cancel : function() { $(this).dialog("close"); } }, close : function() { } }); } }); $("#addButton").button().click(function() { $("#addFormDialog").html(formData); $("#addFormDialog").dialog("open"); }); }); </script> <button id="addButton">Click here to Add New</button> <div id="addFormDialog" title="Add New"></div> This jsp fragment is included in other jsp pages as well. I was assuming as I switch between tabs the old button will be garbage collected. Can you help me understand the problem and fix it?

    Read the article

  • Javascript: click and dblclick deliver different parentNodes on same html. Why?

    - by user1658206
    currently I work on an very small wysiwyg editor based on jquery. I dont care about IE oder Chrome, just Firefox. My problem is to find if the selection is in a link for to get the value of the href attribute if is set. With click the node of the link is found, with double click always the body. It is in designMode. My event-handler for click and dblclick. The vars current_selection, current_node, iframe and container are global. selection_handler:function() { current_selection = iframe.getSelection(); current_node = current_selection.anchorNode; if(current_node.nodeName == "#text") { current_node = current_node.parentNode; } $('#log').text(current_node.nodeName); }, The log shows mit for example 'body', when I click in unformated text. When I add a link with execCommand('createLink',...) the log shows 'A'. That works. When I mark the linked word with 2 click from start to end, the log shows 'A'. But with double click I always get 'body'. So I can't get the href attribute. The handler is defined in the init: init:function(options) { ... iframe = $('#wysiwyg-'+container.attr('id'))[0].contentWindow; iframe.addEventListener('dblclick',methods.selection_handler,false); iframe.addEventListener('click',methods.selection_handler,false); ... } Has somebody an idea what is wrong?

    Read the article

  • Problems with instantiating in JAVA

    - by PUPIALEX
    When running, below programme cannot reach the end of the main function.. I am new to JAVA, and cannot find its defections.. I need your help. Thanks. import java.util.*; class Schedule { public String day; private int startTime, endTime; public Schedule(String input_day, int input_start, int input_end) { day = input_day; startTime = input_start; endTime = input_end; } /* clashWith: to check whether this schedule clash with a Schedule called otherSchedule * PRE-Condition : input must be of Schedule type * POST-Condition : return true if two Schedule clash, return false if not. */ public boolean clashWith(Schedule otherSchedule) { if(this.day != otherSchedule.day || this.endTime <= otherSchedule.startTime || this.startTime >= otherSchedule.endTime) return false; return true; } } class Module { String code; Schedule lecture, tutorial, lab; public Module(String input_code, Schedule input_lecture, Schedule input_tutorial, Schedule input_lab) { code = input_code; lecture = input_lecture; tutorial = input_tutorial; lab = input_lab; } /* count: to count number of classes(lecture, tutorial, and lab of only this Module) on day. * For example: when day = "Monday", lecture is on Monday, tutorial is on Monday * but lab is on Tuesday, then return 2. (lecture and tutorial are on Monday). * PRE-Condition : * POST-Condition : */ public int count(String day) { int num = 0; if(lecture.day == day) num++; if(tutorial.day == day) num++; if(lab.day == day) num++; return num; } /* clashWith: to check whether this module clash with a Module called otherModule * PRE-Condition : * POST-Condition : */ public boolean clashWith(Module otherModule) { if(lecture.clashWith(otherModule.lecture) || lecture.clashWith(otherModule.tutorial) || lecture.clashWith(otherModule.lab) ) return true; if(tutorial.clashWith(otherModule.lecture) || tutorial.clashWith(otherModule.tutorial) || tutorial.clashWith(otherModule.lab)) return true; if(lab.clashWith(otherModule.lecture) || lab.clashWith(otherModule.tutorial) || lab.clashWith(otherModule.lab)) return true; return false; } } class Timetable { Vector<Module> listOfModule; public Timetable() { } /* checkClash: to check whether otherModule clash with one of * the modules in our timetable list. * PRE-Condition : * POST-Condition : */ public boolean checkClash(Module otherModule) { for(Module c: listOfModule) if(c.clashWith(otherModule)) return true; return false; } /* add: to add a new module to the timetable list. * PRE-Condition : * POST-Condition : */ public void add(Module module) { listOfModule.add(module); } /* count: to count number of classes on day. * PRE-Condition : * POST-Condition : */ public int count(String day) { int count_day=0; for(Module c: listOfModule) count_day += c.count(day); return count_day; } } public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num_operation; String code ; Timetable userTimetable = new Timetable(); num_operation = input.nextInt(); for(int i=0;i<num_operation;i++) { if(input.next() == "MODULE") { code = input.next(); String day; int start, end; Schedule getLecSche = new Schedule(input.next(),input.nextInt(),input.nextInt()); Schedule getTutSche = new Schedule(input.next(),input.nextInt(),input.nextInt()); Schedule getLabSche = new Schedule(input.next(),input.nextInt(),input.nextInt()); Module userModule = new Module(code, getLecSche, getTutSche, getLabSche); System.out.println("Reached line 162"); if(!userTimetable.checkClash(userModule)) { userTimetable.add(userModule); System.out.println("Added"); } else System.out.println("Clashed"); } else if(input.next() == "COUNT"){ code = input.next(); System.out.println(userTimetable.count(code)); } } } }

    Read the article

  • does a git repository have its own local value for core.autocrlf that overrides the global one?

    - by Warren P
    As per this question, I understand that core.autocrlf=true in git will cause CRLF to LF translations. However when I type : git config core.autocrlf I see: false However, when I stage modified files that are already in the repo, I still get these warnings: Warning: CRLF will be replaced by LF in File1.X. The file will have its original line endings in your working directory. My guess is that the repo copy of the file is already set to "autocrlf=true". Questions: A. How do I query whether a file or git repo is already forcing AutoCrlf? B. How do I turn it autocrlf off?

    Read the article

  • can't implement jquery jScrollPane to replace browser's scrollbars

    - by Zack
    I am trying to replace browser's scrollbars with jScrollPane (jQuery), it won't work. Here are two attempts to implement it: a basic attempt, and an attempt to imitate the full page demo for jScrollPane. I've been trying everything I could think of to figure out what didn't work, but couldn't. here is my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <!-- styles needed by jScrollPane --> <link type="text/css" href="style/jquery.jscrollpane.css" rel="stylesheet" media="all" /> <style type="text/css" id="page-css"> /* Styles specific to this particular page */ html { overflow: auto; } #full-page-container { overflow: auto; } .scroll-pane { width: 100%; height: 200px; overflow: auto; } .horizontal-only { height: auto; max-height: 200px; } </style> <!-- latest jQuery direct from google's CDN --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <!-- the mousewheel plugin --> <script type="text/javascript" src="script/jquery.mousewheel.js"></script> <!-- the jScrollPane script --> <script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script> <script type="text/javascript" id="sourcecode"> $(function () { var win = $(window); // Full body scroll var isResizing = false; win.bind( 'resize', function () { if (!isResizing) { isResizing = true; var container = $('#full-page-container'); // Temporarily make the container tiny so it doesn't influence the // calculation of the size of the document container.css( { 'width': 1, 'height': 1 } ); // Now make it the size of the window... container.css( { 'width': win.width(), 'height': win.height() } ); isResizing = false; container.jScrollPane( { 'showArrows': true } ); } } ).trigger('resize'); // Workaround for known Opera issue which breaks demo (see // http://jscrollpane.kelvinluck.com/known_issues.html#opera-scrollbar ) $('body').css('overflow', 'hidden'); // IE calculates the width incorrectly first time round (it // doesn't count the space used by the native scrollbar) so // we re-trigger if necessary. if ($('#full-page-container').width() != win.width()) { win.trigger('resize'); } }); </script> </head> <body> <div id="full-page-container"> This is the most basic implementation of jScrollPane I could create, if I am not wrong this has all it should take, yet it doesn't work. a little lorem ipsum to make the scrollbars show up: [here come's lot's of lorem ipsum text in the actual page...] </div> </body> </html> The other option is the same, with a link to demo.css and demo.js.

    Read the article

  • How to manually close connection in BaseHTTPServer?

    - by user1657188
    I have a script that sends a request to an HTTP server. HTTP server script (snippet): ... class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(sa): pdict = cgi.parse_header(sa.headers.getheader('referer')) q = pdict[0] q = urllib.unquote(q) if q == "enternetixplorer" # basically just ignore this, doesn't have to do with the question sa.wfile.write("blah blah blah") # now restart server httpd.server_close() python = sys.executable os.execl(python, python, * sys.argv) ... The "blah blah blah" is sent back, but the connection does not seem to close, and my script is waiting forever until I abort the server. (My thought is BaseHTTPServer automatically closes connection when the last part in "do_GET()" is computed, but I prevent this by restarting the script.) If I'm right, how do I close the connection? If not, what else might be the problem? Edit: The server script HAS to restart the entire program.

    Read the article

  • how to add data in Table of Jasper Report using Java

    - by Areeb Gillani
    i am here to ask you just a simple question that i am trying to pass data to a jasper report using java but i dont know how to to, because the table data is very dynamic thats y cannot pass sql query. any idea for this. i have a 2D array of object type, where i have all the data... so how can i pass that... Thanx in advance...!:) ConnectionManager con = new ConnectionManager(); con.establishConnection(); String fileName = "Pmc_Bill.jrxml"; String outFileName = "OutputReport.pdf"; HashMap params = new HashMap(); params.put("PName", pname); params.put("PSerial", psrl); params.put("PGender",pgen); params.put("PPhone",pph); params.put("PAge",page); params.put("PRefer",pref); params.put("PDateR",dateNow); try { JasperReport jasperReport = JasperCompileManager.compileReport(fileName); if(jasperReport != null ) System.out.println("so far so good "); // Fill the report using an empty data source JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JRTableModelDataSource(tbl.getModel()));//con.connection); try{ JasperExportManager.exportReportToPdfFile(jasperPrint, outFileName); System.out.printf("File exported sucessfully"); }catch(Exception e){ e.printStackTrace(); } JasperViewer.viewReport(jasperPrint); } catch (JRException e) { JOptionPane.showMessageDialog(null, e); e.printStackTrace(); System.exit(1); }

    Read the article

  • How to expand row in a grid using rowexpander plugin Extjs 4.1.1

    - by Waseem
    How to expand row in a grid using rowexpander plugin? I am using the following code in my controller 'editbasicinfotitlegrid gridview' : { afterrender:this.expandAll } expandAll: function(){ var titlesGrid = Ext.getCmp('editBasicInfoTitleGrid'); var expander = titlesGrid.getPlugin('myRowExpander'); console.log(titlesGrid.plugins[0]); expander.toggleRow(0); } But this code gives me the following error Uncaught TypeError: Cannot call method 'down' of null

    Read the article

  • not able to run c/cpp execs in eclipse cdt

    - by user1658323
    i installed eclipse and then cdt on an ubuntu system recently and was trying to make the first runnable c/c++ proj.. i installed g++ also, and then created the first executable cpp 'Hello World' project some files are created... then some issues... 1) even though Build Automatically is selected, I have to goto the project n do a Build Project to build it manually, and this i have to do everytime i make a change 2) After Building manually, there are some new folders created with Binaries and Debug files and i can see g++ commands in the console being executed. The project binary is output both to debug n binaries folder. But i am not able to run these through the Green Play Button or any other way in eclipse. Even Run configuration is not showing any option for c/C++ proj.. though i can goto terminal and run the binary myself through ./ But i want to be able to run n debug this through eclipse. plz help in fixing me this problem as i really love eclipse n have some c/cpp assignments coming soon.. Console info on doing a manual project build - Build of configuration Debug for project qwe ** make all Building file: ../src/qwe.cpp Invoking: GCC C++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/qwe.d" -MT"src/qwe.d" -o "src/qwe.o" "../src/qwe.cpp" Finished building: ../src/qwe.cpp Building target: qwe Invoking: GCC C++ Linker g++ -o "qwe" ./src/qwe.o Finished building target: qwe Build Finished **

    Read the article

  • Row for each hour even if there is no record

    - by peku33
    I've got a trouble with creating mysql Query. My PHP script executes this query on each run: INSERT INTO Executes SET UserIp='%s' (%s is user IP) Executes table is: ExecuteId UNSIGNED BIGINT AI PRIMARY Date TIMESTAMP DEFAULT CURRENT_TIMESTAMP INDEX UserIp CHAR(24) ... | Some Columns I want to retrive number of Executes in each hour. The most obvious solution would be: SELECT COUNT(*) as ExecutesNum, DATE(Date) as D, HOUR(Date) as H GROUP BY D, H And it works, BUT it does not create rows for hours where there were no executes. What should I modify to get result like: 1 | 2012-09-01 | 14 **0 | 2012-09-01 | 15** 11 | 2012-09-01 | 16 1 | 2012-09-01 | 17

    Read the article

  • jQuery load to multiple divs

    - by afcdesign
    I have this code $("body").on({ click: function(event){ event.preventDefault(); var aLink = $(this).attr("href"); $("#content").load(aLink+" #loader", function(){ //Callback here }); $("#crumbbar").load(aLink+' .breadcrumbs', function(){ //Callback here }); } }, "a"); Can this be optimized in such a way that I only have 1 load command?

    Read the article

  • How can I select a value matching my input from a TypeAhead control using WWW::Mechanize?

    - by kyoob
    So ordinarily the element I want to pick from a list would be populated on a page and I'd just find it and pick it. But I'm dealing with a control that doesn't populate list elements until some input has been stuck into a text box, after which it gives me a list of recommendations. For an example of the kind of list I'm talking about think of Facebook's "People, Places, and Things" search field. I want to plug a string into this text box, select the same string from the list of recommendations, and submit the form. The issue I'm having right now is I can't seem to get Mechanize to even recognize the field is there. I examine a dump of $mech->find_all_inputs and it isn't listed. Is this kind of field just beyond Mechanize's jurisdiction?

    Read the article

  • why is `vapply` safer than `sapply`?

    - by flodel
    The documentation says vapply is similar to sapply, but has a pre-specified type of return value, so it can be safer [...] to use. Could you please elaborate as to why it is generally safer, maybe provide examples? P.S.: I know the answer and I already tend to avoid sapply. I just wish there was a nice answer here on SO so I can point my coworkers to it. Please, no "read the manual" answer.

    Read the article

  • When is it possible to override top-level bindings in (R7RS) scheme?

    - by Marc
    I have read the current draft of the forthcoming R7RS scheme standard (small language), but I don't understand under which conditions it is not an error to redefine top-level bindings. I guess that it is possible to define or set! a binding that has been introduced at the top-level of a program a second time. But what about imported bindings from an external library? Is it possible to override these bindings by the standard? On page 26/27 of the report, it says: The top level of a program may also include import declarations. In a library declaration, it is an error to import the same identifier more than once with different bindings, or to redefine or mutate an imported binding with define, define-syntax or set!. However, a REPL should permit these actions. Does it mean that redefining is only an error when it does happen in libraries for imported bindings? I understand that it prohibits optimisations by compilers if the compiler does not know whether, say + still means the built-in addition or is any other user-specified error. But from this perspective, it does not make sense to restrict forbidding to rebind on the library level, when it would also make sense (at least) for imported bindings in programs. P.S.: As this is all about the environment of a scheme program: am I right in saying that environments are not first class citizens because one cannot get hold of the current environment? (Which, in turn, allows a compiled program to forget about the chosen names of the bindings.)

    Read the article

  • Sending data back to Controller Spring-MVC

    - by Umesh Awasthi
    I am not sure if this is a complex problem but as a starting person this seems a bit complex to me. I have an object based on which i need to show some values on the UI and let user select some of them, i need to send data back to another controller when user click on the submit button.Here is the structure of my data object public class PrsData{ private Map<String, List<PrsCDData>> prsCDData; } public class PrsCDData{ private Map<String, Collection<ConfiguredDesignData>> configuredDesignData; } public ConfiguredDesignData{ // simple fields } I have set the object in model before showing the view like model.addAttribute("prsData", productData.getPrData()); In the form i have following settings <form:form method="post" commandName="prsData" action="${addProductToCartAction}" > <form:hidden path="prsCDData['${prsCDDataMap.key}'] [${status.index}].configuredDesignData['${configuredDesignDataMap.key}'] [${configuredDesignDataStatus.index}].code"/> <form:hidden path="prsCDData['${prsCDDataMap.key}'] [${status.index}].configuredDesignData['${configuredDesignDataMap.key}'] [${configuredDesignDataStatus.index}].description"/> </form:form> This is what i have at AddProductToCartController public String addToCart(@RequestParam("productCodePost") final String code, @ModelAttribute("prsData") final PrsData prsData, final Model model, @RequestParam(value = "qty", required = false, defaultValue = "1") final long qty) On submitting the form i am getting following exception org.springframework.beans.NullValueInNestedPathException: Invalid property 'prsCDData[Forced][0]' of bean class [com.product.data.PrsData]: Cannot access indexed value of property referenced in indexed property path 'prsCDData[Forced][0]': returned null It seems like its trying to access the values on this controller while i am trying to send value to that controller and trying to create same object with selected values Can any one tell me where i am doing wrong and what i need to take care of

    Read the article

  • ASP.NET MVC: post-redirect-get pattern, with only two overloaded action methods

    - by Rafi
    Is it possible to implement post-redirect-get pattern, with two overloaded action methods(One for GET action and the other for POST action) in ASP.NET MVC. In all of the MVC post-redirect-get pattern samples, I have seen three different action methods for the post-redirect-get process, each having different names. Is this really required? For Eg:(Does the code shown below, follows Post-Redirect-Get pattern?) public class SalaryTransferController : Controller { // // GET: /SalaryTransfer/ [HttpGet] public ActionResult Index(int id) { SalaryTransferIndexViewModel vm = new SalaryTransferIndexViewModel(id) { SelectedDivision = DivisionEnum.Contracting }; //Do some processing here return View(vm); } // // POST: /SalaryTransfer/ [HttpPost] public ActionResult Index(SalaryTransferIndexViewModel vm) { bool validationsuccess = false; //validate if (validationsuccess) return RedirectToAction("Index", new {id=1234 }); else return View(vm); } } Thank you for your responses.

    Read the article

  • .NET WebAPI Serialization k_BackingField Nastiness

    - by Micah
    When i serialize the following: [Serializable] public class Error { public string Status { get; set; } public string Message { get; set; } public string ErrorReferenceCode { get; set; } public List<FriendlyError> Errors { get; set; } } I get this disgusting mess: <ErrorRootOfstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Printmee.Api"> <_x003C_Errors_x003E_k__BackingField> An exception has occurred. Please contact printmee support </_x003C_Errors_x003E_k__BackingField> <_x003C_LookupCode_x003E_k__BackingField>988232ec-6bc9-48f3-8116-7ff7c71302dd</_x003C_LookupCode_x003E_k__BackingField> </ErrorRootOfstring> What gives? How can i make this pretty? JSON responses also contain the k_BackingField

    Read the article

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