Daily Archives

Articles indexed Monday November 21 2011

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

  • Why is my model's scale changing after rotating it?

    - by justnS
    I have just started a simple flight simulator and have implemented Roll and pitch. In the beginning, testing went very well; however, after about 15-20 seconds of constantly moving the thumbsticks in a random or circular motion, my model's scale begins to grow. At first I thought the model was moving closer to the camera, but i set break points when it was happening and can confirm the translation of my orientation matrix remains 0,0,0. Is this a result of Gimbal Lock? Does anyone see an obvious error in my code below? public override void Draw( Matrix view, Matrix projection ) { Matrix[] transforms = new Matrix[Model.Bones.Count]; Model.CopyAbsoluteBoneTransformsTo( transforms ); Matrix translateMatrix = Matrix.Identity * Matrix.CreateFromAxisAngle( _orientation.Right, MathHelper.ToRadians( pitch ) ) * Matrix.CreateFromAxisAngle( _orientation.Down, MathHelper.ToRadians( roll ) ); _orientation *= translateMatrix; foreach ( ModelMesh mesh in Model.Meshes ) { foreach ( BasicEffect effect in mesh.Effects ) { effect.World = _orientation * transforms[mesh.ParentBone.Index]; effect.View = view; effect.Projection = projection; effect.EnableDefaultLighting(); } mesh.Draw(); } } public void Update( GamePadState gpState ) { roll = 5 * gpState.ThumbSticks.Left.X; pitch = 5 * gpState.ThumbSticks.Left.Y; }

    Read the article

  • Help with Collision of spawned object(postion fixed) with objects that there are translating on screen

    - by Amrutha
    Hey guys I am creating a game using Corona SDK and so coding it in Lua. So there are 2 separate functions, To translate the hit objects and change their color when they are tapped The link below is the code I am using to for the first function http://developer.anscamobile.com/sample-code/fishies Spawn objects that will hit the translating objects on collision. Alos on collision the spawned object disappears and the translating object bears a color(indicating the collision). In addition the size of this spawned object is dependent on i/p volume level. The function I have written is as follows: --VOICE INPUT CODE local r = media.newRecording() r:startRecording() r:startTuner() --local function newBar() -- local bar = display.newLine( 0, 0, 1, 0 ) -- bar:setColor( 0, 55, 100, 20 ) -- bar.width = 5 -- bar.y=400 -- bar.x=20 -- return bar --end local c1 = display.newImage("str-minion-small.png") c1.isVisible=false local c2 = display.newImage("str-minion-mid.png") c2.isVisible=false local c3 = display.newImage("str-minion-big.png") c3.isVisible=false --SPAWNING local function spawnDisk( event ) local phase = event.phase local volumeBar = display.newLine( 0, 0, 1, 0 ) volumeBar.y = 400 volumeBar.x = 20 --volumeBar.isVisible=false local v = 20*math.log(r:getTunerVolume()) local MINTHRESH = 30 local LEFTMARGIN = 20 local v2 = MINTHRESH + math.max (v, -MINTHRESH) v2 = (display.contentWidth - 1 * LEFTMARGIN ) * v2 / MINTHRESH volumeBar.xScale = math.max ( 20, v2 ) local l = volumeBar.xScale local cnt1 = 0 local cnt2 = 0 local cnt3 = 0 local ONE =1 local val = event.numTaps --local px=event.x --local py=event.y if "ended" == phase then --audio.play( popSound ) --myLabel.isVisible = false if l > 50 and l <=150 then --c1:setFillColor(10,105,0) --c1.isVisible=false c1.x=math.random( 10, 450 ) c1.y=math.random( 10, 300 ) physics.addBody( c1, { density=1, radius=10.0 } ) c1.isVisible=true cnt1= cnt1+ ONE return c1 elseif l > 100 and l <=250 then --c2:setFillColor(200,10,0) c2.x=math.random( 10, 450 ) c2.y=math.random( 10, 300 ) physics.addBody( c2, { density=2, radius=9000.0 } ) c2.isVisible=true cnt2= cnt2+ ONE return c2 elseif l >=250 then c3.x=math.random( 40, 450 ) c3.y=math.random( 40, 300 ) physics.addBody( c3, { density=2, radius=7000.0 , bounce=0.0 } ) c3.isVisible=true cnt3= cnt3+ ONE return c3 end end end buzzR:addEventListener( "touch", spawnDisk ) -- touch the screen to create disks Now both functions work fine independently but there is no collision happening. Its almost as if the translating object and the spawn object are on different layers. The translating object passes through the spawn object freely. Can anyone please tell me how to resolve this problem. And how can I get them to collide. Its my first attempt at game development, that too for a mobile platform so would appreciate all help. Also if I have not been specific do let me know. I'll try to frame the query better :). Thanks in advance.

    Read the article

  • XNA - Drawing 2D Primitives (Boxes) and Understanding Matrices in Computer Graphics

    - by MintyAnt
    I have two issues which I wish to solve by creating 2D primitives in XNA. In my game, I wish to have a "debug mode" which will draw a red box around all hitboxes in the game (Red outline, transparent inside). This would allow us to see where the hitboxes are being drawn AND still have the sprite graphics being drawn. I wish to further understand how matrices work within computer graphics. I have a basic theoretical grasp of how they work, but I really just want to apply some of my knowledge or find a good tutorial on it. To do this, I wish to draw my own 2D primitives (With Vertex3's) and apply different transormation matrices to them. I was trying to find a tutorial on drawing primitives using Direct3D, but most tutorials are only for c++, and just tell me to use XNA's Spritebatch. I wish to have more control over my program than just with Spritebatch. Any Help on using Direct3D or any other suggestions would greatly be appreciated. Thank you.

    Read the article

  • User generated content: a basic yet simple to use OR a complex yet powerful solution?

    - by ne5tebiu
    As stated above, which solution is better for a game based on user generated content? The simple solution (in-game editor) is great for gamers without experience in coding and etc. In this way every player could populate the game with content. But the content would be very limited. The complex solution would allow the content to be with almost no limitation but casual gamers probably couldn't make hardly any content at all. If both solutions are used, the quality behind the second solution would be more valuable than the first solution's quantity. However, making a powerful in-game editor could even take more time and manpower than the actual game and every gamer would have to learn how to use the new complex tool, understand it, and master it if he or she wants to make quality content.

    Read the article

  • HTML5 or Javascript game engine to develop a browser game

    - by Jack Duluoz
    I would like to start developing a MMO browser game, like Travian or Ogame, probably involving also a bit of more sophisticated graphical features such as players interacting in real time with a 2d map or something like that. My main doubt is what kind of development tools I should use: I've a good experience with PHP and MySQL for the server side and Javascript (and jQuery) regarding the client side. Coding everything from scratch would be of course really painful so I was wondering if I should use a javascript game engine or not. Are there (possibly free) game engine you would recommend? Are they good enough to develop a big game? Also, I saw a lot of HTML5 games popping up lately but I'm now sure if using HTML5 is a good idea or not. Would you recommend it? What are the pro and cons about using HTML5? If you'd recommend it, do you have any good links regarding game development with HTML5? (PS: I know that HTML5 and a Javascript engine are not mutually exclusive, I just didn't know how to formulate a proper title since English is not my main language. So, please, answer addressing HTML5 and a game engine pro and cons separately)

    Read the article

  • Split textarea content into two at maxlength and flow excedant content in another textarea

    - by user1057339
    Wondering if its possible to create a short simple and sweet cross-browser jQuery (1.6) function that would split #textarea1 content into two by preserving the characters that amount to less than its var maxlength limit and transfering the remaining characters that exceed its maxlength limit in #textarea2. #textarea1 can push excedant in #textarea2, but if #textarea1 contains less than the maxlength limit, by default it wont get filled up with #textarea2 content, but you would have the option programatically to override this. I am just beginning to scratch the surface of jQuery but I noticed that this simple javascript can nearly do the trick, minus the free-flowing character movement. Scratching my head on this one. Thx a heap for any help. DC

    Read the article

  • Bitmap Confusion Android

    - by Farhan
    I am getting an image from gallery in onActivityResult() through intent.getdata(). Now i get the data and set it to a bitmap, its size is 716x716 and its setting to full screen. (ImageView's width and height is set to wrap content). Now i created another bitmap after scaling the original through Bitmap.CreateScaledBitmap(orgBitmap,30,30,false); After this, i make sure these things(width,height n size) and they happen as they should be but the problem is that the image is still taking the full screen... rather it should only take 30dp x 30dp. Anyone have an idea what might be the problem??? Thanx

    Read the article

  • how to execute two thread simultaneously in java swing?

    - by jcrshankar
    My aim is to select all the files named with MANI.txt which is present in their respective folders and then load path of the MANI.txt files different location in table. After I load the path in the table,I used to select needed path and modifiying those. To load the MANI.txt files taking more time,because it may present more than 30 times in my workspace or etc. until load the files I want to give alarm to the user with help of ProgessBar.Once the list size has been populated I need to disable ProgressBar. Could anyone please help me out on this? import java.awt.*; import javax.swing.*; import javax.swing.table.*; import java.awt.event.*; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class JTableHeaderCheckBox extends JFrame implements ActionListener { Object colNames[] = {"", "Path"}; Object[][] data = {}; DefaultTableModel dtm; JTable table; JButton but; java.util.List list; public void buildGUI() { dtm = new DefaultTableModel(data,colNames); table = new JTable(dtm); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); int vColIndex = 0; TableColumn col = table.getColumnModel().getColumn(vColIndex); int width = 10; col.setPreferredWidth(width); int vColIndex1 = 1; TableColumn col1 = table.getColumnModel().getColumn(vColIndex1); int width1 = 500; col1.setPreferredWidth(width1); JFileChooser chooser = new JFileChooser(); //chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle("Choose workSpace Path"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){ System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory()); System.out.println("getSelectedFile() : " + chooser.getSelectedFile().getAbsolutePath()); } String path= chooser.getSelectedFile().getAbsolutePath(); File folder = new File(path); Here I need progress bar GatheringFiles ob = new GatheringFiles(); list=ob.returnlist(folder); for(int x = 0; x < list.size(); x++) { dtm.addRow(new Object[]{new Boolean(false),list.get(x).toString()}); } JPanel pan = new JPanel(); JScrollPane sp = new JScrollPane(table); TableColumn tc = table.getColumnModel().getColumn(0); tc.setCellEditor(table.getDefaultEditor(Boolean.class)); tc.setCellRenderer(table.getDefaultRenderer(Boolean.class)); tc.setHeaderRenderer(new CheckBoxHeader(new MyItemListener())); but = new JButton("REMOVE"); JFrame f = new JFrame(); pan.add(sp); but.move(650, 50); but.addActionListener(this); pan.add(but); f.add(pan); f.setSize(700, 100); f.pack(); f.setLocationRelativeTo(null); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } class MyItemListener implements ItemListener { public void itemStateChanged(ItemEvent e) { Object source = e.getSource(); if (source instanceof AbstractButton == false) return; boolean checked = e.getStateChange() == ItemEvent.SELECTED; for(int x = 0, y = table.getRowCount(); x < y; x++) { table.setValueAt(new Boolean(checked),x,0); } } } public static void main (String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ new JTableHeaderCheckBox().buildGUI(); } }); } public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if(e.getSource()==but) { System.err.println("table.getRowCount()"+table.getRowCount()); for(int x = 0, y = table.getRowCount(); x < y; x++) { if("true".equals(table.getValueAt(x, 0).toString())) { System.err.println(table.getValueAt(x, 0)); System.err.println(list.get(x).toString()); delete(list.get(x).toString()); } } } } public void delete(String a) { String delete = "C:"; System.err.println(a); try { File inFile = new File(a); if (!inFile.isFile()) { System.out.println("Parameter is not an existing file"); return; } //Construct the new file that will later be renamed to the original filename. File tempFile = new File(inFile.getAbsolutePath() + ".tmp"); BufferedReader br = new BufferedReader(new FileReader(inFile)); PrintWriter pw = new PrintWriter(new FileWriter(tempFile)); String line = null; //Read from the original file and write to the new //unless content matches data to be removed. while ((line = br.readLine()) != null) { System.err.println(line); line = line.replace(delete, " "); pw.println(line); pw.flush(); } pw.close(); br.close(); //Delete the original file if (!inFile.delete()) { System.out.println("Could not delete file"); return; } //Rename the new file to the filename the original file had. if (!tempFile.renameTo(inFile)) System.out.println("Could not rename file"); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } } class CheckBoxHeader extends JCheckBox implements TableCellRenderer, MouseListener { protected CheckBoxHeader rendererComponent; protected int column; protected boolean mousePressed = false; public CheckBoxHeader(ItemListener itemListener) { rendererComponent = this; rendererComponent.addItemListener(itemListener); } public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (table != null) { JTableHeader header = table.getTableHeader(); if (header != null) { rendererComponent.setForeground(header.getForeground()); rendererComponent.setBackground(header.getBackground()); rendererComponent.setFont(header.getFont()); header.addMouseListener(rendererComponent); } } setColumn(column); rendererComponent.setText("Check All"); setBorder(UIManager.getBorder("TableHeader.cellBorder")); return rendererComponent; } protected void setColumn(int column) { this.column = column; } public int getColumn() { return column; } protected void handleClickEvent(MouseEvent e) { if (mousePressed) { mousePressed=false; JTableHeader header = (JTableHeader)(e.getSource()); JTable tableView = header.getTable(); TableColumnModel columnModel = tableView.getColumnModel(); int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int column = tableView.convertColumnIndexToModel(viewColumn); if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { doClick(); } } } public void mouseClicked(MouseEvent e) { handleClickEvent(e); ((JTableHeader)e.getSource()).repaint(); } public void mousePressed(MouseEvent e) { mousePressed = true; } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } } ****************** import java.io.File; import java.util.*; public class GatheringFiles { public static List returnlist(File folder) { List<File> list = new ArrayList<File>(); List<File> list1 = new ArrayList<File>(); getFiles(folder, list); return list; } private static void getFiles(File folder, List<File> list) { folder.setReadOnly(); File[] files = folder.listFiles(); for(int j = 0; j < files.length; j++) { if( "MANI.txt".equals(files[j].getName())) { list.add(files[j]); } if(files[j].isDirectory()) getFiles(files[j], list); } } }

    Read the article

  • NamedParameterJdbcTemplate jconnect decimal issue

    - by user1052849
    I am using NamedParameterJdbcTemplate to insert data into a table. (Spring 2.5.3/Java 1.6) I am using jconnect driver to connect to sybase jdbc:sybase:Tds:<Server>:<Port>. For some reason the decimal values the decimal part is truncated. With the same code if I use jtds driver (jdbc:jtds:sybase://<Servername>:<Port>) its working fine. I cannot use jtds as jconn is being used by other code. In Java objects, field is defined as double. In database, field is defined as float (numeric with precision does not work). Any help is appreciated.

    Read the article

  • How do I reset a countdown timer when it reaches 0? (Xcode 4)

    - by Zac Prunty
    first question and I have researched the heck out of this and can't seem to find any answers. I would like to implement a countdown timer in my app that starts at 30 seconds and resets when it hits 0. It will count back by 1 second intervals. I have played around with the resources that Apple provides and I can't seem to implement the NStimer to do as I just explained. Are there any suggestions on how I could code this? I would eventually like to link this to a button that will start the timer when it is pressed. I appreciate any advice on this topic!

    Read the article

  • how use graphvis in C# application?

    - by ghasedak -
    i have a dot format file and i download graphvis for windows now how can i use graphvis to show a graph in my c# application? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using VDS.RDF; using VDS.RDF.Parsing; using VDS.RDF.Query; using System.IO; using System.Windows; using System.Runtime.InteropServices; using VDS.RDF.Writing; using System.Diagnostics; namespace WindowsFormsApplication2 { public partial class first : Form { Graph g = new Graph(); string s1 = null; /**************************************DATA********************************************/ public first() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Stream myStream = null; var parser = new Notation3Parser(); var graph = new Graph(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "RDF files (*.n3)|*.n3"; openFileDialog1.FilterIndex = 1; openFileDialog1.RestoreDirectory = true; openFileDialog1.Multiselect = false; if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((myStream = openFileDialog1.OpenFile()) != null) { using (myStream) { string s = openFileDialog1.FileName.ToString(); string w= Directory.GetCurrentDirectory().ToString(); string Fname = openFileDialog1.SafeFileName.ToString(); File.Copy(s,Path.Combine(w,Fname),true); // Insert code to read the stream here. Win32.AllocConsole(); s1 = Path.Combine(w, Fname); insertNodeButton.Visible = true; delBut.Visible = true; simi.Visible = true; showNodes showNodes1 = new showNodes(s1); g = showNodes1.returngraph(); Console.Read(); Win32.FreeConsole(); // g.SaveToFile("firstfile.n3"); this.Show(); } } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } } GraphVizWriter hi = new GraphVizWriter(); hi.Save(g, "c:\\ahmad.dot"); } private void button2_Click(object sender, EventArgs e) { string strCmdLine = Application.StartupPath + "\\Tools\\rdfEditor.exe"; //string strCmdLine = "DIR"; MessageBox.Show(strCmdLine); System.Diagnostics.Process process1; process1 = new System.Diagnostics.Process(); //Do not receive an event when the process exits. process1.EnableRaisingEvents = false; //The "/C" Tells Windows to Run The Command then Terminate System.Diagnostics.Process.Start(strCmdLine); process1.Close(); } private void Form1_Load(object sender, EventArgs e) { } private void insertNodeButton_Click(object sender, EventArgs e) { //Graph parentvalue = this.g; //String parentvalueadress = this.s1; addTriple a1 = new addTriple(); a1.G = g; a1.BringToFront(); a1.ShowDialog(); g = a1.G; g.SaveToFile("c:\\Hi.n3"); } this is my code i want to visul saly dot file format to show a graph with graphvis

    Read the article

  • Codeigniter Model appending word_limiter to result object

    - by yahyaE
    I have a get_all function in my model class in Codeigniter 2.0+. For a given database field name, i need to use word_limiter() in text helper. In view page, i loop result set as object $row->field_name_to_be_limited. With below code, i am trying to do it. But i should include the change $q->$field_name = word_limiter($q->$field_name, 4); into the $q->result. Thanks for help. function get_all($table_name,$orderByField,$ascDesc,$field_name = '') { $this->load->helper('text'); $qOrder = $this->db->order_by($orderByField,$ascDesc); $q = $this->db->get($table_name,$qOrder); if( ! $field_name ==='') $q->$field_name = word_limiter($q->$field_name, 4); return $q->result(); }

    Read the article

  • How to correct the objection about dymanic Object type by FlexPMD?

    - by sanjoy roy
    I have the code in one of my flex file used as labelFunction in a DataGrid. When I run the FlexPMD to do the code review , it generates objection about the dynamic type object used in method signature "public function getFormattedCreatedTime(item:Object, column:DataGridColumn):String", it suggests to use strongly type object. Does anyone how to rectify it? public function getFormattedCreatedTime(item:Object, column:DataGridColumn):String { var value:Date=item[column.dataField]; return dateFormatter.format(value); } ]] Thanks

    Read the article

  • Sending message from one server to another in Twisted

    - by Casey Patton
    I've implemented my servers in the following way: def makeServer(application, port): factory = protocol.ServerFactory() factory.protocol = MyChat factory.clients = [] internet.TCPServer(port, factory).setServiceParent(application) application = service.Application("chatserver") server1 = makeServer(application, port=1025) server2 = makeServer(application, port=1026) server3 = makeServer(application, port=1027) Note that MyChat is an event handling class that has a "receiveMessage" action: def lineReceived(self, line): print "received", repr(line) for c in self.factory.clients: c.transport.write(message + '\n') I want server1 to be able to pass messages to server2. Rather, I want server1 to be treated as a client of server2. If server1 receives the message "hi" then I want it to send that same exact message to server2. How can I accomplish this?

    Read the article

  • OpenXml - How to identify whether the paragraph extends to next page

    - by K.V.
    From aspx page, I dynamically add paragraphs to a word document using OpenXml SDK. In this case, a page break within a paragraph is not allowed. So in case a paragraph starts in middle of page 1 and extends to page2 then it should actually start in Page2. However, if it ends in the same page it is okay. How to achieve this? Is there a way to set in th document that page break is not allowed within a paragraph? Any input is highly appreciated.

    Read the article

  • MVC3 Custom view engine

    - by eth0
    I have a custom View Engine that derives from WebFormViewEngine. There's a lot of stuff going on in here, mostly caching. I want to be able to use WebFormViewEngine AND RazorViewEngine at the same time, is this possible? Ideally I'd like to do; ViewEngines.Add(new MyViewEngine<WebFormsViewEngine>()); ViewEngines.Add(new MyViewEngine<RazorViewEngine>()); if a .ascx/.aspx/.master file exists then use WebForms, otherwise use Razor is a .cshtml file exists. EDIT: I should of worded my question better. As my custom view engine derives from WebFormViewEngine it obviously uses WebForms, I can't derive from two classes. I can derive from RazorViewEngine but then I'll loose WebForms. I can duplicate my code entirely, derive from RazorViewEngine and edit the views file extensions, etc. but as I said I've got a lot of custom code in my view engine and would be duplicating hundreds of lines. WebFormViewEngine and RazorViewEngine derive from BuildManagerViewEngine which in turn implements IViewEngine. The problem with that is I have to implement methods CreatePartialView() and CreateView() but how would I know what to return (WebForms/Razor?) using generics?

    Read the article

  • Mobile Aps that will detect/accept incoming SMS msg?

    - by user848682
    Im working on my thesis and I need some help. My thesis is like some "automated replying system for mobile apps". My questions: 1st: How to make an application that can detect incoming message? ( even some sample documentation will do, Ill d own my research ) 2nd: Is there any tool I need to achieve this? 3rd: What language is usally used for mobile application programming? 4th: Is it possible to achieve this? Thanks in Advance : ) Sorry I dont have any knowledge in mobile aps programming.

    Read the article

  • Ext.app.application object is erased after initialization

    - by Queequeg
    I am trying to organize an existing extjs code in a more standard order (extjs wise). extjs version: extjs-4.0.2a. I've worked through the Extjs tutorial example and every thing went well. When I started working on the company's code I've notice there is no use of the application object there for I've added the Ext.application({...}); call. Ext.application({ name: 'FOO', appFolder: 'appFolderName', launch: function() { console.log('application was created'); } }); Upon loading the page I see the console.log output that is included in the "launch" function property - meaning the application object is created but when I look for it ("FOO" object) under the "window" object it is not there. Compering to the tutorial code the application object exist as a property of window. I encounter a few loading problems but I'm guessing the source of it all is this issue. What am I doing wrong? thanks.

    Read the article

  • How to Implement the ImageAdapter for this listView Code?

    - by iDroid Explorer
    Code of Lost View is like: public final static String ITEM_TITLE = "title"; public final static String ITEM_CAPTION = "caption"; public Resources resources; public static Uri path; public static File file; public static ProgressDialog m_progressDialog; public static ListView list; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // create our list and custom adapter SeparatedListAdapter adapter = new SeparatedListAdapter(this); adapter.addSection("Local documents:", new ArrayAdapter<String>(this, R.layout.list_item, new String[] { "WindowsONE Mobile PK", "WindowsorONE Moldings","Filet for a burger video" })); adapter.addSection("Non-local resources:", new ArrayAdapter<String>(this, R.layout.list_item, new String[] { "Launch Photo slideshow link", "Dealer locator link" })); adapter.addSection("Send emails:", new ArrayAdapter<String>(this, R.layout.list_item, new String[] { "Send Dealer Locator email", "Send Catalog email","Send install instrucation link" })); //For extra Information in Listview //adapter.addSection("Non-local resources:", new SimpleAdapter(this, security, R.layout.list_complex, //new String[] { ITEM_TITLE, ITEM_CAPTION }, new int[] { R.id.list_complex_title, R.id.list_complex_caption })); list = getListView(); list.setAdapter(adapter); list.setTextFilterEnabled(true); list.setOnItemClickListener(this); } }

    Read the article

  • j2me PushRegistry.RegisterAlarm and code signing

    - by Mihir
    I am developing an app on Nokia C2-00 in which I am using push registry for auto start of app on some fixed time ex. PushRegistry.registerAlarm("ClassName", alarm.getTime()); this is working perfect and it starts app on that time. But this is asking me for permissions two times. 1) when I am registering alarm using PushRegistry.registerAlarm("ClassName", alarm.getTime()); 2) when app start on that defined time. in this and this link I found that if my application is signed then it will not ask for permission when app autostart. but I am not sure about the time when my code will register alarm. Will it ask for permission or not?

    Read the article

  • Visual Studio Lightswitch Beta2

    - by Elmex
    What are your experiences with Beta2 of Visual Lightswitch? Can it already be used for real life projects? Does anybody know, when the final (RTM) version will be out? I am very intersting in using Lightswitch in the future for RAD, but I am a litte bit self-conscious, if the tool is flexible enough for my dividual requirements and if a Lightswitch solution can be extended with own code !? Can it be mixed with "normal" Silverlight?

    Read the article

  • Invoke or BeginInvoke cannot be called on a control until the window handle has been created

    - by blade3
    I am trying to install SQL Server 2008 Developer Edition x64 on a Windows Server 2008 VM. I run the installer for a standalone installation and this works fine for the setup support rules bit. That passes ok but then I get this error: TITLE: SQL Server Setup failure. SQL Server Setup has encountered the following error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.. BUTTONS: OK How can I resolve this? I am getting 2008 R2 CTP but this is just a CTP. My download is from DreamSpark. Thanks

    Read the article

  • sessions get destroyed after return from sage gateway

    - by hussain
    I have developed a module using SagePay Form integration method. It works fine until it returns from the Sagepay site and all of my local user session vars are destroyed for some reason.Thus i am unable to use my own created session vars and save information about a user regarding that specific order. The url's it returns to are success and failure urls. What might be the possible reason? Please any help is appreciated. Regards.

    Read the article

  • Getting w3validation error

    - by Dinesh
    I am trying to validate my page and getting the following w3 validation error for the following line, <li ><a href="javascript:void(0);"title="Test 33">Test 33</a> - attributes construct error - Couldn't find end of Start Tag a line ..... - Opening and ending tag mismatch: li line ... and a I am using following doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Whats wrong with code ? Kindly advice on this.

    Read the article

  • Android: How to put ListView in XML?

    - by FloIancu
    I want to make a simple app that shows a list of contacts (name, surname). My code: package lista.android; import java.util.*; import android.app.ListActivity; import android.os.Bundle; import android.widget.*; class Contact{ String nume; String prenume; Contact(String nume, String prenume){ this.nume=nume; this.prenume=prenume; } public String toString(){ return prenume +" "+ nume; } } public class Lista1Activity extends ListActivity { /** Called when the activity is first created. */ ArrayList <Contact> lista; ArrayAdapter <Contact> adaptor; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setListAdapter(adaptor); lista=new ArrayList<Contact>(); adaptor=new ArrayAdapter<Contact>(this, R.id.element, lista); adaugaContact("Florian", "Iancu"); adaugaContact("Ioana", "Constantina"); } public void adaugaContact(String nume, String prenume){ lista.add(new Contact(nume, prenume)); adaptor.notifyDataSetChanged(); } } In the XML I have the LinearLayout and a TextView that is the list element. When I run it, the simulator says "Sorry, the application [...] has stopped unexpectedly. Please try again." The LogCat tells me I have to have a ListView whose id is android.R.id.lista. If I create a random ListView field in the XML file and give it the "lista" id, it still doesn't work. How to I call that ListView from XML to match something in my Java code? In other words, I know I'm wrong, but where and how do I fix it?

    Read the article

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