Daily Archives

Articles indexed Wednesday October 24 2012

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

  • Struct sockaddr, sin_family is not a member

    - by leon22
    According to this article from msdn ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms740496(v=vs.85).aspx) the struct varies depending on which protocol is selected! Now I want to use this code from http://www.intelliproject.net/articles/showArticle/index/check_tcp_udp_port to check if a port is open or not! Now I have the struct sockaddr as follows: struct sockaddr { ushort sa_family; char sa_data[14]; }; but need this strcuture: struct sockaddr { short sin_family; u_short sin_port; struct in_addr sin_addr; char sin_zero[8]; }; Which changes are necessary? (Ws2_32.lib is linked and following includes #define WIN32_LEAN_AND_MEAN // sockets #include "windows.h" #include <winsock2.h> #include <ws2tcpip.h> Thx

    Read the article

  • How to include a child object's child object in Entity Framework 5

    - by Brendan Vogt
    I am using Entity Framework 5 code first and ASP.NET MVC 3. I am struggling to get a child object's child object to populate. Below are my classes.. Application class; public class Application { // Partial list of properties public virtual ICollection<Child> Children { get; set; } } Child class: public class Child { // Partial list of properties public int ChildRelationshipTypeId { get; set; } public virtual ChildRelationshipType ChildRelationshipType { get; set; } } ChildRelationshipType class: public class ChildRelationshipType { public int Id { get; set; } public string Name { get; set; } } Part of GetAll method in the repository to return all the applications: return DatabaseContext.Applications .Include("Children"); The Child class contains a reference to the ChildRelationshipType class. To work with an application's children I would have something like this: foreach (Child child in application.Children) { string childName = child.ChildRelationshipType.Name; } I get an error here that the object context is already closed. How do I specify that each child object must include the ChildRelationshipType object like what I did above?

    Read the article

  • what is the relation between actual pixels and html(css) pixels in blackberry?

    - by HelpMeToHelpYou
    I am implementing one phonegap application. here everything going fine but when i am talking device specifications like 1)BlackBerry Bold Touch 9900 Screen specifications are as following Body Dimensions 115 x 66 x 10.5 mm (4.53 x 2.60 x 0.41 in) Weight 130 g (4.59 oz) Keyboard QWERTY Display Type TFT capacitive touchscreen, 16M colors Size 640 x 480 pixels, 2.8 inches (~286 ppi pixel density) But when i test following function in java script function findScreenSize() { alert("width:"+window.innerWidth +"Height:"+ window.innerHeight); } it displaying SIZE width : 356 Height : 267 (356 x 267) 2)BlackBerry Bold Touch 9930 Screen specifications are as following Body Dimensions 115 x 66 x 10.5 mm (4.53 x 2.60 x 0.41 in) Weight 130 g (4.59 oz) Keyboard QWERTY - Touch-sensitive controls Display Type TFT capacitive touchscreen, 16M colors Size 640 x 480 pixels, 2.8 inches (~286 ppi pixel density) then i run same javaScript function i got following output it displaying SIZE width : 417 Height : 313 (417 x 313) why it is behaving like this ? Can anybody know relation between core pixel and HTML pixel please give answer

    Read the article

  • PHP PowerPoint with kohana 3 got encoding errors

    - by Jabeen
    I have just downloaded the fresh copy of phppowerpoint and added the following line of code 'phppowerpoint' = MODPATH.'phppowerpoint', and now my page got blank and I got the following error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol. Any thoughts? Thanks.

    Read the article

  • What is my HttpContext.GetLocalResourceObject Method Virtual Path?

    - by ARUNRAJ
    I have read http://msdn.microsoft.com/en-us/library/ms149953.aspx and need to verify what is my GetLocalResourceObject virtual path. My local resource files are located on my pc at: C:\inetpub\wwwroot\GlobalX\Input\App_LocalResources Within this folder are my resource files for all the languages that site handles (InputContactDetails.aspx.ro.resx, InputContactDetails.aspx.hi.resx, etc.), as well as the default resource file (InputContactDetails.aspx.resx). I am receiving an error when I attempt to implement the virtual path string. Below is my line of offending code: return '<%= HttpContext.GetLocalResourceObject("~/GlobalX/Input/App_LocalResources/InputContactDetails.aspx.resx", "ContactDetails.Text", new System.Globalization.CultureInfo("ro")) %>'; I have tried ~/GlobalX/Input/App_LocalResources as the virtual path, and several other permutations, but I get the same error. If someone could show what I am doing wrong, I would appreciate it greatly. Here is the error message I am getting: The resource class for this page was not found. Please check if the resource file exists and try again. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again. Source Error: Line 410: function languageContactPromptPhone(var_lcs) { Line 411: if (var_lcs == "af") { Line 412: return '<%= HttpContext.GetLocalResourceObject("~/GlobalX/Input/App_LocalResources/InputContactDetails.aspx.resx", "ContactDetails.Text", new System.Globalization.CultureInfo("ro")) %'; Line 413: } Line 414: else if (var_lcs == "sq") { Source File: c:\inetpub\wwwroot\GlobalX\Input\InputContactDetails.aspx Line: 412 Stack Trace: [InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again.] System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager() +2785818 System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager() +24 System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture) +15 System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +23 System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey, CultureInfo culture) +38 ASP.input_inputcontactdetails_aspx.__RenderContentInputContactDetails(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\GlobalX\Input\InputContactDetails.aspx:412 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Control.Render(HtmlTextWriter writer) +10 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Control.Render(HtmlTextWriter writer) +10 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +256 System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +37 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 ASP.masterpages_masterinput_master.__RenderformMasterInput(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\GlobalX\MasterPages\MasterInput.master:140 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Control.Render(HtmlTextWriter writer) +10 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060

    Read the article

  • AES decryption in Java - IvParameterSpec to big

    - by user1277269
    Im going to decrypt a plaintext with two keys. As you see in the picture were have one encrypted file wich contains KEY1(128 bytes),KEYIV(128 bytes),key2(128bytes) wich is not used in this case then we have the ciphertext. The error I get here is "Exception in thread "main" java.security.InvalidAlgorithmParameterException: Wrong IV length: must be 16 bytes long. but it is 64 bytes." Picture: http://i264.photobucket.com/albums/ii200/XeniuM05/bg_zps0a523659.png public class AES { public static void main(String[] args) throws Exception { byte[] encKey1 = new byte[128]; byte[] EncIV = new byte[256]; byte[] UnEncIV = new byte[128]; byte[] unCrypKey = new byte[128]; byte[] unCrypText = new byte[1424]; File f = new File("C://ftp//ciphertext.enc"); FileInputStream fis = new FileInputStream(F); byte[] EncText = new byte[(int) f.length()]; fis.read(encKey1); fis.read(EncIV); fis.read(EncText); EncIV = Arrays.copyOfRange(EncIV, 128, 256); EncText = Arrays.copyOfRange(EncText, 384, EncText.length); System.out.println(EncText.length); KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); char[] password = "lab1StorePass".toCharArray(); java.io.FileInputStream fos = new java.io.FileInputStream( "C://ftp//lab1Store"); ks.load(fos, password); char[] passwordkey1 = "lab1KeyPass".toCharArray(); PrivateKey Lab1EncKey = (PrivateKey) ks.getKey("lab1EncKeys", passwordkey1); Cipher rsaDec = Cipher.getInstance("RSA"); // set cipher to RSA decryption rsaDec.init(Cipher.DECRYPT_MODE, Lab1EncKey); // initalize cipher ti lab1key unCrypKey = rsaDec.doFinal(encKey1); // Decryps first key UnEncIV = rsaDec.doFinal(EncIV); //decryps encive byte array to undecrypted bytearray---- OBS! Error this is 64 BYTES big, we want 16? System.out.println("lab1key "+ unCrypKey +" IV " + UnEncIV); //-------CIPHERTEXT decryption--------- Cipher AESDec = Cipher.getInstance("AES/CBC/PKCS5Padding"); //---------convert decrypted bytearrays to acctual keys SecretKeySpec unCrypKey1 = new SecretKeySpec(unCrypKey, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(UnEncIV); AESDec.init(Cipher.DECRYPT_MODE, unCrypKey1, ivSpec ); unCrypText = AESDec.doFinal(EncText); // Convert decrypted cipher bytearray to string String deCryptedString = new String(unCrypKey); System.out.println(deCryptedString); }

    Read the article

  • Recommended Tutorials for php mysql and graphs

    - by Vinit Joshi
    I need help to find a tutorial or anything to help me create a comparison chart. The user is able to search for device names. The information about the device names is in a drop down box dynamically added from the database. I want the user to be able to select two separate devices and view the devices information plotted onto a graph. I'll be grateful for keywords that I can search for or any tutorials that will help me to carry on with this task. Currently on my screen I can see the data that has been inserted into the database. This data is placed inside a table. I have so far used xhtml, php and mysql. I've tried to make the question as clear as possible so sorry if it does confuse anyone.

    Read the article

  • Does a HashSet make an internal copy of added Objects?

    - by praks5432
    Let's say I have a function that is recursive and is like this public void someRecur(List<Integer>someList){ if(someBreakCondition) Set.add(someList); for(int i = 0; i < someLen ; i++){ someList.add(someInt); someRecur(someList); someList.remove(someInt); } } Does the remove affect the list that has been put into the set? What should I do to give the set an actual copy of the list?

    Read the article

  • Table-cell property ignores width

    - by user1251698
    I have set a CSS propery table-cell for a div. I have also specified the width for the div and set overflow hidden. But because of the table-cell property the div does not care about the width. If I place any large image, it goes out of the width. How can i use the table-cell and use the fixed width for the div? .right{ display: table-cell; overflow: hidden !important; vertical-align: top; width: 400px; }

    Read the article

  • Split string on non-alphanumerics in PHP? Is it possible with php's native function?

    - by Jehanzeb.Malik
    I was trying to split a string on non-alphanumeric characters or simple put I want to split words. The approach that immediately came to my mind is to use regular expressions. Example: $string = 'php_php-php php'; $splitArr = preg_split('/[^a-z0-9]/i', $string); But there are two problems that I see with this approach. It is not a native php function, and is totally dependent on the PCRE Library running on server. An equally important problem is that what if I have punctuation in a word Example: $string = 'U.S.A-men's-vote'; $splitArr = preg_split('/[^a-z0-9]/i', $string); Now this will spilt the string as [{U}{S}{A}{men}{s}{vote}] But I want it as [{U.S.A}{men's}{vote}] So my question is that: How can we split them according to words? Is there a possibility to do it with php native function or in some other way where we are not dependent? Regards

    Read the article

  • Difference between Singleton implemention using pointer and using static object

    - by Anon
    EDIT: Sorry my question was not clear, why do books/articles prefer implementation#1 over implementation#2? What is the actual advantage of using pointer in implementation of Singleton class vs using a static object? Why do most books prefer this class Singleton { private: static Singleton *p_inst; Singleton(); public: static Singleton * instance() { if (!p_inst) { p_inst = new Singleton(); } return p_inst; } }; over this class Singleton { public: static Singleton& Instance() { static Singleton inst; return inst; } protected: Singleton(); // Prevent construction Singleton(const Singleton&); // Prevent construction by copying Singleton& operator=(const Singleton&); // Prevent assignment ~Singleton(); // Prevent unwanted destruction };

    Read the article

  • How to make Image Border Even?

    - by SNaRe
    I added 1 pixel border to the image. At the same time I am trying to give radius to the image edges. My problem is since the image is already rounded with photoshop, the border of edges look thinner than it should be You can check it from here. http://jsfiddle.net/fVNgA/ How can I make the border even? img{ -webkit-border-radius: 5px; -moz-border-radius: 5px; border: 1px solid #000; } <img src='http://carantina.com/wp/wp-content/themes/new/images/home_pic1.jpg'>

    Read the article

  • Android: Showing photos runs out of memory

    - by Tom Beech
    I'm using a dialog box to display images in my android project. The first one opens fine, but when I close it and do the process again to show a different one the app falls over with a memory error (it's running on a samsung galaxy s3 - so shouldnt be an issue). Error: 10-24 11:25:45.575: E/dalvikvm-heap(29194): Out of memory on a 31961104-byte allocation. 10-24 11:25:45.580: E/AndroidRuntime(29194): FATAL EXCEPTION: main 10-24 11:25:45.580: E/AndroidRuntime(29194): java.lang.OutOfMemoryError 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:389) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:418) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.drawable.Drawable.createFromPath(Drawable.java:882) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.ImageView.resolveUri(ImageView.java:569) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.ImageView.setImageURI(ImageView.java:340) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.directenquiries.assessment.tool.AddAsset.loadPhoto(AddAsset.java:771) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.directenquiries.assessment.tool.AddAsset$11.onClick(AddAsset.java:748) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:936) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AdapterView.performItemClick(AdapterView.java:292) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView.performItemClick(AbsListView.java:1359) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2988) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView$1.run(AbsListView.java:3783) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Handler.handleCallback(Handler.java:605) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Handler.dispatchMessage(Handler.java:92) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Looper.loop(Looper.java:137) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.app.ActivityThread.main(ActivityThread.java:4517) 10-24 11:25:45.580: E/AndroidRuntime(29194): at java.lang.reflect.Method.invokeNative(Native Method) 10-24 11:25:45.580: E/AndroidRuntime(29194): at java.lang.reflect.Method.invoke(Method.java:511) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) 10-24 11:25:45.580: E/AndroidRuntime(29194): at dalvik.system.NativeStart.main(Native Method) Loading code: public void loadPhotoList(){ Cursor f = db.rawQuery("select * from stationphotos where StationObjectID = '"+ checkStationObjectID + "'", null); final ArrayList<String> mHelperNames= new ArrayList<String>(); if(f.getCount() != 0) { f.moveToFirst(); f.moveToFirst(); while(!f.isAfterLast()) { mHelperNames.add(f.getString(f.getColumnIndex("FilePath"))); f.moveToNext(); } } f.close(); final String [] nameStrings = new String [mHelperNames.size()]; for(int i=0; i<mHelperNames.size(); i++) nameStrings[i] = mHelperNames.get(i).toString(); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Select Picture"); builder.setItems(nameStrings, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { loadPhoto(mHelperNames.get(item).toString()); } }); AlertDialog alert = builder.create(); alert.show(); } public void loadPhoto(String imagepath){ Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.activity_show_image); dialog.setTitle("Image"); dialog.setCancelable(true); ImageView img = (ImageView) dialog.findViewById(R.id.imageView1); img.setImageResource(R.drawable.ico_partial); Uri imgUri = Uri.parse(imagepath); img.setImageURI(imgUri); dialog.show(); }

    Read the article

  • Cannont Update control in WPF custom control

    - by Fazi
    I have created a custom control which holds a button in it. The button is styled, so as to hold a grid with two rows, an image in the first and a TextBlock in the second. I have written an Event Handler for the custom control. When the mouse enters the path of the object the MouseEnter event fires, where I try to change the TextBlock's FontSize and Foreground color, however the control does not update. In contrast, I have tried to modify an regular TextBlock's(not part a custom control and controltemplate) properties, and they update correctly, on the fly. What am I missing here?? Here is the code for the event handler: private void ThemeButton_MouseEnter(object sender, MouseEventArgs e) { InitializeProperties(); TextElement.FontSize = 16; TextElement.Text = "new text"; TextElement.Foreground = Brushes.Red; TextBlock element = MainWindow.FindChild<TextBlock>(MainWindow.StartWindow, "textField"); element.Text = "new text for regular textblock"; element.Foreground = Brushes.Red; } InitializeProperties is a methid that initializes TextElement(typeof TextBlock) and ImageElement(typeof Image) properties. They are not null. The properties are just regular .NET properties.

    Read the article

  • Create table and call it from sql

    - by user1770816
    I have a PL/SQL function which creates a new temporary table. For creating the table I use execute immediate. When I run my function in oracle sql developer everything is ok; the function creates the temp table without errors. But when U use SQL: Select function_name from table_name I get an exceptions: ORA-14552: cannot perform a DDL, commit or rollback inside a query or DML ORA-06512: at "SYSTEM.GET_USERS", line 10 14552. 00000 - "cannot perform a DDL, commit or rollback inside a query or DML " *Cause: DDL operations like creation tables, views etc. and transaction control statements such as commit/rollback cannot be performed inside a query or a DML statement. Update Sorry, write from tablet PC and have problems with format text. My function: CREATE OR REPLACE FUNCTION GET_USERS ( USERID IN VARCHAR2 ) RETURN VARCHAR2 AS request VARCHAR2(520) := 'CREATE GLOBAL TEMPORARY TABLE '; BEGIN request := request || 'temp_table_' || userid || '(user_name varchar2(50), user_id varchar2(20), is_administrator varchar2(5)') || ' ON COMMIT PRESERVE ROWS'; EXECUTE IMMEDIATE (request); RETURN 'true'; END GET_USERS;

    Read the article

  • Word Automation : Replace do not work after TypeText

    - by wishper
    I need to generate doc (real doc, not docx) files, the "best" way i have found is to use word automation (Word 2010). I have files that I open, and then replace values inside before saving it on a new name. (Ex : I replace "" with "155023"). To do this, I use the Application.Selection.Find. I just had a problem when the new value had more than 255 characters (Thanks Microsofts limitations ...). To avoid this problem, i use TypeText in this case. My problem now is once I use TypeText, the Replace do not work anymore .. And I can't find why. Any idea will be greatly appreciated. My code is in a function, called in a foreach with each values to replace : private void Replace(Application app, string name, string newValue) { Selection selection = app.Selection; Find find = selection.Find; Replacement replacement = find.Replacement; find.ClearFormatting(); find.Text = "<" + name + ">"; // Word limitation : can't replace with more than 255 characters, // use another way to do it if that's the case if (tempNewValue.Length < 255) { replacement.ClearFormatting(); replacement.Text = tempNewValue; find.Execute(Replace: replaceAll); } else { while (find.Execute()) { selection.TypeText(tempNewValue); } } Marshal.ReleaseComObject(replacement); Marshal.ReleaseComObject(find); Marshal.ReleaseComObject(selection); }

    Read the article

  • Finding the digit root of a number

    - by Jessica M.
    Study question is to find the digit root of a already provided number. The teacher provides us with the number 2638. In order to find the digit root you have to add each digit separately 2 + 6 + 3 + 8 = 19. Then you take the result 19 and add those two digits together 1 + 9 = 10. Do the same thing again 1 + 0 = 1. The digit root is 1. My first step was to use the variable total to add up the number 2638 to find the total of 19. Then I tried to use the second while loop to separate the two digits by using the % I have to try and solve the problem by using basic integer arithmetic (+, -, *, /). 1.Is it necessary and or possible to solve the problem using nested while loops? 2.Is my math correct? 3. As I wrote it here it does not run in Eclipse. Am I using the while loops correctly? import acm.program.*; public class Ch4Q7 extends ConsoleProgram { public void run(){ println("This program attempts to find the digit root of your number: "); int n = readInt("Please enter your number: "); int total = 0; int root = total; while (n > 0 ){ total = total + (n %10); n = (n / 10); } while ( total > 0 ){ root = total; total = ((total % 10) + total / 10); } println("your root should be " + root); } }

    Read the article

  • Convert SQL to LINQ in MVC3 with Ninject

    - by Jeff
    I'm using MVC3 and still learning LINQ. I'm having some trouble trying to convert a query to LINQ to Entities. I want to return an employee object. SELECT E.EmployeeID, E.FirstName, E.LastName, MAX(EO.EmployeeOperationDate) AS "Last Operation" FROM Employees E INNER JOIN EmployeeStatus ES ON E.EmployeeID = ES.EmployeeID INNER JOIN EmployeeOperations EO ON ES.EmployeeStatusID = EO.EmployeeStatusID INNER JOIN Teams T ON T.TeamID = ES.TeamID WHERE T.TeamName = 'MyTeam' GROUP BY E.EmployeeID, E.FirstName, E.LastName ORDER BY E.FirstName, E.LastName What I have is a few tables, but I need to get only the newest status based on the EmployeeOpertionDate. This seems to work fine in SQL. I'm also using Ninject and set my query to return Ienumerable. I played around with the group by option but it then returns IGroupable. Any guidance on converting and returning the property object type would be appreciated. Edit: I started writing this out in LINQ but I'm not sure how to properly return the correct type or cast this. public IQueryable<Employee> GetEmployeesByTeam(int teamID) { var q = from E in context.Employees join ES in context.EmployeeStatuses on E.EmployeeID equals ES.EmployeeID join EO in context.EmployeeOperations on ES.EmployeeStatusID equals EO.EmployeeStatusID join T in context.Teams on ES.TeamID equals T.TeamID where T.TeamName == "MyTeam" group E by E.EmployeeID into G select G; return q; } Edit2: This seems to work for me public IQueryable<Employee> GetEmployeesByTeam(int teamID) { var q = from E in context.Employees join ES in context.EmployeeStatuses on E.EmployeeID equals ES.EmployeeID join EO in context.EmployeeOperations.OrderByDescending(eo => eo.EmployeeOperationDate) on ES.EmployeeStatusID equals EO.EmployeeStatusID join T in context.Teams on ES.TeamID equals T.TeamID where T.TeamID == teamID group E by E.EmployeeID into G select G.FirstOrDefault(); return q; }

    Read the article

  • importing an existing x509 certificate and private key in Java keystore to use in ActiveMQ ssl context

    - by Aleksandar Ivanisevic
    I have this in activemq config <sslContext> <sslContext keyStore="file:/home/alex/work/amq/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/> </sslContext> I have a pair of x509 cert and a key file How do I import those two to be used in ssl and ssl+stomp connectors? All examples i could google always generate the key themselves, but I already have a key. I have tried keytool -import -keystore ./broker.ks -file mycert.crt but this only imports the certificate and not the key file and results in 2009-05-25 13:16:24,270 [localhost:61612] ERROR TransportConnector - Could not accept connection : No available certificate or key corresponds to the SSL cipher suites which are enabled. I have tried concatenating the cert and the key but got the same result How do I import the key?

    Read the article

  • Productive Toolset for C# Developer

    - by Marko Apfel
    Programming Visual Studio ReSharper Agent Johnson Agent Smith StyleCop for ReSharper Keymaps SettingsManager Git Source Control Provider Gist NuGet Package Manager NDepend Productivity Power Tools PowerCommands for Visual Studio PostSharp Indent Guides Typemock Isolator VSCommands Ressource Refactor Clone Detective GhostDoc CR_Documentor AnkSVN Expression Blend SharpDevelop Notepad++, PS Pad StyleCop, FxCop, .. .NET Reflector, ILSpy, dotPeek, Just Decompile Git Extensions inkl. MSysGit, MinGW Github for Windows SmartGit PoSH-Git Console Enhancement Project LINQPad Mercurial RapidSVN SQL Management Studio Adventure Works Sample DB AdventureWorksLT Toad for SQL Server yEd Graph Editor TeX, LateX MiKTeX, TeXworks Pandoc Jenkins, TeamCity KompoZer XML Notepad Kaxaml KDiff3, WinMerge, Perforce Merge Handle DbgView FusLogVw FTP Commander HTML Help Workshop, Sandcastle, SHFB WiX Enterprise Architect InsightProfiler Putty Cygwin DXCore, DXCore Plugins FreeMind ProcessExplorer, ProcessMonitor Social Networking, Community Windows Live Writer Disgsby Skype TweetDeck FeedReader Sytem and others Microsoft Office (notably OneNote!!!) Adobe Reader PDF Creator SRWare Iron (Chrome) AddThis bit-ly del.icio.us InstaPaper Leo Dictionary Google Bookmarks Proxy Switchy! StumbleUpon K-Meleon FreeCommander, FAR 7-Zip Keyboard Jedi Launchy TrueCrypt Dropbox Ditto Greenshot Rainlendar2 Everything Daemon Tools inSSIDer VirtualBox Stardock Fences Media Player Classic VLC Media Player Winamp WinAmp Cue Player LAME Encoder CamStudio Youtube to MP3 Converter VirtualDub Image Resizer Powertoy Clone 2.0 Paint.NET Picasa Windy JediConcentrate, Ghoster TeamViewer Timerle TreeSizeFree WinDirStat Windows Sizer, WinResizer ZoomIt Sometimes nice to have ArcGIS TortoiseSVN, TortoiseCVS XnView GitJungle CowSpy Grindstone Free Download Manager CDBurnerXP Free Audio CD Burner SmartAssembly intellibook GMX SMS Manager BlackBerry Desktop Cisco Any Connect eRoom Foxit Reader Google Earth ThinkVantage GPS Gridy Bluefish The GodFather Tor Browser, Charon YouTube Downloader NCover Network Stumbler Remote Debugger WScite XML Pad DBVisualizer Microsoft Network Monitor, Fiddler2 Eclipse IDE Oracle Client, Oracle SQL Developer Bookmarks, Links http://pastebin.de/, http://pastebin.com/ http://followup.cc  http://trello.com http://tumblr.com https://bitly.com/, http://is.gd http://www.famkruithof.net/uuid/uuidgen, http://www.guidgenerator.com/ https://github.com/, https://bitbucket.org/ http://dict.leo.org/, http://translate.google.com/ http://prezi.com/ http://geekswithblogs.net/Default.aspx, http://codebetter.com/ http://duckduckgo.com/bang.html   http://de.schreibtrainer.com/index.php?site=3&menuId=3 http://www.mr-wetter.de/ this is an update to http://geekswithblogs.net/mapfel/archive/2010/07/12/140877.aspx

    Read the article

  • Outlook hangs during startup by step &ldquo;loading profile&rdquo;

    - by Marko Apfel
    Problem Starting Outlook shows only the splash screen with comment “loading profile”. I could cancel the startup but restarting shows the same. I verified with Task Manager that no hidden outlook process is bother me. Solution Scanpst Normally with Outlook the tool “Microsoft Outlook Inbox Repair Tool” (scanpst.exe) is additionally installed. Some people could access it via Startmenu, but not me. My lovely Launchy found it under "C:\Program Files (x86)\Microsoft Office\Office14\SCANPST.EXE" Scanpst first ask you for the pst file which you would like to scan. I started with the first default offer: C:\Users\…\AppData\Local\Microsoft\Outlook\….ost And this brings up the information, that another application uses this file. Handle To investigate the causer Handle from Sysinternals is your friend in such cases. Start it from an administrative console and pipe the output to a file. handle > c:\temp\handle.txt Now you could open this file with the editor of your choose and search for the blocked file (your pst file). On top of the section you see the application which has a handle to this file opened (SfdcMsO1.exe). Task Manager Kill this application and start Outlook again. And voila – everything starts up fine … by me

    Read the article

  • Apache 2.2 on Mountain Lion ignoring ProxyPass and sending request to DocumentRoot

    - by James H
    I have sickbeard running at 127.0.0.1:8081/sickbeard ProxyRequests Off ProxyPass /sickbeard http://127.0.0.1:8081/sickbeard ProxyPassReverse /sickbeard http://127.0.0.1:8081/sickbeard in httpd.conf And yet when I try and access http://example.com/sickbeard/ it gives me a 404, with this in the error log. File does not exist: /Library/Server/Web/Data/Sites/Default/sickbeard Which I think means it's ignoring the ProxyPass and ProxyPassReverse directives? Anyone know why this may be? For what it's worth, this setup used to work under Lion. I have the following modules loaded: LoadModule proxy_module libexec/apache2/mod_proxy.so LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so Thanks for your time!

    Read the article

  • FTP through HAProxy

    - by Menda
    I have a machine, which is the Host and has HAProxy installed in it and working. Then I have a Guest KVM virtual machine running inside the Host with an IP 192.168.122.152. I installed an FTP server in the Guest machine with VSFTPD. From the Host, if I try the command $ ftp -p 192.168.122.152, works perfectly and I can connect to the Guest FTP. I need to remark that this FTP is configured as passive, but both passive and active connections are working from the Host. This is an extract of part of /etc/vsftpd.conf in the Guest: # Passive mode connect_from_port_20=NO tcp_wrappers=YES listen_address=192.168.122.152 pasv_enable=YES pasv_promiscuous=NO port_enable=YES port_promiscuous=NO pasv_max_port=10000 pasv_min_port=10250 Now it's time to make it accessible from outside, so I configure /etc/haproxy/haproxy.cfg like this: listen FTP_Default *:21 server ftp01 192.168.122.152 check port 21 inter 10s rise 1 fall 2 listen FTP_Range *:10000-10250 server ftp01 192.168.122.152 check port 21 inter 10s rise 1 fall 2 But if I try to connect from other machine in internet $ ftp -p $PUBLICIP, it only responds: Connected to <PUBLICIP>, but it doesn't ask for the login and password. Something in the HAProxy config must be wrong, because it's the only point where it fails. By the way, I tried to adapt my configuration to this one in this blog. Thanks.

    Read the article

  • IIS Redirect a sub directory to an external URL

    - by Will Hancock
    Hi forgive my ignorance for I am a humble client side developer... I am a webapp made up of static HTML and JS. But I want to call an external service via AJAX, this causes some issues with CORS or Cross Domain policy on the browser. So I need to make a request to MY server http://dev.webapp.com/service So I want to redirect the /service on the server to http://externaldata.com/service And return the result. The Mac boys have acheived this in Apache with a proxy pass: ProxyPass /service http://externaldata.com/service Can anybody help with how to do this in IIS? I have found articles about ARRs and Reverse Proxy, terms that are alien and seem too complicated. As a humble webdev can I do this using IIS GUI?

    Read the article

  • 503 error Varnish cache when eAccelerator is started

    - by Netismine
    I have a Magento installation running on x-large Amazon server. I have Varnish, memcached and eAccelerator installed on the server. At first everything was working fine, but then at some point it stopped working, throwing 503 error with Varnish cache stamp below it. When I disable eaccelerator, error is gone and site is working. This is my eaccelerator config: extension="eaccelerator.so" eaccelerator.shm_size = "512" eaccelerator.cache_dir = "/var/cache/php-eaccelerator" eaccelerator.enable = "1" eaccelerator.optimizer = "1" eaccelerator.debug = 0 eaccelerator.log_file = "/var/log/httpd/eaccelerator_log" eaccelerator.name_space = "" eaccelerator.check_mtime = "1" eaccelerator.filter = "" eaccelerator.shm_ttl = "0" eaccelerator.shm_prune_period = "0" eaccelerator.shm_only = "0" eaccelerator.allowed_admin_path = "" any hints?

    Read the article

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