Daily Archives

Articles indexed Saturday November 3 2012

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

  • Reverting problems caused by checkinstall with gcc build

    - by slavik262
    I recently downloaded the GCC 4.6.2 source in order to play around a bit with C++11. Having been told about checkinstall and its usefulness in installing programs from source, I created a Debian package from the install using sudo checkinstall -D make install. Wanting to see how well the newly created package worked, I removed it using Synaptic Package Manager. As it turns out, the package checkinstall created from make install tried to remove every single file the installation process touched, including shared gcc libraries like /lib64/libgcc_s.so. Despite not being able to run a bunch of programs due to this missing dependency, I was able to restore my system back to normal by reinstalling the package from command line using dpkg. At this point I want to remove the package from the package manager since it's so dangerous, but not remove the installed files. I was looking around in /var/lib/dpkg and found that the package manager seems to be based on text files which list packages and such - can I just remove all mention of the package from the files in /var/lib/dpkg, or is there a safer way to go about this?

    Read the article

  • What does 'Lock Version' do?

    - by richzilla
    Having installed an experimental version of dropbox and installed in manually, i dont want the deb in synaptic to download any updates (as theyll over write the changes ive done manually i assume). Ive found the lock version option in synaptic, im assuming this stops a particular deb from downloading any new versions of itself? Also can i just unlock it again when the version from the deb catches up with the experimental version that i have installed? Am i correct or does it serve another function?

    Read the article

  • Global vs. Local Monthly Searches in Adwords keyword tool

    - by Gregory
    I'm trying to learn how to use a keyword tool in Adwords. Here's what I entered: Country- Russia Language-Russian Desktop and laptop devices And the keyword was ???? ? ??????? (tours to Israel in Russian Cyrillic letters) . As a broad match type... Now... the results that I got were: Global monthly: 60,500 Local monthly: 40,500 If I got it right..."Global monthly" means in this context : worldwide average monthly searches for this search term in ANY language in any Google search site (google.ru, google.com.ua, google.com, google.fr etc.). It's all nice, BUT... Then I made an query for tours to Israel in English in the US...And I got: Global monthly: 60,500 Local monthly: 27,100 That doesn't make any sense to me though! How come the total sum (the global) is actually a smaller number than a combined sum of just TWO countries??? (27,100+40,500=67,60060,500) By "any language" they mean a translation of the term into ANY possible language???Or maybe by "language" Google means the language of searchers' operating system? or their browsers' language?

    Read the article

  • What's the best way to version CSS and JS URLs?

    - by David Eyk
    As per Yahoo's much-ballyhooed Best Practices for Speeding Up Your Site, we serve up static content from a CDN using far-future cache expiration headers. Of course, we need to occasionally update these "static" files, so we currently add an infix version as part of the filename (based on the SHA1 sum of the file contents). Thus: styles.min.css Becomes: styles.min.abcd1234.css However, managing the versioned files can become tedious, and I was wondering if a GET argument notation might be cleaner and better: styles.min.css?v=abcd1234 Which do you use, and why? Are there browser- or proxy/cache-related considerations that I should consider?

    Read the article

  • Google Analytics - how to track clicks on a screen?

    - by milesmeow
    Can I track the click of every link, button, dropdown select, etc. on a screen and have it be tracked in Google Analytics? I want to create a page and collect data on which widget the users use most. What about AJAX stuff? What if you're using jQuery or Mootools...can you get the functions to register a fake URL with GA based on user interaction? I use to do this with Flash. Everytime you click a button, it can initiate a fake URL request. I would make urls such as ".../customize/eyes/" or ".../customize/nose", etc. Just wondering if I can do that with Javascript on the page. I've also posted at StackOverflow.

    Read the article

  • Whats the right program for me?

    - by andyphillips20
    I would like to learn C++ so I can get a job in the game industry, but there are so many options it a little confusing. I know most of you will say I should read up on C++ before attempting to program it but I learn best by doing things rather then reading. That being said I don't understand some of the thing suggested on other questions, because I've read a few trying to find whats right for me, so putting things in the simplest terms would be helpful. I've been making a couple of games 2d using gamemaker and if theres a C++ equivalent that would be perfect, but if not possible I would like an IDE that allows me to easily continue making 2d games, and is fairly simple to learn. Having a 2d sprite editor would be a nice plus but I can understand if its not every thing I want in one program

    Read the article

  • Best depth sorting method for a Top Down 2D game using a 3D physics engine

    - by Alic44
    I've spent many days googling this and still have issues with my game engine I'd like to ask about, which I haven't seen addressed before. I think the problem is that my game is an unusual combination of a completely 2D graphical approach using XNA's SpriteBatch, and a completely 3D engine (the amazing BEPU physics engine) with rotation mostly disabled. In essence, my question is similar to this one (the part about "faux 3D"), but the difference is that in my game, the player as well as every other creature is represented by 3D objects, and they can all jump, pick up other objects, and throw them around. What this means is that sorting by one value, such as a Z position (how far north/south a character is on the screen) won't work, because as soon as a smaller creature jumps on top of a larger creature, or a box, and walks backwards, the moment its z value is less than that other creature, it will appear to be behind the object it is actually standing on. I actually originally solved this problem by splitting every object in the game into physics boxes which MUST have a Y height equal to their Z depth. I then based the depth sorting value on the object's y position (how high it is off the ground) PLUS its z position (how far north or south it is on the screen). The problem with this approach is that it requires all moving objects in the game to be split graphically into chunks which match up with a physical box which has its y dimension equal to its z dimension. Which is stupid. So, I got inspired last night to rewrite with a fresh approach. My new method is a little more complex, but I think a little more sane: every object which needs to be sorted by depth in the game exposes the interface IDepthDrawable and is added to a list owned by the DepthDrawer object. IDepthDrawable contains: public interface IDepthDrawable { Rectangle Bounds { get; } //possibly change this to a class if struct copying of the xna Rectangle type becomes an issue DepthDrawShape DepthShape { get; } void Draw(SpriteBatch spriteBatch); } The Bounds Rectangle of each IDepthDrawable object represents the 2D Axis-Aligned Bounding Box it will take up when drawn to the screen. Anything that doesn't intersect the screen will be culled at this stage and the remaining on-screen IDepthDrawables will be Bounds tested for intersections with each other. This is where I get a little less sure of what I'm doing. Each group of collisions will be added to a list or other collection, and each list will sort itself based on its DepthShape property, which will have access to the object-to-be-drawn's physics information. For starting out, lets assume everything in the game is an axis aligned 3D Box shape. Boxes are pretty easy to sort. Something like: if (depthShape1.Back > depthShape2.Front) //if depthShape1 is in front of depthShape2. //depthShape1 goes on top. else if (depthShape1.Bottom > depthShape2.Top) //if depthShape1 is above depthShape2. //depthShape1 goes on top. //if neither of these are true, depthShape2 must be in front or above. So, by sorting draw order by several different factors from the physics engine, I believe I can get a really correct draw order. My question is, is this a good way of going about this, or is there some tried and true, tested way which is completely different and has somehow completely eluded me on the internets? And, if this does seem like a good way to remake my draw order sorting, what's the right sorting algorithm for reordering the Bounds Rectangle collision lists, and how do you deal with a Bounds Rectangle colliding with two different object which don't collide with eachother. I know these are solved problems, but I've only been programming for a year so any specific input here will be greatly appreciated. Thanks for reading this far, ye who made it -- sorry it was so long!

    Read the article

  • unity player doesnt support my ubuntu so i cant play battalstar gallactica [closed]

    - by jrwhite3230
    ive been trying to install the unity player that supports battlestar gallactica online at big point.com /but then it is saying that my system (ubuntu) is not supported isnt there a patch by now because the game has been on for years now and there has been many people that i know running ubuntu who has the same difficulty ! also is there another program that would work with ubuntu and battlestar gallactica online?? there has to be a fix or ill just have to uninstall ubuntu/which is my next question how do i do that ??where is the control panel that allows you to uninstall programs within ubunty thank you very much for any support or advice [email protected]

    Read the article

  • Index out of bounds, Java bukkit plugin

    - by Robby Duke
    I'm getting index out of bounds errors in my Bukkit plugin, and it's really beginning to piss me off... I for the life of me can't figure this issue out! Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 This is where I believe the code to be erroring... for(int i = 0; i <= staffOnline.size(); i++) { if(i == staffOnline.size()) { staffList = staffList + staffOnline.get(i); } else { staffList = staffList + staffOnline.get(i) + ", "; } }

    Read the article

  • How to choose cell to put entity in in an uniform grid used for broad phase collision detection?

    - by nathan
    I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes. Regarding the above specifications, i decided to use an uniform grid for space partitioning. The problem i have right know is how to efficiently choose in which cells an entity should be added. ATM i'm doing something like this: for (int x = 0; x < gridSize; x++) { for (int y = 0; y < gridSize; y++) { GridCell cell = grid[x][y]; cell.clear(); //remove the previously added entities for (int i = 0; i < entities.size(); i++) { Entity e = entities.get(i); if (cell.isEntityOverlap(e)) { cell.add(e); } } } } The isEntityOverlap is a simple method i added my GridCell class. public boolean isEntityOverlap(Shape s) { return cellArea.intersects(s); } Where cellArea is a Rectangle. cellArea = new Rectangle(x, y, CollisionGrid.CELL_SIZE, CollisionGrid.CELL_SIZE); It works but it's damn slow. What would be a fast way to know all the cells an entity overlaps? Note: by "it works" i mean, the entities are contained in the good cells over the time after movements etc.

    Read the article

  • Monster's AI in an Action-RPG

    - by Andrea Tucci
    I'm developing an action rpg with some University colleagues. We've gotton to the monsters' AI design and we would like to implement a sort of "utility-based AI" so we have a "thinker" that assigns a numeric value on all the monster's decisions and we choose the highest (or the most appropriate, depending on monster's iq) and assign it in the monster's collection of decisions (like a goal-driven design pattern) . One solution we found is to write a mathematical formula for each decision, with all the important parameters for evaluation (so for a spell-decision we might have mp,distance from player, player's hp etc). This formula also has coefficients representing some of monster's behaviour (in this way we can alterate formulas by changing coefficients). I've also read how "fuzzy logic" works; I was fascinated by it and by the many ways of expansion it has. I was wondering how we could use this technique to give our AI more semplicity, as in create evaluations with fuzzy rules such as IF player_far AND mp_high AND hp_high THEN very_Desiderable (for a spell having an high casting-time and consume high mp) and then 'defuzz' it. In this way it's also simple to create a monster behaviour by creating ad-hoc rules for every monster's IQ category. But is it correct using fuzzy logic in a game with many parameters like an rpg? Is there a way of merging these two techniques? Are there better AI design techniques for evaluating monster's chooses?

    Read the article

  • Loading sound in XNA without the Content Pipeline

    - by David Gouveia
    I'm working on a "Game Maker"-type of application for Windows where the user imports his own assets to be used in the game. I need to be able to load this content at runtime on the engine side. However I don't want the user to have to install anything more than the XNA runtime, so calling the content pipeline at runtime is out. For images I'm doing fine using Texture2D.FromStream. I've also noticed that XNA 4.0 added a FromStream method to the SoundEffect class but it only accepts PCM wave files. I'd like to support more than wave files though, at least MP3. Any recommendations? Perhaps some C# library that would do the decoding to PCM wave format.

    Read the article

  • Remove parent of matched locator

    - by Ilan
    Is there a way to locate a node based child properties? I need to run a web.config transform to remove the 2nd <dependentAssembly in the following: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <!-- Don't want to delete this one --> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> <!-- This is the one I want to delete --> <dependentAssembly> <assemblyIdentity name="Microsoft.VisualStudio.Enterprise.AspNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <codeBase version="11.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2011.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.AspNetHelper.DLL"/> </dependentAssembly> </assemblyBinding> </runtime> Finding the <assemblyIdentity is easy enough, but I need to delete the parent <dependentAssembly (and <codeBase). If there was a "xdt:Transform="RemoveParent" this would do the trick, but AFAIK there isn't. Alternatively if there was a Locator I could use on the <dependentAssembly which would match children, then that could work too.

    Read the article

  • malloc unable to assign memory + doesnt warn

    - by sraddhaj
    char *str=NULL; strsave(s,str,n+1); printf("%s",str-n); when I gdb debug this code I find that the str value is 0x0 which is null and also that my code is not catching this failed memory allocation , it doesnt execute str==NULL perror code ...Any idea void strsave(char *s,char *str,int n) { str=(char *)malloc(sizeof(char)* n); if(str==NULL) perror("failed to allocate memory"); while(*s) { *str++=*s++; } *str='\0'; }

    Read the article

  • Delete files from blobstore using file serving URL

    - by Arturo
    In my app (GWT on GAE) we are storing on our database the serving URL that is stored on blobstore. When user selects one of these files and clicks "delete", we need to delete the file from blobstore. This is our code, but it is not deleting the file at all: public void remove(String fileURL) { BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); String key = getBlobKeyFromURL(box.getImageURL()); BlobKey blobKey = new BlobKey(key); blobstoreService.delete(blobKey); } Where fileURL looks like this: http://lh6.ggpht.com/d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ And getBlobKeyFromURL() would return what is after the last "/", in this example: d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ Could you please advice? Thanks

    Read the article

  • How to get Distance Kilometer in android?

    - by user1787493
    i am very new to Google maps i want calculate the distance between two places in android .for that i get the two places lat and lag positions for that i write the following code: private double getDistance(double lat1, double lat2, double lon1, double lon2) { double dLat = Math.toRadians(lat2 - lat1); double dLon = Math.toRadians(lon2 - lon1); double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double temp = 6371 * c; temp=temp*0.621; return temp; } the above code cant give the accurate distance between two places .what is the another way to find distance please give me any suggestions thanks in advance....

    Read the article

  • java.lang.NoClassDefFoundError at Runtime Android Widget

    - by pxrb66
    I have a problem during runtime of my Android widget with Android 2.3.3 and older. When i install my widget on the screen, this error is printed : 11-03 10:26:31.127: E/AndroidRuntime(404): FATAL EXCEPTION: main 11-03 10:26:31.127: E/AndroidRuntime(404): java.lang.NoClassDefFoundError: com.app.myapp.StackWidgetService 11-03 10:26:31.127: E/AndroidRuntime(404): at com.app.myapp.StackWidgetProvider.onUpdate(StackWidgetProvider.java:229) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:61) 11-03 10:26:31.127: E/AndroidRuntime(404): at com.app.mobideals.StackWidgetProvider.onReceive(StackWidgetProvider.java:216) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.access$2400(ActivityThread.java:117) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.os.Handler.dispatchMessage(Handler.java:99) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.os.Looper.loop(Looper.java:123) 11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.main(ActivityThread.java:3683) 11-03 10:26:31.127: E/AndroidRuntime(404): at java.lang.reflect.Method.invokeNative(Native Method) 11-03 10:26:31.127: E/AndroidRuntime(404): at java.lang.reflect.Method.invoke(Method.java:507) 11-03 10:26:31.127: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 11-03 10:26:31.127: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 11-03 10:26:31.127: E/AndroidRuntime(404): at dalvik.system.NativeStart.main(Native Method) The problem is due to the fact that the compilator don't arrive to perform the link to the StackWidgetService class at this line in onUpdate method of StackWidgetProvider class : public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { // update each of the widgets with the remote adapter for (int i = 0; i < appWidgetIds.length; ++i) { // Here we setup the intent which points to the StackViewService which will // provide the views for this collection. Intent intent = new Intent(context, StackWidgetService.class); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]); The widget works well with other version of Android like 3.0, 4.0 etc... Please help me :)

    Read the article

  • Failing to add different items in combobox on dynamic radiobutton click

    - by Steven Wilson
    I am working on radiobuttons and combobox in my wpf App. Although I am a C++ developer, I recently moved to C#. My app deals with dynamic generation of the above mentioned components. Basically I have created 4 dynamic radiobuttons in my app and on clicking each, i should should add different items to my combobox. Here is the code: XAML: <ItemsControl ItemsSource="{Binding Children}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical" > <RadioButton Content="{Binding RadioBase}" Margin="0,10,0,0" IsChecked="{Binding BaseCheck}" GroupName="SlotGroup" Height="15" Width="80" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <ComboBox Visibility="{Binding IsRegisterItemsVisible}" ItemsSource="{Binding RegComboList}" SelectedItem="{Binding SelectedRegComboList, Mode=TwoWay}" SelectedIndex="0" /> FPGARadioWidgetViewModel Class: public ObservableCollection<FPGAViewModel> Children { get; set; } public FPGARadioWidgetViewModel() { Children = new ObservableCollection<FPGAViewModel>(); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x0", ID = 0 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x40", ID = 1 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x80", ID = 2 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0xc0", ID = 3 }); } FPGAViewModel Class: private bool sBaseCheck; public bool BaseCheck { get { return this.sBaseCheck; } set { this.sBaseCheck = value; AddComboItems(); this.OnPropertyChanged("BaseCheck"); } } private ObservableCollection<string> _RegComboList; public ObservableCollection<string> RegComboList { get { return _RegComboList; } set { _RegComboList = value; OnPropertyChanged("RegComboList"); } } private void AddComboItems() { int baseRegister = 0x40 * ID; ObservableCollection<string> combo = new ObservableCollection<string>(); for (int i = 0; i < 0x40; i++) { int reg = (i * 8) + baseRegister; combo[i] = "0x" + reg.ToString("X"); } RegComboList = new ObservableCollection<String>(combo); OnPropertyChanged("RegComboList"); } private bool isRegisterItemsVisible = false; public bool IsRegisterItemsVisible { get { return isRegisterItemsVisible; } set { isRegisterItemsVisible = value; OnPropertyChanged("IsRegisterItemsVisible"); OnPropertyChanged("RegComboList"); } } If you notice, on clicking a particular radiobutton, it should add items with different value in combobox based on ID. It has to be made sure that on clicking any radiobutton only the items of that should be added and previous content of combobox should be cleared. I am trying to do the same thing using my above code but nothing seems to appear in combobox when i debug. Please help :)

    Read the article

  • allow only distinct values in ComboBox

    - by Ravinder Gangadher
    In my project, I am trying to populate ComboBox from DataSet. I succeeded in populating but the values inside the ComboBox are not distinct (Because it just showing the values present in DataSet). I cant bind the ComboBox to DataSet because I am adding "Select" text at first of populating the values. Here is my code. ComboBox --> cmb DataSet --> ds DataSet Column Name --> value(string) cmb.Items.Clear(); cmb.Items.Add("Select"); for (int intCount = 0; intCount < ds.Tables[0].Rows.Count; intCount++) { cmb.Items.Add(ds.Tables[0].Rows[intCount][value].ToString()); } cmb.SelectedIndex = 0; My question is how to allow distinct values (or restrict duplicate values) inside the ComboBox.

    Read the article

  • SQL how to avoid duplicate insert in a table

    - by user1624531
    how to avoid duplicate insert in a table? I use below query to insert in to table: insert into RefundDetails(ID,StatusModified,RefundAmount,OrderNumber) select O.id,O.StatusModified,OI.RefundAmount,O.OrderNumber from Monsoon.dbo.[Order] as O WITH (NOLOCK) JOIN Monsoon.dbo.OrderItem as OI WITH (NOLOCK)on O.Id = OI.OrderId WHERE o.ID in (SELECT OrderID FROM Mon2QB.dbo.monQB_OrderActivityView WHERE ACTIVITYTYPE = 4 AND at BETWEEN '10/30/2012' AND '11/3/2012') AND (O.StatusModified < '11/3/2012')

    Read the article

  • Adding Column While Selecting Table in SQl

    - by kmkperumal
    My First Table is ProjectCustomFields CustomFieldId ProjectId CustomFieldName CustomFieldRequired CustomFieldDataType 69 1 User Name 1 0 72 1 City 1 0 74 1 Email 0 0 82 1 Salary 1 2 My Second Table is ProjectCustomFieldValues CustomFieldValueId ProjectId CustomFieldId CustomFieldValue RecordId 35 1 69 kaliya 1 36 1 72 Bangalore 1 37 1 74 [email protected] 1 41 1 69 Yohesh 2 42 1 72 Delhi 2 43 1 74 2 50 1 69 sss 3 51 1 72 Delhi 3 52 1 74 [email protected] 3 57 1 69 Sunil 4 58 1 72 Mumbai 4 59 1 74 [email protected] 4 60 1 82 20000 4 I tried Below Query Select M.CustomFieldName,N.CustomFieldValue,N.RecordId From (Select G.CustomFieldName,H.RecordId From (Select CustomFieldName From ProjectCustomFields Where ProjectId=1) G Cross Join (Select Distinct RecordId From ProjectCustomFieldValues) H) M Left Join (Select CustFiled.CustomFieldName,CustValue.CustomFieldValue,CustValue.RecordId From ProjectCustomFieldValues CustValue Left Join ProjectCustomFields CustFiled On CustValue.CustomFieldId=CustFiled.CustomFieldId Where CustValue.AuctionId=1 ) N On M.CustomFieldName=N.CustomFieldName And M.RecordId=N.RecordId But I got the result below #CustomFieldName# CustomFieldValue RecordId User Name kaliya 1 City Bangalore 1 Email [email protected] 1 Salary NULL **NULL** User Name Yohesh 2 City Delhi 2 Email 2 Salary NULL **NULL** User Name sss 3 City Delhi 3 Email [email protected] 3 Salary NULL **NULL** User Name NULL **NULL** City NULL **NULL** Email NULL **NULL** Salary NULL **NULL** User Name Sunil 4 City Mumbai 4 Email [email protected] 4 Salary 20000 4 But Expected Result is CustomFieldName CustomFieldValue RecordId User Name kaliya 1 City Bangalore 1 Email [email protected] 1 Salary NULL **1** User Name Yohesh 2 City Delhi 2 Email 2 Salary NULL **2** User Name sss 3 City Delhi 3 Email [email protected] 3 Salary NULL **3** User Name Sunil 4 City Mumbai 4 Email [email protected] 4 Salary 20000 4 Please guide me some one,I tried so much but i got null value in recordId,So I need same recordId above one..

    Read the article

  • Javascript Regular expression to enforce 2 digits after decimal points

    - by Manas Saha
    I need to validate a text box where users are supposed to enter numeric values with 2 decimal places. I am validating the text in client side javascript. The validation will pass only if the number has precisely 2 decimal places, and there is at least 1 digit before the decimal point. (could be zero) the number before the decimal point can be 0, but can not be multiple zeroes. like 00 or 000 The number before the decimal point can not begin with more than 1 zero. Example of Passed validation: 0.01 0.12 111.23 1234.56 012345.67 123.00 0.00 Example of failed validation .12 1.1 0.0 00.00 1234. 1234.567 1234 00123.45 abcd.12 12a4.56 1234.5A I have tried with [0-9][.][0-9][0-9]$ But it is allowing alphabets before decimal point. like 12a4.56 Can anyone please fix the expression? thanks a lot in advance.

    Read the article

  • Need to create regular expression in Javascript to check the valid conditional string

    - by user1796078
    I want to create the regular expression in javascript which will check the valid conditional string like -1 OR (1 AND 2) AND 1 -1 OR (1 AND 2) -1 OR 2 -1 OR 1 OR 1 -1 AND 1 AND 1 The string should not contain 'AND' and 'OR'. For example - 1 OR 2 AND 3 is invalid. -It should be (1 OR 2) AND 3 or 1 or (2 AND 3). I tried the following Regex. It works for most of the conditions but it is failing to check the above condition. /^(\s*\(\d+\s(AND|OR)\s\d+\)|\s*\d+)((\s*(AND|OR)\s*)(\(\d+\s(AND|OR)\s\d+\)|\s*\d+))*$/ Can anyone please help me to sort out the above problem.

    Read the article

  • Press a Button and open a URL in another ViewController

    - by Dennis Borup Jakobsen
    I am trying to learn Xcode by making a simple app. But I been looking on the net for hours (days) and I cant figure it out how I make a button that open a UIWebView in another ViewController :S first let me show you some code that I have ready: I have a few Buttons om my main Storyboard that each are title some country codes like UK, CA and DK. When I press one of those Buttons I have an IBAction like this: - (IBAction)ButtonPressed:(UIButton *)sender { // Google button pressed NSURL* allURLS; if([sender.titleLabel.text isEqualToString:@"DK"]) { // Create URL obj allURLS = [NSURL URLWithString:@"http://google.dk"]; }else if([sender.titleLabel.text isEqualToString:@"US"]) { allURLS = [NSURL URLWithString:@"http://google.com"]; }else if([sender.titleLabel.text isEqualToString:@"CA"]) { allURLS = [NSURL URLWithString:@"http://google.ca"]; } NSURLRequest* req = [NSURLRequest requestWithURL:allURLS]; [myWebView loadRequest:req]; } How do I make this open UIWebview on my other Viewcontroller named myWebView? please help a lost man :D

    Read the article

  • Is nested synchronized block necessary?

    - by Dan
    I am writing a multithreaded program and I have a method that has a nested synchronized blocks and I was wondering if I need the inner sync or if just the outer sync is good enough. public class Tester { private BlockingQueue<Ticket> q = new LinkedBlockingQueue<>(); private ArrayList<Long> list = new ArrayList<>(); public void acceptTicket(Ticket p) { try { synchronized (q) { q.put(p); synchronized (list) { if (list.size() < 5) { list.add(p.getSize()); } else { list.remove(0); list.add(p.getSize()); } } } } catch (InterruptedException ex) { Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex); } } } EDIT: This isn't a complete class as I am still working on it. But essentially I am trying to emulate a ticket machine. The ticket machine maintains a list of tickets in the BlockingQueue q. Whenever a client adds a ticket to the machine, the machine also keeps track of the price of the last 5 tickets (ArrayList list)

    Read the article

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