Search Results

Search found 27 results on 2 pages for 'mansoor ashraf'.

Page 1/2 | 1 2  | Next Page >

  • Query to retrieve records by aplhabetic order, except for n predefined items which must be on top

    - by Ashraf Bashir
    I need to retrieve all records ordered alphabetically. Except for a predefined list of record's columns which their records should appear first in a given predefined order, then all other records should be sorted alphabetically based on the same column For instance, assume we have the following table which is called Names Lets assume the predefined list is ("Mathew", "Ashraf", "Jack"). I.e. these are the names of whom their records should be listed first as in the predefined order. So the desired query result should be: Which query could retrieve this custom order ? P.S, I'm using MySQL. Here's my trial based on comments' request: (SELECT * FROM Names WHERE Name in ('Mathew', 'Ashraf', 'Jack')) UNION (SELECT * FROM Names WHERE Name NOT IN ('Mathew', 'Ashraf', 'Jack') ORDER BY Name ASC); the first query result wasn't ordered as required.

    Read the article

  • Cannot Install Wine Windows platform loader both from Terminal and software Center

    - by Muhammad Mansoor
    I recently installed Ubuntu 13.04 on my PC. I want to install Microsoft Visual Studio 2010, so I tried to install WINE. I tried to install from the Terminal and from the Software Center. Both times, it failed in the middle of process. This is the error. W:Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/raring/main/source/Sources 404 Not Found W:Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/raring/restricted/source/Sources 404 Not Found E:Some index files failed to download. They have been ignored, or old ones used instead. How can I fix this?

    Read the article

  • Changes to myApp.js files are reverted back to normal when the project is build - Cocos2dx

    - by Mansoor
    I am trying to do some changes to my myApp.js file of coco2dx project for android in eclipse but I am not able to do it. I am actually trying to change the default background image of my app. But when I run my project all the changes goes back to before values For Eg: This is the default line wer we are setting our background image this.sprite = cc.Sprite.create("res/HelloWorld.png"); I am changing it to the following line: this.sprite = cc.Sprite.create("res/CloseNormal.png"); But when I run my project CloseNormal.png goes back to HelloWorld.png I am using: OS: Win7 Cocos2d Ver: cocos2dx 2.2.2 Why is this happening. Can anybody help me?

    Read the article

  • What is wrong with the following Fluent NHibernate Mapping ?

    - by ashraf
    Hi, I have 3 tables (Many to Many relationship) Resource {ResourceId, Description} Role {RoleId, Description} Permission {ResourceId, RoleId} I am trying to map above tables in fluent-nHibernate. This is what I am trying to do. var aResource = session.Get<Resource>(1); // 2 Roles associated (Role 1 and 2) var aRole = session.Get<Role>(1); aResource.Remove(aRole); // I try to delete just 1 role from permission. But the sql generated here is (which is wrong) Delete from Permission where ResourceId = 1 Insert into Permission (ResourceId, RoleId) values (1, 2); Instead of (right way) Delete from Permission where ResourceId = 1 and RoleId = 1 Why nHibernate behave like this? What wrong with the mapping? I even tried with Set instead of IList. Here is the full code. Entities public class Resource { public virtual string Description { get; set; } public virtual int ResourceId { get; set; } public virtual IList<Role> Roles { get; set; } public Resource() { Roles = new List<Role>(); } } public class Role { public virtual string Description { get; set; } public virtual int RoleId { get; set; } public virtual IList<Resource> Resources { get; set; } public Role() { Resources = new List<Resource>(); } } Mapping Here // Mapping .. public class ResourceMap : ClassMap<Resource> { public ResourceMap() { Id(x => x.ResourceId); Map(x => x.Description); HasManyToMany(x => x.Roles).Table("Permission"); } } public class RoleMap : ClassMap<Role> { public RoleMap() { Id(x => x.RoleId); Map(x => x.Description); HasManyToMany(x => x.Resources).Table("Permission"); } } Program static void Main(string[] args) { var factory = CreateSessionFactory(); using (var session = factory.OpenSession()) { using (var tran = session.BeginTransaction()) { var aResource = session.Get<Resource>(1); var aRole = session.Get<Role>(1); aResource.Remove(aRole); session.Save(a); session.Flush(); tran.Commit(); } } } private static ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008 .ConnectionString("server=(local);database=Store;Integrated Security=SSPI")) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>() .Conventions.Add<CustomForeignKeyConvention>()) .BuildSessionFactory(); } public class CustomForeignKeyConvention : ForeignKeyConvention { protected override string GetKeyName(FluentNHibernate.Member property, Type type) { return property == null ? type.Name + "Id" : property.Name + "Id"; } } Thanks, Ashraf.

    Read the article

  • Can TP-Link router make phone calls?

    - by Umair Ashraf
    I have a TP-Link router with DSL service provided by a local company which serves it over the landline phone. My landline cord is plugged into an ethernet router which is then plugged into TP-Link wireless router. I can access internet with this wireless router all over my home with all computers. Landline Cord [into] Ethernet Router [into] TP-Link Wireless Router [air] Computers I would add that landline cord is also into a phone device which I use to make calls and that's not cordless. Now I am accessing internet via WiFi on my laptop and want to ask if is this possible to make landline calls via this same computer I am surfing internet through? What I am asking it to a dial-up via TP-Link router that goes through landline. You see the landline cord is the actual data gateway and is also used to make calls. So it can simultaneously send Data and Voice over the same wire.

    Read the article

  • java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'editFo

    - by mansoor
    i am working with spring frame work. Problem is that on forgot password jsp page when i enter the right name or email address the funtion send a mail to the user. But i want when user not enter username or password the calling funtion at controoler return a exception called bind exception and return not in getSuccessView() but redirct at same page and print the Invalid user name or email id. the controller code is following public class EditForgotPasswordFormController extends AbstractBaseFormController{ UserManager userManager; @Override protected ModelAndView executeOnSubmit(ExtendedHttpServletRequest request, ExtendedHttpServletResponse response, Object command, BindException errors) throws Exception { EditForgotPassword e=(EditForgotPassword)command; String s = e.getUsernameOrEmail(); try{ userManager.getNewPassword(s); }catch(RuntimeException exp) { errors.reject("Invailid Username Or EmailId",s); return new ModelAndView("normal/profile/forgot_password"); } return new ModelAndView(getSuccessView()) .addObject("heading", "Please Check You Email") .addObject("message", "Your New Account Information Is sent To At Your Email Id. "); } public UserManager getUserManager() { return userManager; } public void setUserManager(UserManager userManager) { this.userManager = userManager; } } when i am not enter the name or email id the i want redirct at following as indicate above and print message on same jsp where from request is recived........

    Read the article

  • Algorithm Analysis tool for java

    - by Mansoor
    I am looking for an algorithm analysis tool for java that can calculate Big 0 of a function. Ideal I would like to make it part of my build process, along side of my other code metrics tool. Even after searching on google I am unable to find any opensource of commercial tool. Any suggestion would be welcome Thanks

    Read the article

  • Scala type conversion error, need help!

    - by Mansoor Ashraf
    Hello I am getting a weird error when trying to use a Java map in Scala. This is the snippet of code val value:Double = map.get(name) if (value eq null) map.put(name, time) else map.put(name, value + time) the map is defined as val map=new ConcurrentHashMap[String,Double] and this is the error I am getting error: type mismatch; found : Double required: ?{val eq: ?} Note that implicit conversions are not applicable because they are ambiguous: both method double2Double in object Predef of type (Double)java.lang.Double and method doubleWrapper in object Predef of type (Double)scala.runtime.RichDouble are possible conversion functions from Double to ?{val eq: ?} if (value eq null) map.put(name, time) I am new to Scala so I am having a hard time parsing the stacktrace. Any help would be appreciated

    Read the article

  • Dynamic validation in jquery

    - by mansoor
    $(document).ready(function(){ $('a[rel=addhint]').click(function(){ var html='<div><label>Hint</label>'; html+='<span class="input"><input type="text" size="30" class="text" name="hint"/><a href="#" rel="delhint">delete</a></span><br class="clear" /></div>'; $('div#hintTextContainer').append(html); bindDelHintAll(); return false; }); I want when a new text area include vadition of required field and max length will also apply on it.

    Read the article

  • Validation does not work when I use Validator.TryValidateObject.

    - by ashraf
    DataAnnotations does not work with buddy class. The following code always validate true. Why ? var isValid = Validator.TryValidateObject(new Customer(), Context, results, true); and here is the buddy class. public partial class Customer { public string Name { get; set; } public int Age { get; set; } } [MetadataType(typeof(CustomerMetaData))] public partial class Customer { public class CustomerMetaData { [Required(ErrorMessage = "You must supply a name for a customer.")] public string Name { get; set; } } } Here is another thread with same question., but no answer. link text

    Read the article

  • Error when updating BlackBerry JDE Plug-in for Eclipse (v5.0 Beta 3) ?

    - by Ashraf Bashir
    I tried to update Blackberry JDE plug-in for eclipse from v4.5 to v5.0 Beta 3. I followed the instructions in this page: http://na.blackberry.com/eng/developers/devbetasoftware/updatesite.jsp but unfortunately I got the following error while updating: An error occurred while collecting items to be installed. No repository found containing: net.rim.eide.feature.componentpack5.0.0/org.eclipse.update.feature/5.0.0.14 How this could be solved ? Any suggestions ?

    Read the article

  • Performance Hosting under WAS vs Host as Service?

    - by ashraf
    I have some performance issue when I host WCF service (net.tcp) under WAS (IIS 7). It is working fine when I host service under console application. The issue is WCF Become Slow After Being Idle For 15 Seconds and a solution. After applying Wenlong Dong workaround delay is gone, but it does not work in WAS (IIS 7). I tried to put "ThreadPoolTimeoutWorkaround.DoWorkaround()" in static AppInitialize() as suggested here, still no luck. Thanks

    Read the article

  • ios saving uilabel and uiimageview as uiimage

    - by Ashraf Hussein
    I'm trying to add text to an image bu adding a uilabel as subview to a uiimageview I already did that but I want to save them as an image I'm using render in context but it's not working here's my code UIImage * img = [UIImage imageNamed:@"IMG_1650.JPG"]; float x = (img.size.width/imageView.frame.size.width) * touchPoint.x; float y = (img.size.height/imageView.frame.size.height) * touchPoint.y; CGPoint tpoint = CGPointMake(x, y); UIFont *font = [UIFont boldSystemFontOfSize:30]; context = UIGraphicsGetCurrentContext(); UIGraphicsBeginImageContextWithOptions(img.size, YES, 0.0); [[UIColor redColor] set]; for (UIView * view in [imageView subviews]){ [view removeFromSuperview]; } UILabel * lbl = [[UILabel alloc]init]; [lbl setText:txt]; [lbl setBackgroundColor:[UIColor clearColor]]; CGSize sz = [txt sizeWithFont:lbl.font]; [lbl setFrame:CGRectMake(touchPoint.x, touchPoint.y, sz.width, sz.height)]; lbl.transform = CGAffineTransformMakeRotation( -M_PI/4 ); [imageView addSubview:lbl]; [imageView bringSubviewToFront:lbl]; [imageView setImage:img]; [imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; [lbl.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * nImg = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(nImg, nil, nil, nil); THX

    Read the article

  • Optimize code perfromance when odd/even threads are doing different things in CUDA

    - by Ashraf
    Hi all! I have two large vectors, I am trying to do some sort of element multiplication, where an even-numbered element in the first vector is multiplied by the next odd-numbered element in the second vector .... and where the odd-numbered element in the first vector is multiplied by the preceding even-numbered element in the second vector Ex. vector 1 is V1(1) V1(2) V1(3) V1(4) vector 2 is V2(1) V2(2) V2(3) V2(4) V1(1) * V2(2) V1(3) * V2(4) V1(2) * V2(1) V1(4) * V2(3) I have written a Cuda code to do this: (Pds has the elements of the first vector in shared memory, Nds the second Vector) //instead of using %2 .. i check for the first bit to decide if number is odd/even -- faster if ((tx & 0x0001) == 0x0000) Nds[tx+1] = Pds[tx] * Nds[tx+1]; else Nds[tx-1] = Pds[tx] * Nds[tx-1]; __syncthreads(); Is there anyway to further accelerate this code or avoid divergence .. Thanks

    Read the article

  • Macintosh XCode Sharing

    - by Umair Ashraf
    I got a macbook pro and I want to share it with some of my friend located at the other side of internet. He can use Internet. Now I want him to give access to my whole Macbook (XCode for most) so he can do developments at his location using my macbook. Now I need to ask is there a way we can both utilize the samme macbook having two virtual OS (one for me and one for him) without affecting each others' privacy? Is it possible to share the macbook across more than 1 user? I don't mean Remote Desktop like of thing in Windows.

    Read the article

  • What's wrong with this JAVA code for android?

    - by Umair Ashraf
    I have written this piece of code to break an image into 9 pieces and it gives me runtime error. There is no error in LogCat and I am stuck. The error comes at line 7 line from bottom (Bitmap.createBitmap(...);). public Bitmap[] getPieces(Bitmap bmp) { Bitmap[] bmps = new Bitmap[9]; int width = bmp.getWidth(); int height = bmp.getHeight(); int rows = 3; int cols = 3; int cellHeight = height / rows; int cellWidth = width / cols; int piece = 0; for (int x = 0; x <= width; x += cellWidth) { for (int y = 0; y <= height; y += cellHeight) { Bitmap b = Bitmap.createBitmap(bmp, x, y, cellWidth, cellHeight, null, false); bmps[piece] = b; piece++; } } return bmps; }

    Read the article

  • PHP Missing Function In Older Version

    - by Umair Ashraf
    My this PHP function converts a datetime string into more readable way to represent passed date and time. This is working perfect in PHP version 5.3.0 but on the server side it is PHP version 5.2.17 which lacks this function. Is there a way I can fix this efficiently? This is not only a function which needs this "diff" function but there are many more. public function ago($dt1) { $interval = date_create('now')->diff(date_create($dt1)); $suffix = ($interval->invert ? ' ago' : '-'); if ($v = $interval->y >= 1) return $this->pluralize($interval->y, 'year') . $suffix; if ($v = $interval->m >= 1) return $this->pluralize($interval->m, 'month') . $suffix; if ($v = $interval->d >= 1) return $this->pluralize($interval->d, 'day') . $suffix; if ($v = $interval->h >= 1) return $this->pluralize($interval->h, 'hour') . $suffix; if ($v = $interval->i >= 1) return $this->pluralize($interval->i, 'minute') . $suffix; return $this->pluralize($interval->s, 'second') . $suffix; }

    Read the article

1 2  | Next Page >