Daily Archives

Articles indexed Thursday May 31 2012

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

  • 3d js map rendering

    - by gotha
    In the past I've done a 2D tile map using HTML, CSS and Javascript. Now I have the task of creating a 3D version using the same technologies - think of it like a space map where all planets have x/y/z positions. Currently, I have no idea to do this. Is there an existing library or something I can modify to do my job? If not, what method of rendering the map should I use? It needs to be as browser independent as possible, so I can't use webgl, flash or canvas. I'm considering plain JS & HTML or SVG (using Raphael for compatibility).

    Read the article

  • ManyToOne annotation fails with Hibernate 4.1: MappingException

    - by barelas
    Using Hibernate 4.1.1.Final. When I try to add @ManyToOne, schema creation fails with: org.hibernate.MappingException: Could not instantiate persister org.hibernate.persister.entity.SingleTableEntityPersister User.java: @Entity public class User { @Id private int id; public int getId() {return id;} public void setId(int id) {this.id = id;} @ManyToOne Department department; public Department getDepartment() {return department;} public void setDepartment(Department department) {this.department = department;} } Department.java @Entity public class Department { @Id private int departmentNumber; public int getDepartmentNumber() {return departmentNumber;} public void setDepartmentNumber(int departmentNumber) {this.departmentNumber = departmentNumber;} } hibernate.properties: hibernate.connection.driver_class=com.mysql.jdbc.Driver hibernate.connection.url=jdbc:mysql://localhost:3306/dbname hibernate.connection.username=user hibernate.connection.password=pass hibernate.connection.pool_size=5 hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect hibernate.hbm2ddl.auto=create init (throwing exception): ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().buildServiceRegistry(); sessionFactory = new MetadataSources( serviceRegistrY.addAnnotatedClass(Department.class).addAnnotatedClass(User.class).buildMetadata().buildSessionFactory(); exception throwed at init: org.hibernate.MappingException: Could not instantiate persister org.hibernate.persister.entity.SingleTableEntityPersister at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:174) at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:148) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:820) at org.hibernate.metamodel.source.internal.SessionFactoryBuilderImpl.buildSessionFactory(SessionFactoryBuilderImpl.java:65) at org.hibernate.metamodel.source.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:340) I have tried adding some other annotations, but shouldn't the defaults work and create the tables and foreign key? If I remove the department from User, tables get generated fine. Thanks in advance!

    Read the article

  • Post data to MVC3 controller without pagerefresh

    - by Smooth
    I have this script that basically has 4 select boxes, what I want is that for the 2 top select boxes, he submits the optionvalue that is selected to an action (which can be found at "ProductKoppeling/ProductKoppelingPartial"), I want to let him submit this data when I click on an option but without page refresh. I tried JSON and I tried Ajax, but I didn't get it working.. How should i do this? <script language="javascript" type="text/javascript"> function delete_1() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_1').value = '5'; document.getElementById('hpg_submit').submit(); } } function delete_2() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_2').value = '6'; document.getElementById('pg_submit').submit(); } } function delete_3() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_3').value = '6'; document.getElementById('p_submit').submit(); } } </script> <div style="width: 500px; float: left;"> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "onload_submit" })) { @Html.DropDownList("Klant.Id", (ViewBag.Klant as SelectList), new { onchange = "document.getElementById('onload_submit').submit()" }) } <div style="clear: both"></div> <div style="float: left;"> <b>Hoofdgroepen</b><br /> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "hpg_submit" })) { if (ViewBag.SelectedKlant != null) { <input type="hidden" name="Klant.Id" value="@ViewBag.SelectedKlant.Id" /> } <select style="width: 200px;" size="6" id="HoofdProductGroep" name="HoofdProductGroep.Id" onchange="document.getElementById('hpg_submit').submit();"> @foreach (var hpg in ViewBag.HoofdProductGroep) { if (ViewBag.SelectedHPG != null) { if (hpg.Id == ViewBag.SelectedHPG.Id) { <option value="@hpg.Id" selected="selected">@hpg.Naam</option> } else { <option value="@hpg.Id">@hpg.Naam</option> } } else { <option value="@hpg.Id">@hpg.Naam</option> } } </select> <input type="hidden" name="Actie" id="Actie_1" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_1').value='1';document.getElementById('hpg_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_1').value='2';document.getElementById('hpg_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_1()" /> } </div> <div style="float: right;"> <b>Groepen</b><br /> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "pg_submit" })) { if (ViewBag.SelectedHPG != null) { <input type="hidden" name="HoofdProductGroep.Id" value="@ViewBag.SelectedHPG.Id" /> } if (ViewBag.SelectedKlant != null) { <input type="hidden" name="Klant.Id" value="@ViewBag.SelectedKlant.Id" /> } <select size="6" style="width: 200px;" id="ProductGroep_Id" name="ProductGroep.Id" onchange="document.getElementById('pg_submit').submit();"> @foreach (var pg in ViewBag.ProductGroep) { if (ViewBag.SelectedPG != null) { if (pg.Id == ViewBag.SelectedPG.Id) { <option value="@pg.Id" selected="selected">@pg.Naam</option> } else { <option value="@pg.Id">@pg.Naam</option> } } else { <option value="@pg.Id">@pg.Naam</option> } } </select> <input type="hidden" name="Actie" id="Actie_2" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_2').value='3';document.getElementById('pg_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_2').value='4';document.getElementById('pg_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_2()" /> } </div> <div style="clear: both; height: 25px;"></div> @using (Html.BeginForm("Save", "ProductKoppeling", FormMethod.Post, new { id = "p_submit" })) { <div style="float: left"> <b>Producten</b><br /> <select size="18" style="width: 200px;" name="Product.Id"> @foreach (var p in ViewBag.Product) { <option value="@p.Id">@p.Naam</option> } </select> @if (ViewBag.SelectedPG != null) { if (ViewBag.SelectedPG.Id != null) { <input type="hidden" name="ProductGroep.Id" value="@ViewBag.SelectedPG.Id" /> } } <input type="hidden" name="Actie" id="Actie_3" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_3').value='1';document.getElementById('p_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_3').value='2';document.getElementById('p_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_3()" /> <br /> </div> <div style="float: left; width: 100px;"> <center> <br /><br /><br /><br /> <a style="cursor: pointer; float: none; color: blue; font-size: 30px;" onclick="document.getElementById('p_submit').submit();">»</a> <br /><br /><br /><br /><br /><br /><br /><br /><br /> <a style="cursor: pointer; float: none; color: blue; font-size: 30px;" onclick="document.getElementById('pgp_submit').submit();">«</a> </center> </div> } <div style="float: right;"> <b>Producten in groepen</b><br /> @using (Html.BeginForm("Delete", "ProductKoppeling", FormMethod.Post, new { id = "pgp_submit" })) { <select size="18" style="width: 200px;" name="ProductGroepProduct.Id"> @foreach (var pgp in ViewBag.ProductGroepProduct) { if (pgp != null) { if (pgp.Product != null) { <option value="@pgp.Id">@pgp.Product.Naam</option> } } } </select> } </div>

    Read the article

  • Regular Expression Pattern for C# with matches

    - by Sumit Gupta
    I am working on project where I need to find Frequency from a given text. I wrote a Regular expression that try to detect frequency, however I am stuck with how C# handle it and how exactly I use it in my software My regular experssion is (\d*)(([,\.]?\s*((k|m)?hz)*)|(\s*((k|m)?hz)*))$ And I am trying to find value from 23,2 Hz 24,4Hz 25,0 Hzsadf 26 Hz 27Khz 28hzzhzhzhdhdwe 29 30.4Hz 31.8 Hz 4343.34.234 Khz 65SD Further Explanation: System needs to work for US and Belgium Culture hence, 23.2 (US) = 23,2 (Be) I try to find a Digit, followed by either khz,mhz,hz or space or , or . If it is , or . then it should have another Digit followed by khz, mhz, hz Any help is appericated.

    Read the article

  • MYSQ request | GROUP BY DAY

    - by user889349
    I have a table: orders, and need to make a request and get other table. My DB table: id close 1 2012-05-29 03:11:15 2 2012-05-30 03:11:40 3 2012-05-31 03:12:10 4 2012-05-31 03:14:13 5 2012-05-31 03:16:50 6 2012-05-31 03:40:07 7 2012-05-31 05:22:18 8 2012-05-31 05:22:22 9 2012-05-31 05:22:50 ... I need to make a request and get this table (GROUP BY DAY(close)): 1 2012-05-29 03:11:15 2 2012-05-30 03:11:40 9 2012-05-31 05:22:50 /*This is a last record on this day (05-31)*/ Thanks!

    Read the article

  • Chrome Extension contenteditable get and set caret position

    - by jwize
    I am creating an extension where I need to insert a link into the gmail window. I am able to create a simple extension button in the top of the window and execute code that does replaces all the links. Now, I want to do add links in the contenteditable section as I type. It seems like there should be a simple way to replace text with a link in the document object model. If this is not true I need to do three things. Insert text from the current caret position Capture the caret position. Set the caret position by its offset. I have tried using window.getSelection within the gmail context(that is a body element that is set to contenteditable and embedded inside an iframe in the gmail tab) to get the current range and position. The selection is always empty and contains no ranges regardless of whether text is selected or not.

    Read the article

  • jQuery panels - close one when opening another

    - by justme
    I have two slide panel in the same page. Need that, when one is open and the and user clicks on the other one, that makes, at the same time, close the first one when opening the second. Now they are overlapping... Can you help me, please? thanks This is what i have on the page: I have two slide panel in the same page. Need that, when one is open and the and user clicks on the other one, that makes, at the same time, close the first one when opening the second. Now they are overlapping... Can you help me, please? thanks This is what i have on the page <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".btn-slide").click(function(){ $("#panel").slideToggle('fast'); $("#panel2").slideToggle("fast"); $(this).toggleClass("active"); }); }); $(document).ready(function(){ $(".btn-slide2").click(function(){ $("#panel2").slideUp('fast'); $("#panel").slideToggle("fast"); $(this).toggleClass("active"); }); </script>

    Read the article

  • Web Services c#, Sending notifications Clients

    - by Diode
    I want to send a notification (say a string) to subscribers(subscribers ip addresses are in a database on the server side) by calling another method. when ever I call that method the output becomes error-some. [WebMethod] public string GetGroupPath(string emailAddress, string password, string ipAddress) { //SqlDataAdapter dbadapter = null; DataSet returnDS = new DataSet(); string groupName = null; string groupPath = null; SqlConnection dbconn = new SqlConnection("Server = localhost;Database=server;User ID = admin;Password = password;Trusted_Connection=false;"); dbconn.Open(); SqlCommand cmd = new SqlCommand(); string getGroupName = "select users.groupname from users where emailaddress = "+"'"+ emailAddress+"'"+ " and "+ "users.password = " + "'" +password+"'"; cmd.CommandText = getGroupName; cmd.Connection = dbconn; SqlDataReader reader = null; try { reader = cmd.ExecuteReader(); while (reader.Read()) { groupName = reader["groupname"].ToString(); } } catch (Exception) { groupPath = "Invalied"; } dbconn.Close(); dbconn.Open(); if (groupName != null) { string getPath = "select groups.grouppath from groups where groupname = " + "'" + groupName + "'"; cmd.CommandText = getPath; cmd.Connection = dbconn; try { reader = cmd.ExecuteReader(); while (reader.Read()) { groupPath = reader["grouppath"].ToString(); } } catch { groupPath = "Invalied"; } } else groupPath = "Invalied"; dbconn.Close(); if (groupPath != "Invalied") { dbconn.Open(); string getPath = "update users set users.ipaddress = "+"'"+ipAddress+"'"+" where users.emailaddress = " + "'" + emailAddress + "'"; cmd.CommandText = getPath; cmd.Connection = dbconn; cmd.ExecuteNonQuery(); dbconn.Close(); } NotifyUsers(); //NotifyUsers nu = new NotifyUsers(); //List<string> ipList = new List<string>(); //ipList.Add("192.168.56.1"); //nu.Notify(); return groupPath; } private void NotifyUsers() { Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); byte[] ipb = Encoding.ASCII.GetBytes("255.255.255.255"); IPAddress ipAddress = new IPAddress(ipb); IPEndPoint endPoint = new IPEndPoint(ipAddress, 15000); string notification = "new_update"; byte[] sendBuffer = Encoding.ASCII.GetBytes(notification); sock.SendTo(sendBuffer, endPoint); sock.Close(); } This is what has to be basically done. in the server side I have a listening thread and it gets notification when the server sends data( assume for now the database contains client ip address). then ever I call the web method it gives a error "invalid IPAddress" atline byte[] ipb = Encoding.ASCII.GetBytes("255.255.255.255"); thank you :) since this is my first ever post please be kind enough to give me a better feedback too :) thaks

    Read the article

  • In MySql Stored Procedure updating more than one time

    - by Both FM
    In MySql UPDATE `inventoryentry` SET `Status` = 1 WHERE `InventoryID`=92 AND `ItemID`=28; It successfully update only one row , where inventoryID = 92 and itemID=28 , the following message displayed. 1 row(s) affected when I put this on stored procedure, as follow CREATE DEFINER=`root`@`localhost` PROCEDURE `Sample`(IN itemId INT, IN itemQnty DOUBLE, IN invID INT) BEGIN DECLARE crntQnty DOUBLE; DECLARE nwQnty DOUBLE; SET crntQnty=(SELECT `QuantityOnHand` FROM `item` WHERE id=itemId); SET nwQnty=itemQnty+crntQnty; UPDATE `item` SET `QuantityOnHand`=nwQnty WHERE `Id`=itemId; UPDATE `inventoryentry` SET `Status` = 1 WHERE `InventoryID`=invID AND `ItemID`=itemId; END$$ calling stored procedures CALL Sample(28,10,92) It update all the status = 1 in inventoryentry against InventoryID (i.e. 92) ignoring ItemID, instead of updating only one row. The following message displayed! 5 row(s) affected Why Stored procedure ignoring itemID in update statement ? or Why Stored procedure updating more than one time? But without Stored procedure it working fine.

    Read the article

  • Force external function to be const

    - by vanna
    Here is my problem. I made a class with a member function declared as const that uses an external function that I cannot modify (declared in someone else's code) and that is not declared const. More precisely Someone else's code class B { public: void foo(); }; My code class A : public B { public: void bar() const { this->foo(); } }; I know that for member data we can force const-correctness by using mutable or const_cast. How can I 'hack' foo such that my compiler understands that I would like to use it as if it was const even if it is not declared in someone else's code ?

    Read the article

  • Calculate the SUM of the Column which has Time DataType:

    - by thevan
    I want to calculate the Sum of the Field which has Time DataType. My Table is Below: TableA: TotalTime ------------- 12:18:00 12:18:00 Here I want to sum the two time fields. I tried the below Query SELECT CAST( DATEADD(MS, SUM(DATEDIFF(MS, '00:00:00.000', CONVERT(TIME, TotalTime))), '00:00:00.000' ) AS TOTALTIME) FROM [TableA] But it gives the Output as TOTALTIME ----------------- 00:36:00.0000000 But My Desired Output would be like below: TOTALTIME ----------------- 24:36:00 How to get this Output?

    Read the article

  • Android USB Host Communication

    - by Kip Russell
    I'm working on a project that utilizes the USB Host capabilities in Android 3.2. I'm suffering from a deplorable lack of knowledge and talent regarding USB/Serial communication in general. I'm also unable to find any good example code for what I need to do. I need to read from a USB Communication Device. Ex: When I connect via Putty (on my PC) I enter: >GO And the device starts spewing out data for me. Pitch/Roll/Temp/Checksum. Ex: $R1.217P-0.986T26.3*60 $R1.217P-0.986T26.3*60 $R1.217P-0.987T26.3*61 $R1.217P-0.986T26.3*60 $R1.217P-0.985T26.3*63 I can send the initial 'GO' command from the Android device at which time I receive an echo of 'GO'. Then nothing else on any subsequent reads. How can I: 1) Send the 'go' command. 2) Read in the stream of data that results. The USB device I'm working with has the following interfaces (endpoints). Device Class: Communication Device (0x2) Interfaces: Interface #0 Class: Communication Device (0x2) Endpoint #0 Direction: Inbound (0x80) Type: Intrrupt (0x3) Poll Interval: 255 Max Packet Size: 32 Attributes: 000000011 Interface #1 Class: Communication Device Class (CDC) (0xa) Endpoint #0 Address: 129 Number: 1 Direction: Inbound (0x80) Type: Bulk (0x2) Poll Interval (0) Max Packet Size: 32 Attributes: 000000010 Endpoint #1 Address: 2 Number: 2 Direction: Outbound (0x0) Type: Bulk (0x2) Poll Interval (0) Max Packet Size: 32 Attributes: 000000010 I'm able to deal with permission, connect to the device, find the correct interface and assign the endpoints. I'm just having trouble figuring out which technique to use to send the initial command read the ensuing data. I'm tried different combinations of bulkTransfer and controlTransfer with no luck. Thanks. I'm using interface#1 as seen below: public AcmDevice(UsbDeviceConnection usbDeviceConnection, UsbInterface usbInterface) { Preconditions.checkState(usbDeviceConnection.claimInterface(usbInterface, true)); this.usbDeviceConnection = usbDeviceConnection; UsbEndpoint epOut = null; UsbEndpoint epIn = null; // look for our bulk endpoints for (int i = 0; i < usbInterface.getEndpointCount(); i++) { UsbEndpoint ep = usbInterface.getEndpoint(i); Log.d(TAG, "EP " + i + ": " + ep.getType()); if (ep.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) { if (ep.getDirection() == UsbConstants.USB_DIR_OUT) { epOut = ep; } else if (ep.getDirection() == UsbConstants.USB_DIR_IN) { epIn = ep; } } } if (epOut == null || epIn == null) { throw new IllegalArgumentException("Not all endpoints found."); } AcmReader acmReader = new AcmReader(usbDeviceConnection, epIn); AcmWriter acmWriter = new AcmWriter(usbDeviceConnection, epOut); reader = new BufferedReader(acmReader); writer = new BufferedWriter(acmWriter); }

    Read the article

  • Using SDL Tridion 2011 Core Service to create Components programatically

    - by user1428019
    I have seen some of the questions/answers related to this topic here, however still I am not getting the suggestion which I want. So I am posting my question again here, and I would be thankful for your valuable time and answers. I would like to create “Component, Page, SG, Publication, Folders “ via programmatically in SDL Tridion Content Manager, and later on, I would like to add programmatically created components in Page and attach CT,PT for that page, and finally would like to publish the page programmatically. I have done these all the activities in SDL Tridion 2009 using TOM API (Interop DLL's), and I tried these activities in SDL Tridion 2011 using TOM.Net API. It was not working and later on I came to know that, TOM.Net API will not support these kinds of works and it is specifically only for Templates and Event System. And finally I came to know I have to go for Core services to do these kinds of stuffs. My Questions: When I create console application to create component programmatically using core service, what are the DLL’s I have to add as reference? Earlier, I have created the exe and ran in the TCM server, the exe created all the stuffs, can I used the same approach using core services too? Will it work? Is BC still available or Core Service replaced BC? (BC-Business Connector) Can anyone send some code snippet to create Component/Page (complete class file will be helpful to understand better) Thanks Jai

    Read the article

  • Html.ActionLink in a button

    - by Pomster
    I Am trying to connect to a method in my controller, with a button. I can connect though this link: @Html.ActionLink("Print", "Print", new { id = Model.SalesContractId}) But i Don't want a link, i want my button on my dialog to do it. I have tried the following: $('#btnDialogPrint').click(function () { location.href = '<%= Url.Action("Print", "Print", new { id = Model.SalesContractId}) %>'; }); But it just redirect me to a page that say bad request. namespace Contract.Controllers { public class ContractController : Controller { CompassEntities db = new CompassEntities(); public ActionResult Print(int id) { return View(""); // This can be removed and Print code may be added } Don't worry about the code inside i will get to that once i get inside this method. Could i maybe attach a link here? <input type="button" value="Print" id="btnDialogPrint" />

    Read the article

  • i want to show a panel just like facebook or for captcha validation

    - by Lokesh
    i have a simple form and when user enters all the information and hits the submit botton than a panel should open just a width of 200px and height of 100px inside the same window. which should have two fields one is captcha image and a text box and a check botton and if captcha code is right than panel should automatically close and redirect to another page just like facebook . all the details of the panel is saved on another php file.

    Read the article

  • Contact Bubble EditText

    - by toobsco42
    I am trying to create contact bubbles in the MultiAutoCompleteTextView similiar to how it is implemented in the Google+ app. Below is a screen shot: . I have tried to extend the DynamicDrawableSpan class in order to get a spannable drawable in the background of a span of text public class BubbleSpan extends DynamicDrawableSpan { private Context c; public BubbleSpan(Context context) { super(); c = context; } @Override public Drawable getDrawable() { Resources res = c.getResources(); Drawable d = res.getDrawable(R.drawable.oval); d.setBounds(0, 0, 100, 20); return d; } } Where my oval.xml drawable is defined as so: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#00000000"/> <stroke android:width="4dp" android:color="#99000000" android:dashWidth="4dp" android:dashGap="2dp" /> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="4dp" /> </shape> In my Activity class that has the MulitAutoCompleteTextView, I set the bubble span like so: final Editable e = tv.getEditableText(); final SpannableStringBuilder sb = new SpannableStringBuilder(); sb.append("some sample text"); sb.setSpan(new BubbleSpan(getApplicationContext()), 0, 6, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); e.append(sb); However, instead of the oval shape displaying behind the first 6 characters in the string, the characters are not visible and there is no oval drawable in the background. If i change the BubbleSpan's getDrawable() method to use a .png instead of a shape drawable: public Drawable getDrawable() { Resources res = c.getResources(); Drawable d = res.getDrawable(android.R.drawable.bottom_bar); d.setBounds(0, 0, 100, 20); return d; } Then the .png will show up but the characters in the string that are a part of the span will not show up. How can I make it so that the characters in the span are displayed in the foreground, meanwhile a custom shape drawable gets displayed in the background? I attempted to also use an ImageSpan instead of subclassing DynamicDrawableSpan but was unsuccessful.

    Read the article

  • unix How to compare two files and get results to third file?

    - by Martin Mocik
    I have two files 1st file is like this: www.example.com www.domain.com www.otherexample.com www.other-domain.com www.other-example.com www.exa-ample.com 2nd file is like this (numbers after ;;; are between 0-10): www.example.com;;;2 www.domain.com;;;5 www.other-domain;;;0 www.exa-ample.com;;;4 and i want compare these two files and output to third file like this: www.otherexample.com www.other-example.com Both files have large size (over 500mb)

    Read the article

  • How to prevent autoplay and run my own app when inserting an USB-Flash drive

    - by Thomas
    when inserting an USB-Flash drive, Windows normally opens the Autoplay dialog that offers to browse the drive or if there are multimedia files it offers to choose an app to open them. We developed a media player that is connected to the USB-Drive and registers itself as Mass Storage Device. What I need is, that when inserting the Player that this Dialog is not shown, but instead my own application is launched. Ideally the application would be on the Flash Drive itself, but as I understood is that Autorun is disabled for USB-Drives. It would be enough if a preinstalled application is launched. I already tried to catch the WM_DRIVE_CHANGE message, but this only works if my application is the top most window, otherwise the Autoplay Dialog is displayed. Best Tom

    Read the article

  • Magento: Deduct Tax at Checkout for (most) countries

    - by towerofbabel
    I am working on a UK fashion store. The customer has a specific requirement - never add tax (VAT) at checkout; rather, have VAT built into the price, and deduct when applicable. The use case is that EU purchases will have no tax added at checkout - as the price includes it. And, rest of the world purchases will have the VAT deducted at the checkout. I can't see how to do this in Magento. I though to set up some negative values for tax rates, but that doesn't work. Any ideas?

    Read the article

  • untar from run command in fibre

    - by Shah.Bhavesh
    i want to untar file from source to destination with below statement `def untar(source,destination): run("tar -xf {0} {1}".format(source,destination)) ` i am getting Error C:\Users\test\Desktop\fabric>fab -H user@host-p pass untar:source =/shared/sample.tar,destination=/home/ Traceback (most recent call last): File "C:\Users\shasmukh\AppData\Roaming\Python\Python27\site-packages\fabric\m ain.py", line 630, in main docstring, callables, default = load_fabfile(fabfile) File "C:\Users\shasmukh\AppData\Roaming\Python\Python27\site-packages\fabric\m ain.py", line 163, in load_fabfile imported = importer(os.path.splitext(fabfile)[0]) File "C:\Users\shasmukh\Desktop\fabric\fabfile.py", line 11 def copy(source,destination) ^ SyntaxError: invalid syntax

    Read the article

  • Java Wicket - Calling javascript ( JQuery ) before AJAX

    - by user1428051
    I got this thing i'm trying to solve: I got a ListView created using Wicket ( 1.5 ) with a lot of elements and a scroll. When new items are available, the user is asked if he would like to refresh the list via a message backed by an AjaxLink: public void onClick(AjaxRequestTarget ajaxTarget) { /* do something ... */ ajaxTarget.addComponent(_list); } So on click the list gets reloaded and the scroll position is reset to zero. Is there any way i can call JavaScript before the list reloads the save the scroll position? (I know how to get/save the scroll position ( .scrollTop() ) , i just don't know how to call a function right before AJAX ).

    Read the article

  • Cross-Platform Mobile Development With Mono for Android and MonoTouch

    - by Wallym
    Many years ago, in fact pre-Java, I remember a hallway discussion about the desire to write a single application that could easily run across various platforms. At the time, we were only worried about writing applications on Windows 3.1 and Mac OS 7.x. There were many discussions about windows, user interface concepts, and specifically a rather long discussion as to whether Mac users would accept a Mac application that didn't have balloon help. Thankfully, the marketplace answered this question for us with the Windows API winning the battle.A similar set of questions is currently going on in the mobile world. Unfortunately, at this point in time, there is currently no winning API and none currently in sight. What's a developer to do? Here are some questions that developers have (and there are many more):How can mobile developers target Android and the iPhone with the same code?How can .NET developers share their code across Android, iPhone and other platforms?How can developers give applications the look and feel of the specific platform and still allow as much code as possible to be shared?Mobile devices share many common features, such as cameras, accelerometers, and address books. How can we take advantage of them in a platform independent way and still give the users the look of every other application running on their platform?In this article, we'll look at some solutions to these cross-platform and code-sharing questions between Mono for Android, MonoTouch and the .NET Framework available to developers. 

    Read the article

  • Remote debugging revisited

    - by Fabrice Marguerie
    ConsolR is a nice little add-on for your ASP.NET projects that you can use to play with your live applications.ConsolR enables you to execute C# code againt a running .NET 4.0 web application's app domain through a browser. Once installed, ConsolR will automatically configure itself during application start and is accessible through the "/consolr" path. This enables an interactive console session against for instance an application's production environment. IntroductionProject site

    Read the article

  • F5 Big-IP iRule - HTTP Redirect

    - by djo
    I have just started to work with F5's Big-IP and I have a question about iRules and HTTP redirects. We are moving to offload our SSL from our web servers and onto the F5, our application as it stands enforces a number of pages on our site to only run in HTTPS. I want to move this from the APP and onto the F5 but I have not been able to figure our how, so as an example I would want anyone trying to login in to be forced to use HTTPS e.g. http://"mysite"/login.aspx = https://"mysite"/login.aspx. I have done some google searches that have come up with some good info on this but I have yet to find what I am looking for, if anyone has done this and wishes to share this with me that would be great

    Read the article

  • How to match a string in URI with regular expression?

    - by forestclown
    In my Apache config httpd.conf, I wish to setup a rule like below SetEnvIfNoCase %{QUERY_STRING} ^.*(getBook+)$ no-gzip dont-vary I am hoping to do no-gzip when my URL looks like http://myurl.fake.com/book/getBook3?id=234 http://myurl.fake.com/book/getBook1?id=xxx I am not sure if I can do that by setting up something like the above in httpd.conf.. The reason I do query string is because the url myurl.fake.com/book/getBook3 was mod_rewrite from myurl.fake.com/index.php?controller=book&action=getBook3 Thanks!

    Read the article

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