Daily Archives

Articles indexed Friday November 16 2012

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

  • using apple-mobile-web-app-capable and cache.manifest issue [migrated]

    - by LocoMike
    So I have this simple html file <!DOCTYPE HTML> <html manifest="cache.manifest"><head> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <title>Test</title> <meta http-equiv="content-type" content="text/html"> <meta name="HandheldFriendly" content="true"> <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <style type="text/css"></style></head> <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <h1>hello</h1> </body> </html> My cache.manifest is simply CACHE MANIFEST I run this website on my local server (localhost). I load it from iphone safari and it works fine. I then stop the server and load it again, and it works, because the offline cache is doing its job. However... if I save the website as a start icon in the iphone dashboard, and then I try to open it with the server stopped it won't load. However... if I open it with the server running at least once (it will work) then I can open it later without problem. It looks like even though the page was cached in safari, it is not cached in this saved app. Anybody knows how to get around this? Thank you!

    Read the article

  • Deformation of Sphere using Transformations

    - by Mert Toka
    I have a graphic related question. I need to have a transformation matrix that I have no idea about what it is. The problem is to create right image from the right sphere. I created those images in Maya, but I need some matrices for the graphics course. Here is the image: Our professor told us to use some sine and cosine in our transformations, but I have no idea what he meant. I thought of intersecting a plane from the grid(that is xz plane) and sphere, and then scaling down the resulting circle. Would that work? I also checked this paper, however it looks like a bit advanced for me. Another thing is I guess that paper is not about the same type of information I was looking for. It would be great if you could help me.

    Read the article

  • How to shift a vector based on the rotation of another vector?

    - by bpierre
    I’m learning 2D programming, so excuse my approximations, and please, don’t hesitate to correct me. I am just trying to fire a bullet from a player. I’m using HTML canvas (top left origin). Here is a representation of my problem: The black vector represent the position of the player (the grey square). The green vector represent its direction. The red disc represents the target. The red vector represents the direction of a bullet, which will move in the direction of the target (red and dotted line). The blue cross represents the point from where I really want to fire the bullet (and the blue and dotted line represents its movement). This is how I draw the player (this is the player object. Position, direction and dimensions are 2D vectors): ctx.save(); ctx.translate(this.position.x, this.position.y); ctx.rotate(this.direction.getAngle()); ctx.drawImage(this.image, Math.round(-this.dimensions.x/2), Math.round(-this.dimensions.y/2), this.dimensions.x, this.dimensions.y); ctx.restore(); This is how I instanciate a new bullet: var bulletPosition = playerPosition.clone(); // Copy of the player position var bulletDirection = Vector2D.substract(targetPosition, playerPosition).normalize(); // Difference between the player and the target, normalized new Bullet(bulletPosition, bulletDirection); This is how I move the bullet (this is the bullet object): var speed = 5; this.position.add(Vector2D.multiply(this.direction, speed)); And this is how I draw the bullet (this is the bullet object): ctx.save(); ctx.translate(this.position.x, this.position.y); ctx.rotate(this.direction.getAngle()); ctx.fillRect(0, 0, 3, 3); ctx.restore(); How can I change the direction and position vectors of the bullet to ensure it is on the blue dotted line? I think I should represent the shift with a vector, but I can’t see how to use it.

    Read the article

  • Nifty default controls prevent the rest of my game from rendering

    - by zergylord
    I've been trying to add a basic HUD to my 2D LWJGL game using nifty gui, and while I've been successful in rendering panels and static text on top of the game, using the built-in nifty controls (e.g. an editable text field) causes the rest of my game to not render. The strange part is that I don't even have to render the gui control, merely declaring it appears to cause this problem. I'm truly lost here, so even the vaguest glimmer of hope would be appreciated :-) Some code showing the basic layout of the problem: display setup: // load default styles nifty.loadStyleFile("nifty-default-styles.xml"); // load standard controls nifty.loadControlFile("nifty-default-controls.xml"); screen = new ScreenBuilder("start") {{ layer(new LayerBuilder("baseLayer") {{ childLayoutHorizontal(); //next line causes the problem control(new TextFieldBuilder("input","asdf") {{ width("200px"); }}); }}); }}.build(nifty); nifty.gotoScreen("start"); rendering glMatrixMode(GL_PROJECTION); glLoadIdentity(); GLU.gluOrtho2D(0f,WINDOW_DIMENSIONS[0],WINDOW_DIMENSIONS[1],0f); //I can remove the 2 nifty lines, and the game still won't render nifty.render(true); nifty.update(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); GLU.gluOrtho2D(0f,(float)VIEWPORT_DIMENSIONS[0],0f,(float)VIEWPORT_DIMENSIONS[1]); glTranslatef(translation[0],translation[1],0); for (Bubble bubble:bubbles){ bubble.draw(); } for (Wall wall:walls){ wall.draw(); } for(Missile missile:missiles){ missile.draw(); } for(Mob mob:mobs){ mob.draw(); } agent.draw();

    Read the article

  • Bitmap rotation jitter around pivot

    - by Manderin87
    I am working on a asteriods clone and I have the ship graphic loaded as a 96x96 bitmap. When the player rotates the ship I rotate the bitmap by degree (float). rotation function: if(m_Matrix == null) { m_Matrix = new Matrix(); } else { m_Matrix.reset(); } m_Matrix.setRotate(degree, m_BaseImage.getWidth() / 2, m_BaseImage.getHeight() / 2); m_RotatedImage = Bitmap.createBitmap(m_BaseImage, 0, 0, m_BaseImage.getWidth(), m_BaseImage.getHeight(), m_Matrix, true); draw function: m_Paint.setAntiAlias(true); m_Paint.setFilterBitmap(true); m_Paint.setDither(true); canvas.drawBitmap(m_RotatedImage, (int) posX - m_RotatedImage.getWidth() / 2, (int) posY - m_RotatedImage.getHeight() / 2, m_Paint); When the bitmap is drawn, the bitmap jitters slightly around the pivot. Can anyone fix or tell me why the bitmap is jittering around the pivot? It needs to be smooth.

    Read the article

  • Accessing multiple view controllers in page controller

    - by Apple Delegates
    I am showing view in ipad like a book, single view shows two view. I want to add more views so that when view flipped third and fourth view appears and further. I am using the code below to do so. I am adding ViewControllers to array it got kill at orientation method at this line " ContentViewController *currentViewController = [self.pageViewController.viewControllers objectAtIndex:0];". - (void)viewDidLoad { [super viewDidLoad]; //Instantiate the model array self.modelArray = [[NSMutableArray alloc] init]; for (int index = 1; index <= 12 ; index++) { [self.modelArray addObject:[NSString stringWithFormat:@"Page %d",index]]; } //Step 1 //Instantiate the UIPageViewController. self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; //Step 2: //Assign the delegate and datasource as self. self.pageViewController.delegate = self; self.pageViewController.dataSource = self; //Step 3: //Set the initial view controllers. ViewOne *one = [[ViewOne alloc]initWithNibName:@"ViewOne" bundle:nil]; viewTwo *two = [[viewTwo alloc]initWithNibName:@"ViewTwo" bundle:nil]; ContentViewController *contentViewController = [[ContentViewController alloc] initWithNibName:@"ContentViewController" bundle:nil]; contentViewController.labelContents = [self.modelArray objectAtIndex:0]; // NSArray *viewControllers = [NSArray arrayWithObject:contentViewController]; viewControllers = [NSArray arrayWithObjects:contentViewController,one,two,nil]; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; //Step 4: //ViewController containment steps //Add the pageViewController as the childViewController [self addChildViewController:self.pageViewController]; //Add the view of the pageViewController to the current view [self.view addSubview:self.pageViewController.view]; //Call didMoveToParentViewController: of the childViewController, the UIPageViewController instance in our case. [self.pageViewController didMoveToParentViewController:self]; //Step 5: // set the pageViewController's frame as an inset rect. CGRect pageViewRect = self.view.bounds; pageViewRect = CGRectInset(pageViewRect, 40.0, 40.0); self.pageViewController.view.frame = pageViewRect; //Step 6: //Assign the gestureRecognizers property of our pageViewController to our view's gestureRecognizers property. self.view.gestureRecognizers = self.pageViewController.gestureRecognizers; } - (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation { if(UIInterfaceOrientationIsPortrait(orientation)) { //Set the array with only 1 view controller UIViewController *currentViewController = [self.pageViewController.viewControllers objectAtIndex:0]; NSArray *viewControllers = [NSArray arrayWithObject:currentViewController]; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:NULL]; //Important- Set the doubleSided property to NO. self.pageViewController.doubleSided = NO; //Return the spine location return UIPageViewControllerSpineLocationMin; } else { // NSArray *viewControllers = nil; ContentViewController *currentViewController = [self.pageViewController.viewControllers objectAtIndex:0]; NSUInteger currentIndex = [self.modelArray indexOfObject:[(ContentViewController *)currentViewController labelContents]]; if(currentIndex == 0 || currentIndex %2 == 0) { UIViewController *nextViewController = [self pageViewController:self.pageViewController viewControllerAfterViewController:currentViewController]; viewControllers = [NSArray arrayWithObjects:currentViewController, nextViewController, nil]; } else { UIViewController *previousViewController = [self pageViewController:self.pageViewController viewControllerBeforeViewController:currentViewController]; viewControllers = [NSArray arrayWithObjects:previousViewController, currentViewController, nil]; } //Now, set the viewControllers property of UIPageViewController [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:NULL]; return UIPageViewControllerSpineLocationMid; } }

    Read the article

  • c# combobox autocomplete like method

    - by Willem T
    Ihave been looking for an LIKE autocompletion mode. can anyone help me with this. When i enter a text in the combobox, the database should be asked for the data. all that goes well. But then i want my combobox to behave like the Suggest mode, but it doesn't work. I Tried this: cursorPosition = txtNaam.SelectionStart; string query = "SELECT bedr_naam FROM tblbedrijf WHERE bedr_naam LIKE '%" + txtNaam.Text + "%'"; DataTable table = Global.db.Select(query); txtNaam.Items.Clear(); for (int i = 0; i < table.Rows.Count; i++) { txtNaam.Items.Add(table.Rows[i][0].ToString()); } Cursor.Current = Cursors.Default; txtNaam.Select(cursorPosition, 0); But the behavior that this function creates is off it doesnt work like the suggest mode its a bit buggy. Can anyone help me to get it working properly Thanks

    Read the article

  • Using OAuth along with spring security, grails

    - by GroovyUser
    I have grails app which runs on the spring security plugin. It works with no problem. I wish I could give the users the way to connect with Facebook and social networking site. So I decided to use Spring Security OAuth plugin. I have configured the plugin. Now I want user can access both via normal local account and also the OAuth authentication. More precisely I have a controller like this: @Secured(['IS_AUTHENTICATED_FULLY']) def test() { render "Home page!!!" } Now I want this controller to be accessed with OAuth authentication too. Is that possible to do so?

    Read the article

  • Submit POST form from url

    - by Martijn Van Mierloo
    Website: www.example.com <form method="POSt" action="" > <input type="hidden" name="test1" value="test11" /> <input type="hidden" name="test2" value="" /> <input type="hidden" name="test3" value="test33" /> <input type="submit" value="Submit"> </form> I want to sumbit this form with adding the correct parameters in the URL. With GET, I can simply use : http://ww.example.com/?test1=test11&test2=&test3=test33 and the form will be sumbitted. Can I do the same for a POST? If so, how? Thanks

    Read the article

  • how to compute differences between two binaries (i.e., two executables) in linux

    - by Indranil
    In Linux is there any way to compute the differences between two binaries (i.e., two executables)? Let me be more specific: I want to know how to compute the delta (delta difference) between two versions of an executable or application or software in Linux. For example if I have to download and install only the updated part (the delta difference between the latest version and the old version) of an existing application or binary how do I do that in Linux.

    Read the article

  • ajaxSubmit options success & error functions aren't fired

    - by Thommy Tomka
    jQuery 1.7.2 jQuery Validate 1.1.0 jQuery Form 3.18 Wordpress 3.4.2 I am trying to code a contact/ mail form in above environment/ with above jQuery libs. Now I am having a problem with the jQuery Form JS: I have taken the original code from the developers page for ajaxSubmit and only altered the target option to an ID which exists in my HTML source and replaced $ with jQuery in function showRequest. The problem is, that the function namend after success: does not fire. I tried the same with error: and again nothing fired. Only complete: did and the function I placed there alerted the responseText from the receiving script. Does anyone has an idea whats going wrong? Thanks in advance! Thomas jQuery(document).ready(function() { var options = { target: '#mail-status', // target element(s) to be updated with server response beforeSubmit: showRequest, // pre-submit callback success: showResponse, // post-submit callback // other available options: //url: url // override for form's 'action' attribute //type: type // 'get' or 'post', override for form's 'method' attribute //dataType: null // 'xml', 'script', or 'json' (expected server response type) //clearForm: true // clear all form fields after successful submit //resetForm: true // reset the form after successful submit // $.ajax options can be used here too, for example: //timeout: 3000 }; jQuery("#mailform").validate( { submitHandler: function(form) { jQuery(form).ajaxSubmit(options); }, errorPlacement: function(error, element) { }, rules: { author: { minlength: 2, required: true }, email: { required: true, email: true }, comment: { minlength: 2, required: true } }, highlight: function(element) { jQuery(element).addClass("e"); jQuery(element.form).find("label[for=" + element.id + "]").addClass("e"); }, unhighlight: function(element) { jQuery(element).removeClass("e"); jQuery(element.form).find("label[for=" + element.id + "]").removeClass("e"); } }); }); // pre-submit callback function showRequest(formData, jqForm, options) { // formData is an array; here we use $.param to convert it to a string to display it // but the form plugin does this for you automatically when it submits the data var queryString = jQuery.param(formData); // jqForm is a jQuery object encapsulating the form element. To access the // DOM element for the form do this: // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); // here we could return false to prevent the form from being submitted; // returning anything other than false will allow the form submit to continue return true; } // post-submit callback function showResponse(responseText, statusText, xhr, $form) { // for normal html responses, the first argument to the success callback // is the XMLHttpRequest object's responseText property // if the ajaxSubmit method was passed an Options Object with the dataType // property set to 'xml' then the first argument to the success callback // is the XMLHttpRequest object's responseXML property // if the ajaxSubmit method was passed an Options Object with the dataType // property set to 'json' then the first argument to the success callback // is the json data object returned by the server alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); }

    Read the article

  • jQuery slider onChange auto submit form

    - by bikey77
    I'm using a jQuery slider as a price range selector in a form. I'd like to have the form submit automatically when one of the values has been changed. I used a couple of examples I found on SO but they didn't work with my code. <form action="itemlist.php" method="post" enctype="application/x-www-form-urlencoded" name="priceform" id="priceform" target="_self"> <div id="slider-holder"> Prices: From <span id="pricefromlabel">100 &#8364;</span> To <span id="pricetolabel">500 &#8364;</span> <input type="hidden" id="pricefrom" name="pricefrom" value="100" /> <input type="hidden" id="priceto" name="priceto" value="500" /> <div id="slider-range"></div> <input name="Search" type="submit" value="Search" /> </div> </form> This is the code that displays the values of the slider and updates 2 hidden form fields I use to store the prices in order to submit: <script> $(function() { $("#slider-range" ).slider({ range: true, min: 0, max: 1000, values: [ <?=$minprice?>, <?=$maxprice?> ], start: function (event, ui) { event.stopPropagation(); }, slide: function( event, ui ) { $( "#pricefrom" ).val(ui.values[0]); $( "#priceto" ).val(ui.values[1]); $( "#pricefromlabel" ).html(ui.values[0] + ' &euro;'); $( "#pricetolabel" ).html(ui.values[1] + ' &euro;'); } }); return false; }); </script> I've tried adding this code as well as an data-autosubmit="true" attribute to the div but no result. $(function() { $('[data-autosubmit="true"]').change(function() { parentForm = $(this).('#priceform'); clearTimeout(submitTimeout); submitTimeout = setTimeout(function() { parentForm.submit() }, 100); }); I've also tried adding a $.post() event to the slider but I'm not very good with jQuery so I'm probably doing it wrong. Any help will be appreciated.

    Read the article

  • What is the best way of inserting a datetime value using dynamic sql

    - by jaffa
    What is the best way of inserting a datetime value using a dynamic sql string, whilst at the same time being able to handle the possibility of the value being null? The current statement inserts into a table from a select statement built using a string. The datetime value is stored in a parameter and the parameter is used in the select. Like so: set @execsql = 'Insert into ( start_date ) SELECT ( ''' + CAST(start_date as VARCHAR) + ''' + ')'

    Read the article

  • Putting curly braces in a sentences for specific words according to their start and end indexes

    - by Suneeta Singh
    I need to put curly braces in a sentence according to the indexes. Suppose my input sentence is: "I am a girl and I live in Nepal." and I need to put curly braces according to [12, 15], [2, 4], [23, 25] These indexes are corresponding to the words "am", "and" and "in" respectively. The required output should be: "I {am} a girl {and} I live {in} Nepal." I have tried using substring but after it replaces first word, it then shifts the characters by two indexes and that is the problem I am having. Can anyone provide me solution to get the required output?

    Read the article

  • Margin for select option in IE and chrome is not working

    - by Sardor
    I am setting a css class to some select options in JS. This class includes margin style. It is working in the FF but not in IE and chrome. window.onload = function() { replace('edit-field-region-tid'); replace('edit-tid'); } function replace(id) { var i = 0; var s = document.getElementById(id); for (i; i < s.options.length; i++) { if (find(s.options[i].text, id, i)) { s.options[i].setAttribute("class", "sub_options"); } } } function find(str, id, option_id) { var i; var s = document.getElementById(id); for (i = 0; i < str.length; i++) { if (str.charAt(i) == '-') { s.options[option_id].text = str.cutAt(0, ""); return true; } } return false; } String.prototype.cutAt = function(index, char) { return this.substr(index+1, this.length); } And CSS: .sub_options{ margin-left:20px; text-indent:-2px; } Any ideas thanks!

    Read the article

  • Maven + Java package declaration

    - by Vasan
    We have a Maven project (packaged as JAR) with Java files. A new Java source file was recently added to this project. The path in which the Java file was added, does not match its package declaration. As expected, Eclipse shows an error in the class for the mismatch. However, Maven builds the project just fine. In the generated JAR file, the .class file is present in the path indicated by the package declaration. We tried moving the Java source file to other incorrect folders (i.e. different from the package declaration), but every time Maven builds the project fine. So, does Maven ignore the actual directory in which the .java file is present? Does it only consider package declaration?

    Read the article

  • grep from a log file to get count

    - by subodh1989
    I have to get certain count from files. The grep statement i am using is like this : counter_pstn=0 completed_count_pstn=0 rec=0 for rec in `(grep "merged" update_completed*.log | awk '{print $1}' | sed 's/ //g' | cut -d':' -f2)` do if [ $counter_pstn -eq 0 ] then completed_count_pstn=$rec else completed_count_pstn=$(($completed_count_pstn+$rec)) fi counter_pstn=$(($counter_pstn+1)) done echo "Completed Orders PSTN Primary " $completed_count_pstn But the log file contains data in this format : 2500 rows merged. 2500 rows merged. 2500 rows merged. 2500 rows merged.2500 rows merged. 2500 rows merged. 2500 rows merged. As a result , it is missing out the count of one merge(eg on line 4 of output).How do i modify the grep or use another function to get the count. NOTE that the 2500 number maybe for different logs. So we have to use "rows merged" pattern to get the count. i have tried -o ,-w grep options,but it is not working. Expected output from above data: 17500 Actual output showing : 15000

    Read the article

  • expected identifier or '(' before '{' token in Flex

    - by user1829177
    I am trying to use Flex to parse 'C' source code. Unfortunately I am getting the error "expected identifier or '(' before '{' token" on lines 1,12,13,14... . Any ideas why? %{ %} digit [0-9] letter [a-zA-Z] number (digit)+ id (letter|_)(letter|digit|_)* integer (int) character (char) comma [,] %% {integer} {return INT;} {character} {return CHAR;} {number} {return NUM;} {id} {return IDENTIFIER;} {comma} {return ',';} [-+*/] {return *yytext;} . {} %% main() { yylex(); } The corresponding flex file is as shown below: %{ #include <ctype.h> #include <stdio.h> #include "myhead.h" #include "mini.l" #define YYSTYPE double # undef fprintf %} %token INT %token CHAR %token IDENTIFIER %token NUM %token ',' %left '+' '-' %left '*' '/' %right UMINUS %% lines:lines expr '\n' {printf("%g\n",$2);} |lines '\n' |D | ; expr :expr '*' expr {$$=$1*$3;} |expr '/' expr {$$=$1/$3;} |expr '+' expr {$$=$1+$3;} |expr '-' expr {$$=$1+$3;} |'(' expr ')' {$$=$2;} |'-' expr %prec UMINUS {$$=-$2;} |IDENTIFIER {} |NUM {} ; T :INT {} |CHAR {} ; L :L ',' IDENTIFIER {} |IDENTIFIER {} ; D :T L {printf("T is %g, L is %g",$1,$2);} ; %% /*void yyerror (char *s) { fprintf (stderr, "%s\n", s); } */ I am compiling the generated code using the command: gcc my_file.c -ly

    Read the article

  • Mysql query, need suggestion or solution

    - by Xi Kam
    Can anyone help me, i have two tables and i need records from both the table //////////////////////////////++ Query 1 ++//////////////////////////////////// SELECT SUM(rec_issued) AS issed, regen_id, YEAR(issue_date) AS iYear, MONTH(issue_date) AS iMonth FROM `view_rec_issued` WHERE `regen_id` = 2 GROUP BY YEAR(issue_date) DESC, MONTH(issue_date) DESC ORDER BY issue_date ASC issed regen_id iYear iMonth 424 2 2011 3 4340 2 2011 4 4235 2 2011 5 10570 2 2012 2 4761 2 2012 3 5000 2 2012 4 3700 2 2012 5 3414 2 2012 6 3700 2 2012 7 2992 2 2012 8 995 2 2012 10 ![Result from Query 1][1] //////////////////////////////++ Query 2 ++//////////////////////////////////// SELECT SUM(total_redem) AS redemed, regen_id, YEAR(redemption_date) AS rYear, MONTH(redemption_date) AS rMonth FROM `recredem_month_wise` WHERE `regen_id` = 2 GROUP BY YEAR(redemption_date) DESC, MONTH(redemption_date) DESC order by redemption_date ASC redemed regen_id rYear rMonth 424 2 2011 3 260 2 2011 4 6523 2 2011 5 1070 2 2011 6 200 2 2011 10 500 2 2011 11 9750 2 2012 2 5000 2 2012 3 5500 2 2012 4 3803 2 2012 5 3700 2 2012 7 3000 2 2012 8 ![Result from Query 2][2] But i want it as - issed regen_id iYear iMonth redemed regen_id rYear rMonth 424 2 2011 3 424 2 2011 3 4340 2 2011 4 260 2 2011 4 4235 2 2011 5 6523 2 2011 5 NULL NULL NULL NULL 1070 2 2011 6 NULL NULL NULL NULL 200 2 2011 10 NULL NULL NULL NULL 500 2 2011 11 10570 2 2012 2 9750 2 2012 2 4761 2 2012 3 5000 2 2012 3 5000 2 2012 4 5500 2 2012 4 3700 2 2012 5 3803 2 2012 5 3414 2 2012 6 NULL NULL NULL NULL 3700 2 2012 7 3700 2 2012 7 2992 2 2012 8 3000 2 2012 8 995 2 2012 10 NULL NULL NULL NULL ![I want this output][3] In these table regen_id is unique and i need data as YEAR and MONTH, if in any table not have the records in perticular month and year it should retrieve zero or null. But in every record year and month should equal like this - iYear = rYear and iMonth = rMonth So we can merge both the fields - No need to show year and month twice iYear and rYear = year iMonth and rMonth = month Thank You Please look at this problem.

    Read the article

  • Password Protected Android App

    - by Caution Continues
    I wana make a security app and in case of stolen or lost my app must not be uninstalled without taking password. yes It is possible to make such an app that can take password before getting uninstall.. My friend Aditya Nikhade has made this app :) .But he is not giving me this secrete recipe:( Install this app Findroid from google Play. In this app first you need to unlock your app then only u can uninstall it. So please help me how to crack this technique.. I searched and got some incomplete answer in that we can declare a receiver of type PACKAGED_REMOVED but i want to know how can I stop if my app is being uninstalled. I am little close to solution of it. I am working/studying on Device Administrator. Please paste code snippet if anyone have. Thanks a Ton in advanced....!!!

    Read the article

  • DATE_FORMAT in DQL symfon2

    - by schurtertom
    I would like to use some MySQL functions such as DATE_FORMAT in my QueryBuilder. I saw this post did not understand totally how I should achieve it: SELECT DISTINCT YEAR Doctrine class SubmissionManuscriptRepository extends EntityRepository { public function findLayoutDoneSubmissions( $fromDate, $endDate, $journals ) { if( true === is_null($fromDate) ) return null; $commQB = $this->createQueryBuilder( 'c' ) ->join('c.submission_logs', 'k') ->select("DATE_FORMAT(k.log_date,'%Y-%m-%d')") ->addSelect('c.journal_id') ->addSelect('COUNT(c.journal_id) AS numArticles'); $commQB->where("k.hash_key = c.hash_key"); $commQB->andWhere("k.log_date >= '$fromDate'"); $commQB->andWhere("k.log_date <= '$endDate'"); if( $journals != null && is_array($journals) && count($journals)>0 ) $commQB->andWhere("c.journal_id in (" . implode(",", $journals) . ")"); $commQB->andWhere("k.new_status = '20'"); $commQB->orderBy("k.log_date", "ASC"); $commQB->groupBy("c.hash_key"); $commQB->addGroupBy("c.journal_id"); $commQB->addGroupBy("DATE_FORMAT(k.log_date,'%Y-%m-%d')"); return $commQB->getQuery()->getResult(); } } Entity SubmissionManuscript /** * MDPI\SusyBundle\Entity\SubmissionManuscript * * @ORM\Entity(repositoryClass="MDPI\SusyBundle\Repository\SubmissionManuscriptRepository") * @ORM\Table(name="submission_manuscript") * @ORM\HasLifecycleCallbacks() */ class SubmissionManuscript { ... /** * @ORM\OneToMany(targetEntity="SubmissionManuscriptLog", mappedBy="submission_manuscript") */ protected $submission_logs; ... } Entity SubmissionManuscriptLog /** * MDPI\SusyBundle\Entity\SubmissionManuscriptLog * * @ORM\Entity(repositoryClass="MDPI\SusyBundle\Repository\SubmissionManuscriptLogRepository") * @ORM\Table(name="submission_manuscript_log") * @ORM\HasLifecycleCallbacks() */ class SubmissionManuscriptLog { ... /** * @ORM\ManyToOne(targetEntity="SubmissionManuscript", inversedBy="submission_logs") * @ORM\JoinColumn(name="hash_key", referencedColumnName="hash_key") */ protected $submission_manuscript; ... } any help I would appreciate a lot. EDIT 1 I have now successfully be able to add the Custom Function DATE_FORMAT. But now if I try with my Group By I get the following Error: [Semantical Error] line 0, col 614 near '(k.logdate,'%Y-%m-%d')': Error: Cannot group by undefined identification variable. Anyone knows about this?

    Read the article

  • Execute a command using php under ssh2 in php

    - by Mervyn
    Using Mint terminal my script connects using ssh2_connect and ssh2_auth-password. When am logged in successfully I want to run a command which will give me the hardware cpu. Is there a way I can use to exec the command in my script then show the results. I have used system and exec for pinging. if i was in the terminal i do the login. then type "get hardware cpu" in the terminal it would look like this: Test~ $ get hardware cpu

    Read the article

  • Unique number generation with Java Server Faces

    - by Buddhika Ariyaratne
    I am developing an application for a medical channelling centre where multiple users reserve bookings for doctors with JSF and JPA. A sequence number is unique to the Doctor, Date and Session. I tried to get a unique sequence number from counting the previous bookings and add one, but if two requests comes at the same time, two bookings get the same number causing trouble to functionality. How can I get unique number in this case? Can I use an application wide bean to generate it? (I thought it is not practicle to get the unique number from the database sequence number as there are several doctors, sessions and daily they have to have different booking number.)

    Read the article

  • jQuery, ajax request doesn't success with JSON on IE

    - by sylouuu
    I made an AJAX call and it works on FF & Chrome but not on IE 7-8-9. I'm loading a JSON file from my domain: $.ajax({ url: 'js/jquery.desobbcode.json', dataType: 'json', cache: false, success: function(json) { alert('ok'); }, error: function(xhr, errorString, exception) { alert("xhr.status="+xhr.status+" error="+errorString+" exception="+exception); } }); I also tried by adding contentType: 'application/json' but I receive the same output which is : xhr.status=200 error=parsererror exception=SyntaxError Unterminated string constant I checked my JSON file with JSONLint and it's OK. I checked if there is an extra comma and the content is also trimmed. See my JSON file If I put dataType: 'text', I receive the OK alert but a debug popup too. Could you help me? Regards.

    Read the article

  • floating in list causes trouble in IE6 and IE7

    - by Thom
    I have a toggle list that causes trouble in old IE browsers, tried to fix it for couple of hours but I failed again and again. Please check out the jsfiddle code: http://jsfiddle.net/vny63/ structure is similar to this: <li class="toggle"> <a class="left" title="gallery">gallery</a> (English) <span class="right float_right">3</span> <ul style="display: none;"> <li class="space_left"> lot of stuff here </li> </ul> </li> It is working well in IE8 and Firefox3

    Read the article

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