Daily Archives

Articles indexed Friday November 23 2012

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

  • jQuery mobile List-View is not working after adding some jquery code [closed]

    - by Kaidul Islam Sazal
    I am using jquery mobile and I have an array makeArrayin jquery and I have created few listview by the values of the array.Everything works fine.But the jquery mobile list-view style is not shown. Rather it is shown an ordinary list view. This is my code: $(document).ready(function(){ var url = "inventory/inventory.json"; var makeArray = new Array(); $.getJSON(url, function(data){ $.each(data, function(index, item){ if(($.inArray(item.make, makeArray)) == -1){ makeArray.push(item.make); $('.upper_case') .append('<li data-icon="list-arrow"> <a href="trade_form.php?='+ item.make +'"><img src="images/car_logo/buick.png" class="ui-li-thumb"/>' + item.make + '</a></li>'); } }); }); });

    Read the article

  • Responsive Design: Which Framework Should I Use? CSS3 & HTML5

    - by Jayhal
    I've been looking for a suitable set of HTML5/CSS3 foundation files to start new projects on. I started off piecing together my own files, but I believe I might be better served in finding a solid and fairly compatible(with me) CSS3/HTML5 framework and then tweaking certain things that may not best suit my own process. I'd love to find something that is responsive and that includes aspects focusing on layout, type(hor and vert baselines), form and interface components, cross-browser issues, and preferably built on something other than a just imple css reset, but that does include rebuilding elements consistently across browsers for a clean work slate. Extra features like polyfills or others area great, as is good documentation and examples. So far, off the top of my head I know of, Skeleton 1140 Grid 320 & Up (plus BP) HTML5 Boilerplate 2.0 and Mobile Inuit.css Less Framework Fluir Perkins.Less A few WP themes Are there any great one I don't know about? I work a lot in WP, and something that is easily incorporated (but also stand alone) is ideal. Plugins and wide set feature while maintaining the ability to cut it down when needed(flexibility) is also a big plus, and in par with a faster learning, since I want to start using whatever I find immediately . What are some of the better options you guys might be able to recommend? Systems or scripts, plugins, and other related tools are also welcome, Thanks!

    Read the article

  • Making a Background Scrolling in Stacking Game

    - by David Dimalanta
    Hmmm...Is it a good idea to use a LibGDX parallax background for making a stacking game (i.e. PAPA STACKer Lite)? For example, I'm starting to use the blocks to drag-n-drop it. Next, when the next piece reaches the top of the screen, it automatically scrolls to the next one where the available space left. Aside from that, is it also involved with the camera code (Orthographic Camera) that the screen size appeared like 720x1280 but actually it's 1440x2560 for example? And another thing, does the background scrolling have the option to scroll from start to finish and infinite?

    Read the article

  • Scaling Sound Effects and Physics with Framerate

    - by Thomas Bradsworth
    (I'm using XNA and C#) Currently, my game (a shooter) runs flawlessly with 60 FPS (which I developed around). However, if the framerate is changed, there are two major problems: Gunshot sound effects are slower Jumping gets messed up Here's how I play gunshot sounds: update(gametime) { if(leftMouseButton.down) { enqueueBulletForSend(); playGunShot(); } } Now, obviously, the frequency of playGunShot depends on the framerate. I can easily fix the issue if the FPS is higher than 60 FPS by capping the shooting rate of the gun, but what if the FPS is less than 60? At first I thought to just loop and play more gunshots per frame, but I found that this can cause audio clipping or make the bullets fire in "clumps." Now for the second issue: Here's how jumping works in my game: if(jumpKey.Down && canJump) { velocity.Y += 0.224f; } // ... (other code) ... if(!onGround) velocity.Y += GRAVITY_ACCELERATION * elapsedSeconds; position += velocity; The issue here is that at < 60 FPS, the "intermediate" velocity is lost and therefore the character jumps lower. At 60 FPS, the game adds more "intermediate" velocities, and therefore the character jumps higher. For example, at 60 FPS, the following occurs: Velocity increased to 0.224 Not on ground, so velocity decreased by X Position increased by (0.224 - X) <-- this is the "intermediate" velocity At 30 FPS, the following occurs: Velocity increased to 0.224 Not on ground, so velocity decreased by 2X Position increased by (0.224 - 2X) <-- the "intermediate" velocity was lost All help is appreciated!

    Read the article

  • Multiple objects listening for the same key press

    - by xiaohouzi79
    I want to learn the best way to implement this: I have a hero and an enemy on the screen. Say the hero presses "k" to get out a knife, I want the enemy to react in a certain way. Now, if in my game loop I have a listener for the key press event and I identify a "k" was pressed, the quick and easy way would be to do: // If K pressed // hero.getOoutKnife() // enemy.getAngry() But what is commonly done in more complex games, where say I have 10 types of character on screen and they all need to react in a unique way when the letter "k" is pressed? I can think of a bunch of hacky ways to do this, but would love to know how it should be done properly. I am using C++, but I'm not looking for a code implementation, just some ideas on how it should be done the right way.

    Read the article

  • CGBitmapContextCreate: unsupported parameter combination

    - by tarmes
    I'm getting this error when creating a bitmap context: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 24 bits/pixel; 3-component color space; kCGImageAlphaNone; 7936 bytes/row. Here's the code (note that the context is based on the parameters of an existing CGImage: context = CGBitmapContextCreate(NULL, (int)pi.bufferSizeRequired.width, (int)pi.bufferSizeRequired.height, CGImageGetBitsPerComponent(imageRef), 0, CGImageGetColorSpace(imageRef), CGImageGetBitmapInfo(imageRef)); Width is 2626, height is 3981. I've leaving bytesPerRow at zero so that it gets calculated automatically for me, and it's chosen 7936 of its own accord. So, where on Earth is the inconsistency? It's driving me nuts.

    Read the article

  • Running interrelated methods continously using java

    - by snehalata
    I have written application which downloads data from a website every 10 mins and writes to a file.Then these files are merged into one file and then R program is run on this merged file to perform sentiment analysis and result is stored in hbase. I want the process of merging files,running R and then storing to HBase to run continuosly on the downloaded data. For running R,we are running R script from java program.We have used Runtime.getRuntime().exec() method to run R program but it doesn't wait for R program to complete and method in the next line starts executing.Using p.waitFor() did not help . What approach should I use to do merge then run R and finally store results in Hbase?Should I use timer class??

    Read the article

  • Regex help in java validations

    - by user1697113
    Hi i want to do some validations.I used to put regex in JS but im new to regex in java, so i tried to make up a code on similar lines in java. Here is what i did. 1)Check whether first character in string is alphanumeric. 2)Check whether the string atleast 1 number. so i wrote a code, but it is always returning false.I am not sure if i'm doing this correctly. private static boolean checkEmbeddedPassword(final String field) { boolean returnValue=true; String testpatternAlpha="/^[A-Za-z0-9].+$/"; String testNumber="/[0-9]/"; Pattern pattern=Pattern.compile(testpatternAlpha); Pattern pattern2=Pattern.compile(testNumber); Matcher matcher = pattern.matcher(field); Matcher matcher2 = pattern2.matcher(field); boolean firstChar=matcher.matches(); boolean numberFlag=matcher2.matches(); System.out.println("-----the value of pwd iss-----"+field); System.out.println("---------Regex---------Out--put-----"+firstChar); System.out.println("---------Regex---------Out- for numeral-put-----"+numberFlag); if(firstChar){ returnValue=false; } else if(field.contains(" ")) { System.out.println("-----------cannot have space------"); returnValue=false; } else if(numberFlag) { returnValue=false; } return returnValue; }

    Read the article

  • Why does JAXB not create a member variable in its generated code when an XML schema base type and subtype have the same element declared in them?

    - by belltower
    I have a question regarding with regard to JAXB generated classes. As you can I see, I have a complex type, DG_PaymentIdentification1, declared in my schema. Its a restriction of PaymentIdentification1. DG_PaymentIdentification1 is also identical to PaymentIdentification1. I also have a type called DG_CreditTransferTransactionInformation10 which has a base type of CreditTransferTransactionInformation10 and is identical to it. I have included the relevant XML schema snippets below. <xs:complexType name="DG_PaymentIdentification1"> <xs:complexContent> <xs:restriction base="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="DG_Max35Text_REF" minOccurs="0"/> <xs:element name="EndToEndId" type="DG_Max35Text_REF" id="DG-41"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="Max35Text" minOccurs="0"/> <xs:element name="EndToEndId" type="Max35Text"/> </xs:sequence> </xs:complexType> <xs:complexType name="DG_CreditTransferTransactionInformation10"> <xs:complexContent> <xs:restriction base="CreditTransferTransactionInformation10"> <xs:sequence> <xs:element name="PmtId" type="DG_PaymentIdentification1"/> <xs:simpleType name="DG_Max35Text_REF"> <xs:restriction base="DG_NotEmpty35"> <xs:pattern value="[\-A-Za-z0-9\+/\?:\(\)\.,'&#x20;]*"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="Max35Text"> <xs:restriction base="xs:string"> <xs:minLength value="1"/> <xs:maxLength value="35"/> </xs:restriction> </xs:simpleType> JAXB generates the following java class for DG_PaymentIdentification1: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DG_CreditTransferTransactionInformDGion10") public class DGCreditTransferTransactionInformation10 extends CreditTransferTransactionInformation10 { } My question is why doesnt the DGCreditTransferTransactionInformation10 generated class have a variable of type DG_PaymentIdentification1 in the generated code? The base class CreditTransferTransactionInformation10 does have a type PaymentIdentification1 declared in it. Is there any way of ensuring that DGCreditTransferTransactionInformation10 will have a DG_PaymentIdentification1 in it?

    Read the article

  • On demand population of dropdown menu Java/Swing?

    - by Cookie Monster
    When I code a popup menu, I can check the mouse event and then before calling show() prepare the menu. Now I want a similar functionality for drop down menus, that live in the menu bar. For example I have the following menu bar layout: Menu 1 MenuItem 1.1 MenuItem 1.1.1 MenuItem 1.1.2 .. MenuItem 1.1.n Menu 2 Basically I want to generate the list MenuItem 1.1.1, MenuItem 1.1.2, ..., MenuItem 1.1.n dynamically when the drop down menu is invoked and before it is shown. How could I do this in Java/Swing? Best Regards

    Read the article

  • How to Use border as an image in android xml

    - by Ethan Hunt
    I have a popup to show in my xml. It should have a border. Following is the code:- <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="20dp" > <RelativeLayout android:id="@+id/rl_startpopup" android:layout_width="340dp" android:layout_height="320dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@drawable/popup_outline" android:orientation="vertical" /> </RelativeLayout> The popup_outline is a shape <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="270" android:endColor="#192423" android:startColor="#4a7669" android:type="linear" /> <corners android:radius="8dp" /> <stroke android:width="2dp" android:color="#e4f4d3" /> </shape> here is the image of the popup:- This "popup_outline" is the white border shown. I want to use a repeatable pattern image instead of one color as the border. I have to do this in xml. Please help

    Read the article

  • MYSQL in PHPMYADMIN - create table relationship from one table

    - by Stanley DecoWood
    I want to create a table relationship with MYSQL PHPMYADMIN. I have this Create table: CREATE TABLE students(code_students int(8)not null AUTO_INCREMENT, name_students varchar(25), age_students int(3), degree_program varchar(25), code_advisor int(8)not null, primary key(code_students, code_advisor) ); and i want to make a create table named advise relationship between code_students, code_advisor.

    Read the article

  • SQL Access INSERT INTO Autonumber Field

    - by KrazyKash
    I'm trying to make a visual basic application which is connected to a Microsoft Access Database using OLEDB. Inside my database I have a user table with the following layout ID - Autonumber Username - Text Password - Text Email - Text To insert data into the table I use the following query INSERT INTO Users (Username, Password, Email) VALUES ('004606', 'Password', '[email protected]') However I seem to get an error with this statement and according to VB it's a syntax error. But then I tried to use the following query INSERT INTO Users (Username) Values ('004606') This query seemed to work absolutely fine... So the problem is I can insert into just one field but not all 3 (excluding the ID field because it's an autonumber). Any help would be appreciated, Thanks

    Read the article

  • Lost Array After Validation Error

    - by Georges Kmeid
    I'm working on a CakePHP project and I have User, Post and Location models among others. User hasMany Location and Post belongsTo User so Location is not directly related to Post. This is my code in the Post controller: public function add() { if ($this->request->is('get')) { $this->loadModel('Location'); $this->set('locations', $this->Location->find('all', array('conditions' => array('user_id' => $this->Auth->user('id'))))); } ... } And this is my code in the posts/add view: <?php $i = 0; $j = 0; foreach ($locations as $location): $location_names[$i] = $location['Location']['name']; $i++; endforeach; echo "<select name=\"location\" onchange=\"select(this.value)\">"; echo "<option value=\"\">Select a saved location</option>"; foreach ($locations as $location): echo "<option value=\"" . $location['Location']['latitude'] . "," . $location['Location']['longitude'] . "\">" . $location_names[$j] . "</option>"; $j++; endforeach; ?> </select> If I enter a wrong value in one of the post inputs that has a validation rule in Post model, it redirects to the current add view, shows what is the validation error, but then the $locations array passed from controller to view disappears and can't use it in view and I get this error: Notice (8): Undefined variable: locations [APP\View\Posts\add.ctp, line 68]

    Read the article

  • How we can execute a javascript function and get a return value in our android application?

    - by JAC
    How we can execute a javascript function and get a return value in our android appplication ? We have a javascript file that stored in our sqlite db, We want to execute that script on a button press event, we need to pass parameters to the script and get return values, how we can implement this? sample script file stored in Db is, <html><head><title>ADV</title><script type="text/javascript"> function checkName(pname) if( pname == 'android') { return false; }else { return true; } } </script></head><body></Body></html>

    Read the article

  • Find tag that contains certain text and add a class

    - by David Gard
    I have the following HTML, and I need to add a class to both <li> and <a> where the text 'Charts' exists (so not the second line, but rather the 4th and 5th). I cannot change the output of the HTML. <div class="wp-submenu-wrap"> <div class="wp-submenu-head">Charts</div> <ul> <li class="wp-first-item"> <a class="wp-first-item" tabindex="1" href="admin.php?page=charts">Charts</a> </li> <li> <a tabindex="1" href="admin.php?page=add-chart">Add Chart</a> </li> </ul> </div> I've tried doing this by locating the <a> tag that contains the text, but it is not working. Can somebody please point me in the correct direction? Thanks. Code that I've tried - $(document).ready(function(){ if(pagenow === 'admin_page_edit-chart') { var page = $('.wp-submenu-wrap a:contains["Charts"]'); page.addClass('current'); page.parent('li').addClass('current'); } });

    Read the article

  • Linq like or other construction

    - by Yauhen Kavalenka
    I have DB oracle in my solution. I want to have some results in this query. Query example: select * from doctor where doctor.name like '%IVANOV_A%'; But if i do it at LINQ i cannot get any result. from p in repository.Doctor.Where(x => x.Name.ToLower().Containsname)) select p; Where 'name' is variable of string parameter. Web layout request next string: "Ivanov a" or "A Ivanov" But i suggest for user choose you pattetn for query. How i can to get "patient by name" if name consist of "First name" and "Last name" but user doesn't know your doctor's full name?

    Read the article

  • while loop in c#

    - by Nave Tseva
    I have this code: using System; namespace _121119_zionAVGfilter { class Program { static void Main(string[] args) { int cnt = 0, zion, sum = 0; double avg; Console.Write("Enter first zion \n"); zion = int.Parse(Console.ReadLine()); while (zion != -1) { while (zion < -1 || zion > 100) { Console.Write("zion can be between 0 to 100 only! \nyou can rewrite the zion here, or Press -1 to see the avg\n"); zion = int.Parse(Console.ReadLine()); } cnt++; sum = sum + zion; Console.Write("Enter next zion, if you want to exit tap -1 \n"); zion = int.Parse(Console.ReadLine()); if (cnt != 0){} } if (cnt == 0) { Console.WriteLine("something doesn't make sence"); } else { avg = (double)sum / cnt; Console.Write("the AVG is {0}", avg); } Console.ReadLine(); } } } The problem here is that if in the beginning I enter a negative or bigger than hundred number, I will get this message: "zion can be between 0 to 100 only! \nyou can rewrite the zion here, or Press -1 to see the avg\n". If I then meenter -1, this what that shows up instead of the AVG: "Enter next zion, if you want to exit tap -1 \n." How can I solve this problem so when the number is negative or bigger than hundred and than tap -1 I will see the AVG an not another message?

    Read the article

  • How to close a form in UserControl

    - by FJPoort
    I created a UserControl with the buttons Save, Close and Cancel. I want to close the form without saving on the Cancel button, prompt a message to save on the Close button and Save without closing on the Save button. Normally, I would have used this.Close() on the Cancel button, but the UserControl doesn't have such an option. So I guess I have to set a property for that. Scrolling down the "Questions that may already have your answer" section, I came across this question: How to close a ChildWindow from an UserControl button loaded inside it? I used the following C# code: private void btnCancel_Click(object sender, EventArgs e) { ProjectInfo infoScreen = (ProjectInfo)this.Parent; infoScreen.Close(); } This does the job for one screen, but I wonder if I have to apply this code for all the screen I have? I think there should be a more efficient way. So my question is: Do I need to apply this code for every form I have, or is there another (more efficient) way?

    Read the article

  • Ruby on rails form variables as array items

    - by Francois
    I have a simple form with text input and text area, but when I submit it the variables seems to be array items instead of just string values? the form <%= form_tag(home_kontak_path, :remote => true) do %> <label>Jou epos adres</label> <%= text_field(:epos, "", :placeholder => "Jou epos adres", :id => "epos", :class => "input-block-level") %> <label>Boodskap hier</label> <%= text_area(:boodskap, "", :rows => "5", :placeholder => "Boodskap hier...", :id => "boodskap", :class => "input-block-level") %> <%= submit_tag "submit" %> <% end %> console output Started POST "/home/kontak" for 127.0.0.1 at 2012-11-23 11:53:03 +0200 Processing by HomeController#kontak as JS Parameters: {"utf8"=>"?", "authenticity_token"=>"i+5UWaQeBu7LYGPFBNAbum+67VzyyC82JN2wMlLc/UU=", "epos"=>["text box value"], "boodskap"=>["text area value"], "commit"=>""} what i would like it to be instead of "epos"=["text box value"] i want it to return "epos"="text box value"

    Read the article

  • Render as html from a remote link on Rails

    - by francordie
    On my registration form i want to show a modal (of twitter-bootstrap) when the user has a successfull signup to tell him to check his email so i put "remote: true" on my form and render a .js.erb wich shows the modal, on my controller. BUT, in case of inputs errors i need to render the page as html to refresh de form showing those errors. Can I call the controller from the remote form as JS but render as html? (or any other idea to do what i want) Thanks!

    Read the article

  • Rails Installed But Not Working

    - by Luiz P
    Folks, Yesterday I installed Rails 3.2 on Ubuntu 12.10 and created a new project in order to check it. It was working OK. Today I tried to create a new project and got the message bellow (Portuguese version): O programa 'rails' pode ser encontrado nos seguintes pacotes: * rails * ruby-railties-3.2 Tente: sudo apt-get install <pacote selecionado> Something like: The program 'rails' could not be found in the follow packages: ... ... Try: sudo apt-get install <selected package> I run the command gem list and all the gems are listed, including Rails one. I tried to search on the web for a solution, but haven't found any. Thank you very much for your help. Luiz

    Read the article

  • Seperate html pages for each screen in Jquery mobile

    - by vrs
    I am newbie to Jquery Mobile, so far what ever examples i searched contains only one html page for whole application, with multipe div tags where each page/screen is defined as div tag with data-role as page with some header and footers optionally. Based on user actions, we are hiding some div's(pages) and showing only expected page. Also, this multi-page template seems to be standard design, as written by some blogs. Are there any other designing ways? what I would like to have is multipe html pages, for ex one for login, one for home, one for contact etc. Other wise it is difficult to understand/code/debug issues, especially people from Java background like me.So, what I want is some kind of MVC design with JQueryMobile, like each view/screen as sepearate html associated with one js (Controller). Can we have multiple html pages in JqueryMobile app? If possible how to pass data/ maintain session between them? Any samples are most welcome. Thanks In Advance. Note: Also I don't want server side includes, may app contains 10 to 15 screens, each page will make a webservice call and fetch some data and map it to UI.

    Read the article

  • Installing Qt libraries on OS X

    - by AXL79
    I'm trying to install the Qt 4.8.3 precompiled libraries downloaded from http://qt-project.org/downloads on my OS X 10.6 machine. Unfortunately the package doesn't seem to actually install any libraries (although it claims to do so in the readme) I've read loads of instructions of how to configure and build Qt from source but these are precompiled, as in 'you don't have to compile them yourself'. So I must be missing something. Is there anyone out there who knows how to actually install Qt on OS X so that it is possible to link against them -without- building the whole thing from source. Thanks

    Read the article

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