Daily Archives

Articles indexed Monday May 17 2010

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

  • Rotate a feature Image in Open Layers - ReApply StyleMap to layer.

    - by Ozaki
    I have an open layers map. It adds and removes my "imageFeature" every 10secs or so. I have a JSON feed that gives me the rotation that I need, I have a request to get that rotation and set it as a variable of rotationv. Everything works but the fact when the image is recreated it does not update the rotation. My code is as follows: JSON request: var rotationv = (function () { rotationv = null; $.ajax({ 'async': false, 'global': true, 'url': urldefault, 'dataType': "json", 'success': function (data) { rotationv = data.rotation; } }); return rotationv })(); Creating image feature: imageFeature = new OpenLayers.Feature.Vector( new OpenLayers.Geometry.Point(mylon, mylat), { rotation: rotationv } ); The image is set in the styling elsewhere. Why does this not rotate my image? Debugging with firebug I now notice that "rotationv" is updating as per it should be. But when the point is destroyed then added again it does not apply the new rotation... Add: I realised that the "image" is applied as per the layer. So I need to figure out how to re apply the stylemap to the layer so it will trigger the "update" on the page. //redefine layer 2 so it can be updated - test.js is just a 0.0 ref// var layer2 = new OpenLayers.Layer.GML("Layer 2", "test.js", { format: OpenLayers.Format.GeoJSON, styleMap: styleMap }); But even if I add the above into my function still no luck. Included map.addLayers([layer2]); into the function as well. Edit: Attaching stylemap: var styleMap = new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ rotation: rotationv, labelXOffset: "0", labelYOffset: "-15", graphicZIndex: 1 }) });

    Read the article

  • Fail to load NPAPI plugin in Google Chrome on Mac OS X

    - by Roman
    I have been trying to get Google Chrome (6.0.401.1 dev) on Mac OS X to load an NPAPI plugin without success so far. I have been working around the npsimple example from here: http://git.webvm.net/?p=npsimple. Using gcc on Mac and VC++ 2008 on Windows I managed to get it running on Safari and Firefox on Mac OS X and Firefox and Google Chrome on Windows, but not on Google Chrome on Mac OS X. When trying to debug Google Chrome on Mac OS X it seemed Google Chrome was briefly dyld-loading (and immediately dyld-unloading) the plugin on startup, but without actually looking-up any symbols within the plugin or calling any of the functions. It seemed to be doing that for every plugin, though. Also, when loading a page with the embed-tag for the plugin, Google Chrome did not seem to even dyld-load the plugin and no functions were called (not even NP_GetEntryPoints). Google Chrome also does not output any error message, it just simply does not load the plugin. I am not sure I caught everything with gdb because of Google Chrome using different processes, but I have also tried all the switches like --no-sandbox, --single-process and --plugin-startup-dialog (which incidentally does not seem to work at all on Mac OS X). I also made sure the architecture of the binary matches (i.e. 32-bit for Google Chrome). Has anybody had similar problems before? Is there anything I am missing here, like a gcc switch when compiling or something? Any help would be greatly appreciated.

    Read the article

  • Crystal report sql expression field

    - by Domnic
    im using asp.net crystal report and this is sql query CONVERT(NUMERIC(8, 2), CASE WHEN CASE WHEN GLDD_DOC_AMOUNT 0 THEN GLDD_DOC_AMOUNT ELSE 0 END = 0 THEN NULL ELSE CASE WHEN GLDD_DOC_AMOUNT 0 THEN GLDD_DOC_AMOUNT ELSE 0 END END) Q3_DR, CONVERT(NUMERIC(8, 2), CASE WHEN (- 1 * CASE WHEN GLDD_DOC_AMOUNT < 0 THEN GLDD_DOC_AMOUNT ELSE 0 END) = 0 THEN NULL ELSE - 1 * CASE WHEN GLDD_DOC_AMOUNT < 0 THEN GLDD_DOC_AMOUNT ELSE 0 END END) Q3_CR, i want to write this query into crystal report sql expression field how can i convert this?

    Read the article

  • What are the rules for Javascript's automatic semicolon insertion?

    - by T.R.
    Well, first I should probably ask if this is browser dependent. I've read that if an invalid token is found, but the section of code is valid until that invalid token, a semicolon is inserted before the token if it is preceded by a line break. However, the common example cited for bugs caused by semicolon insertion is: return _a+b; which doesn't seem to follow this rule, since _a would be a valid token. On the other hand, breaking up call chains works as expected: $('#myButton') .click(function(){alert("Hello!")}); Does anyone have a more in-depth description of the rules?

    Read the article

  • LinkedList parameters in Java

    - by Walt
    Hi there, I created a program that contains linked lists that are passed various methods. While this works just fine in Java... a style checker program we have to use doesn't like it It says: Declaring variables, return values or parameters of type 'LinkedList' is not allowed. If I declare them as simply List then I don't have access to the methods I want. What should I do?

    Read the article

  • How to draw on JPanel on fixed position?

    - by kovike
    I have JPanel wrapped in JScrollPane and I want the rectangle to be drawn always on the same position = moving with scrollbars wont affect the visibility of the rectangle. I tried following code: public void paintComponent(Graphics g) { g.setColor(Color.red); g.drawRect(50, (int)getVisibleRect().getY(), 20 , 20); } but it only repaints the rectangle when size of whole JPanel is changed.

    Read the article

  • Google search ajax api is to restrictive. Any alternatives?

    - by boomhauer
    The google search ajax api is terrific, and the .net wrapper available on codeplex makes using it from a .net project very simple. However, the api itself is crippled so that it only returns 64 results per query. Not very useful for many applications. Ignoring the likely TOS problems, are there known .net libraries that can query the root google website and scrape the results into a resultset? I'm assuming this could result in much larger result counts than the ajax version enabled.

    Read the article

  • very strange thread error message

    - by John Smith
    I an trying to put a method in a separate thread in the background. It nearly works except that occasionally I get a lot of error messages with the message METHODCLOSURE: OH NO SEPERATE THREAD with the bad spelling and all. Does anyone know what this means?

    Read the article

  • iphone email link not selected correctly

    - by mongeta
    Hello, I'm creating a link to open my App and pass some data in the URL. When I add the query parameter ? my link get broken. NSData *fileData = [NSData dataWithContentsOfFile:dataFilePath]; NSString *encodedString = [GTMBase64 stringByWebSafeEncodingData:fileData padded:YES]; NSString *urlString = [NSString stringWithFormat:@"myApp://localhost/backup?%@", encodedString]; the link is quite long, but also a shorter one doesn't work: myApp://localhost/backup?PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48bG9jPjxpbmdyZWRpZW50VHlwZS and when the e-mail appears in the iPhone, only this is underlined and act as a link: myApp://localhost/ Adding the query as NeilInglis suggest it doesn't work also, the link is broken at same place. NSString *urlString = [NSString stringWithFormat:@"myApp://localhost/backup?query=%@", encodedString]; The Html is ON or OFF, it doesn't affect. If I enocode the URL it also doesn't work ... Don't know what I can try next ... any ideas ? thanks ... regards, r.

    Read the article

  • Access to DataTemplate Control of WPF Toolkit DataGridCell at Runtime, How?

    - by LukePet
    I have a DataGrid defined with WPF Toolkit. The CellEditingTemplate of this DataGrid is associated at runtime with a custom function that build a FrameworkElementFactory element. Now I have to access to control that is inserted inside DataTemplate of CellEditingTempleta, but I do not know how to do. On web I found a useful ListView Helper... public static class ListViewHelper { public static FrameworkElement GetElementFromCellTemplate(ListView listView, Int32 column, Int32 row, String name) { if (row >= listView.Items.Count || row < 0) { throw new ArgumentOutOfRangeException("row"); } GridView gridView = listView.View as GridView; if (gridView == null) { return null; } if (column >= gridView.Columns.Count || column < 0) { throw new ArgumentOutOfRangeException("column"); } ListViewItem item = listView.ItemContainerGenerator.ContainerFromItem(listView.Items[row]) as ListViewItem; if (item != null) { GridViewRowPresenter rowPresenter = GetFrameworkElementByName<GridViewRowPresenter>(item); if (rowPresenter != null) { ContentPresenter templatedParent = VisualTreeHelper.GetChild(rowPresenter, column) as ContentPresenter; DataTemplate dataTemplate = gridView.Columns[column].CellTemplate; if (dataTemplate != null && templatedParent != null) { return dataTemplate.FindName(name, templatedParent) as FrameworkElement; } } } return null; } private static T GetFrameworkElementByName<T>(FrameworkElement referenceElement) where T : FrameworkElement { FrameworkElement child = null; for (Int32 i = 0; i < VisualTreeHelper.GetChildrenCount(referenceElement); i++) { child = VisualTreeHelper.GetChild(referenceElement, i) as FrameworkElement; System.Diagnostics.Debug.WriteLine(child); if (child != null && child.GetType() == typeof(T)) { break; } else if (child != null) { child = GetFrameworkElementByName<T>(child); if (child != null && child.GetType() == typeof(T)) { break; } } } return child as T; } } this code work with the ListView object but not with the DataGrid object. How can use something like this in DataGrid?

    Read the article

  • User can't login after creating them with the asp.net Create User Wizard

    - by Xaisoft
    When I create a user, they can't login until I go into the asp.net configuration and save them. I actually don't change any settings, I just press the save button and then they can login in. What I would like to do is to have the user be able to login once they are created, but I can't seem to get it to work. Here is my code for the CreatedUser method: protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { CustomerProfile adminProfile = CustomerProfile.GetProfile(); string username = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName")).Text.Trim(); CustomerProfile createdUser = CustomerProfile.GetProfile(username); createdUser.CustomerID = adminProfile.CustomerID; createdUser.Save(); MembershipUser user = Membership.GetUser(username); user.IsApproved = ((CheckBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("chkActivateUser")).Checked; Roles.AddUserToRole(user.UserName, "nonadmin"); }

    Read the article

  • Securing a Windows Server 2008 R2 Public Web Server

    - by Denny Ferrassoli
    I'm setting up a public web server: Windows Server 2008 R2, IIS7.5. Does anyone have a tutorial / walkthrough / tips on properly securing a public web server? I've seen a few tutorials but mostly focused on Windows Server 2003. What I've done so far: Created a specific user account for the website / app pool, Renamed Admin account, Installed FTPS, Configured firewall to block any non-public service (web / https), Configured firewall to allow access to management interfaces only from specific IP addresses (rdp, IIS management, ftp) Maybe a few other things but can't remember at the moment... ICMP is allowed... Should I disable all except ping? Port scan reveals only web and https ports. Any other suggestions? Thanks

    Read the article

  • Are .dll files loaded once for every program or once for all programs?

    - by Nilbert
    I have a simple small question which someone who knows will be able to answer easily, I searched google but couldn't find the answer. There are many programs running at once on a computer, and my question is: when a program loads a DLL, does it actually load the DLL file or does it find the memory in which the DLL is already loaded? For example, is ws2_32.dll (winsock 2) loaded for every program that uses winsock, or is it loaded once and all programs that use it use the same memory addresses to call the functions?

    Read the article

  • Best and simple way to handle JSON in Django

    - by primal
    Hi, As part of the application we are developing (with android client and Django server) a json object which contains user name and pass word is sent to server from android client as follows HttpPost post = new HttpPost(URL); /*Adding key value pairs */ json.put("username", un); json.put("password", pwd); StringEntity se = new StringEntity(json.toString()); post.setEntity(se); response = client.execute(post); The response is parsed like this result = responsetoString(response.getEntity().getContent()); //Converts response to String jObject = new JSONObject(result); JSONObject post = jObject.getJSONObject("post"); username = post.getString("username"); message = post.getString("message"); Hope upto this everything is fine. The problem comes when parsing or sending JSON responses in Django server. Whats the best way to do this? We tried using SimpleJSON and it turned out not to be so simple as we didn't find any good tutorials or sample code for the same? Are there any python functions similiar to get,put and opt in java for JSON? Any help would be much appreciated..

    Read the article

  • What is wrong with my SQL syntax here?

    - by CT
    I'm trying to create a IT asset database with a web front end. I've gathered some data from forms using POST as well as one variable that had already written to a cookie. This is the first time I have tried to enter the data into the database. Here is the code: <?php //get data $id = $_POST['id']; $company = $_POST['company']; $location = $_POST['location']; $purchase_date = $_POST['purchase_date']; $purchase_order = $_POST['purchase_order']; $value = $_POST['value']; $type = $_COOKIE["type"]; $notes = $_POST['notes']; $manufacturer = $_POST['manufacturer']; $model = $_POST['model']; $warranty = $_POST['warranty']; //set cookies setcookie('id', $id); setcookie('company', $company); setcookie('location', $location); setcookie('purchase_date', $purchase_date); setcookie('purchase_order', $purchase_order); setcookie('value', $value); setcookie('type', $type); setcookie('notes', $notes); setcookie('manufacturer', $manufacturer); setcookie('model', $model); setcookie('warranty', $warranty); //checkdata //start database interactions // connect to mysql server and database "asset_db" mysql_connect("localhost", "asset_db", "asset_db") or die(mysql_error()); mysql_select_db("asset_db") or die(mysql_error()); // Insert a row of information into the table "asset" mysql_query("INSERT INTO asset (id, company, location, purchase_date, purchase_order, value, type, notes) VALUES('$id', '$company', '$location', '$purchase_date', $purchase_order', '$value', '$type', '$notes') ") or die(mysql_error()); echo "Asset Added"; // Insert a row of information into the table "server" mysql_query("INSERT INTO server (id, manufacturer, model, warranty) VALUES('$id', '$manufacturer', '$model', '$warranty') ") or die(mysql_error()); echo "Server Added"; //destination url //header("Location: verify_submit_server.php"); ?> The error I get is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '', '678 ', 'Server', '789')' at line 2 That data is just test data I was trying to throw in there, but it looks to be the at the $value, $type, $notes. Here are the table create statements if they help: <?php // connect to mysql server and database "asset_db" mysql_connect("localhost", "asset_db", "asset_db") or die(mysql_error()); mysql_select_db("asset_db") or die(mysql_error()); // create asset table mysql_query("CREATE TABLE asset( id VARCHAR(50) PRIMARY KEY, company VARCHAR(50), location VARCHAR(50), purchase_date VARCHAR(50), purchase_order VARCHAR(50), value VARCHAR(50), type VARCHAR(50), notes VARCHAR(200))") or die(mysql_error()); echo "Asset Table Created.</br />"; // create software table mysql_query("CREATE TABLE software( id VARCHAR(50) PRIMARY KEY, software VARCHAR(50), license VARCHAR(50))") or die(mysql_error()); echo "Software Table Created.</br />"; // create laptop table mysql_query("CREATE TABLE laptop( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), serial_number VARCHAR(50), esc VARCHAR(50), user VARCHAR(50), prev_user VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Laptop Table Created.</br />"; // create desktop table mysql_query("CREATE TABLE desktop( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), serial_number VARCHAR(50), esc VARCHAR(50), user VARCHAR(50), prev_user VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Desktop Table Created.</br />"; // create server table mysql_query("CREATE TABLE server( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Server Table Created.</br />"; ?> Running a standard LAMP stack on Ubuntu 10.04. Thank you.

    Read the article

  • Android Time&Date Picker

    - by vycon
    Hello, Is there any android widget that enable to pick the date and the time at the same time ? I already use the basic date picker and date picker: http://developer.android.com/guide/tutorials/views/hello-timepicker.html http://developer.android.com/guide/tutorials/views/hello-datepicker.html but they are not that sexy and user friendly (I found). Do you know if a widget including both date and time exists? Thanks a lot,WW.

    Read the article

  • Python: How do I create a reference to a reference?

    - by KCArpe
    Hi, I am traditionally a Perl and C++ programmer, so apologies in advance if I am misunderstanding something trivial about Python! I would like to create a reference to a reference. Huh? Ok. All objects in Python are actually references to the real object. So, how do I create a reference to this reference? Why do I need/want this? I am overriding sys.stdout and sys.stderr to create a logging library. I would like a (second-level) reference to sys.stdout. If I could create a reference to a reference, then I could create a generic logger class where the init function receives a reference to a file handle reference that will be overrided, e.g., sys.stdout or sys.stderr. Currently, I must hard-code both values. Cheers, Kevin

    Read the article

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