Daily Archives

Articles indexed Thursday August 21 2014

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

  • How to remove an element from set using Iterator?

    - by ankit
    I have a scenario that I am iterating over a set using iterator. Now I want to remove 1st element while my iterator is on 2nd element. How can I do it. I dont want to convert this set to list and using listIterator. I dont want to collect all objects to be removed in other set and call remove all sample code. Set<MyObject> mySet = new HashSet<MyObject>(); mySet.add(MyObject1); mySet.add(MyObject2); ... Iterator itr = mySet.iterator(); while(itr.hasNext()) { // Now iterator is at second element and I want to remove first element }

    Read the article

  • Runtime Error 1004 using Select with several workbooks

    - by Johaen
    I have an Excel workbook which pulls out data from two other workbooks. Since the data changes hourly there is the possibility that this macro is used more than one time a day for the same data. So I just want to select all previous data to this date period and want to delete them. Later on the data will be copied in anyway. But as soon as I want to use WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select the code stopes with Error 1004 Application-defined or object-defined error. Followed just a snippet of the code with the relevant part. What is wrong here? 'Set source workbook Dim currentWb As Workbook Set currentWb = ThisWorkbook Set WBSH = currentWb.Sheets("Tracking") 'Query which data from the tracking files shoud get pulled out to the file CheckDate = Application.InputBox(("From which date you want to get data?" & vbCrLf & "Format: yyyy/mm/dd "), "Tracking data", Format(Date - 1, "yyyy/mm/dd")) 'states the last entry which is done ; know where to start ; currentWb File With currentWb.Sheets("Tracking") lastRow = .Range("D" & .Rows.Count).End(xlUp).Row lastRow = lastRow + 1 End With 'just last 250 entries get checked since not so many entries are made in one week j = lastRow - 250 'Check if there is already data to the look up date in the analyses sheet and if so deletes these records Do j = j + 1 'Exit Sub if there is no data to compare to prevent overflow If WBSH.Cells(j + 1, "C").Value = "" Then Exit Do End If Loop While WBSH.Cells(j, "C").Value < CheckDate If j <> lastRow - 1 Then 'WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select 'Selection.ClearContents End If Thank you!

    Read the article

  • Change CkEditor's background color with jQuery methods

    - by user198003
    I need to change background color of CkEditor, on some basic jQuery methods, like ready, change, etc. Tried with things like: $(document).on('click','.change-task-status', function(e){ $(".cke_editable").css("background-color", 'red'); }) ... but nothing happens. Can you help me how to achieve this? Thank you in advance! PS. yes, I do have jQuery adapter loaded on page. UPDATE: Some improvement is made - when I run next code in console, it changes background color $( ".cke_wysiwyg_frame" ).contents().find( ".cke_editable" ).css( "background-color", "#BADA55" ); Now just to find why it does not execute in code...

    Read the article

  • Center container horizontally and vertically

    - by Joey
    Looking over other question on this site, I used a method of setting all the positions to 0 with auto margins, but this has some unwanted behavior. If you resize the window vertically, the top of the container moves off of the top of the page. It needs to stop when it hits the top. JSFIDDLE: http://jsfiddle.net/jd67ca5y/ HTML: <div id="container"> <p>This is the container.</p> <p>If you resize the JSFiddle window horizontally, you will see that the left edge of the box doesn't move past the left edge of the window. This is correct behaviour.</p> <p>Now if you move the window vertically, the top of this container will disappear off of the top of the window. This is wrong.</p> </div> CSS: #container { margin:auto; height:300px; width:300px; top:0; bottom:0; left:0; right:0; position:absolute; border:1px solid; padding:10px; }

    Read the article

  • How to hide an element after $compile?

    - by Miron
    How to hide directive generated html after inserting it to body? Directive has "replace" set to trueThere is a directive: .directive('location', function () { return { restrict : 'A', scope : {}, replace : true, templateUrl: 'common/components/location/location.html', link : function (scope, element, attr) {……} } }); So it is used in another directive: var scope = $rootScope.$new(true); var directive = $compile('<div location></div>')(scope); $document.find('body').append(directive); directive.hide(); - not working How to hide directive generated html after inserting it to body? Directive has "replace" set to true

    Read the article

  • ServeletException, Property <variable name> not found

    - by k9yosh
    What i'm trying to do is add a new variable to this previously created Managed Bean Hello.java and use it in my xhtml file binding to a text field. But it seems that it is not being found when i run it on the server. So it throws a "ServeletException" and says that the "property 'lname'(my variable) is not found". How do i solve this and why is this happening? This is my managed bean, package stack.tute.malinda.model; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class Hello { private String fname; private String message; private String lname; //trying to add this new variable and use it in my xhtml file in a text field. public String getLname() { return lname; } public void setLname(String lname) { this.lname = lname; } public String getName() { return fname; } public String createMessage() { message="Hello " + fname + ""+ lname +"!"; return null; } public void setName(String fname) { this.fname=fname; } public String getMessage() { return message; } } This is my xhtml code, <h:body> <fieldset style="padding: 1em; float:left; margin-right:0.5em; padding-top:0.2em; text-align:left; border:1px solid green; font-weight:bold;"> <legend>Personal Details</legend> <h:form> <h:outputLabel for="name" value="First Name :" required="true"/> <h:inputText id="name" value="#{hello.name}"/> <br/> //Trying to access that variable here. <h:outputLabel for="name1" value="Last Name :" required="true"/> <h:inputText id="name1" value="#{hello.lname}"/> <h:message for="name"/> <br/> <h:commandButton value="Say hello" action="#{hello.createMessage}"> <f:ajax execute="@form" render="@form"/> </h:commandButton> <br/> <h:outputText value="#{hello.message}"/> </h:form> </fieldset>

    Read the article

  • MongoDb - $match filter not working in subdocument

    - by Ranjith
    This is Collection Structure [{ "_id" : "....", "name" : "aaaa", "level_max_leaves" : [ { level : "ObjectIdString 1", max_leaves : 4, } ] }, { "_id" : "....", "name" : "bbbb", "level_max_leaves" : [ { level : "ObjectIdString 2", max_leaves : 2, } ] }] I need to find the subdocument value of level_max_leaves.level filter when its matching with given input value. And this how I tried, For example, var empLevelId = 'ObjectIdString 1' ; MyModel.aggregate( {$unwind: "$level_max_leaves"}, {$match: {"$level_max_leaves.level": empLevelId } }, {$group: { "_id": "$level_max_leaves.level", "total": { "$sum": "$level_max_leaves.max_leaves" }}}, function (err, res) { console.log(res); }); But here the $match filter is not working. I can't find out exact results of ObjectIdString 1 If I filter with name field, its working fine. like this, {$match: {"$name": "aaaa" } }, But in subdocument level its returns 0. {$match: {"$level_max_leaves.level": "ObjectIdString 1"} }, My expected result was, { "_id" : "ObjectIdString 1", "total" : 4, }

    Read the article

  • .exe is not created when using launch4j and maven

    - by Ismail Sen
    I'm trying to create an exe file for my JAVA project using launch4j and Maven. Here is my pom.xml <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <configuration> <descriptorRefs> <descriptortRef>jar-with-dependencies</descriptortRef> </descriptorRefs> <archive> <manifest> <mainClass>dev.main.App</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.7.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>shaded</shadedClassifierName> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>dev.main.App</mainClass> </transformer> </transformers> </configuration> </plugin> <plugin> <groupId>com.akathist.maven.plugins.launch4j</groupId> <artifactId>launch4j-maven-plugin</artifactId> <version>1.5.1</version> <executions> <execution> <id>l4j-clui</id> <phase>package</phase> <goals> <goal>launch4j</goal> </goals> <configuration> <headerType>console</headerType> <jar>${project.build.directory}/target/App-jar-with-dependencies.jar</jar> <outfile>${project.build.directory}/target/App.exe</outfile> <downloadUrl>http://java.com/download</downloadUrl> <classPath> <mainClass>dev.main.App</mainClass> </classPath> <jre> <minVersion>1.6.0</minVersion> <jdkPreference>preferJre</jdkPreference> </jre> <versionInfo> <fileVersion>1.0.0.0</fileVersion> <txtFileVersion>${project.version}</txtFileVersion> <fileDescription>${project.name}</fileDescription> <copyright>C</copyright> <productVersion>1.0.0.0</productVersion> <txtProductVersion>1.0.0.0</txtProductVersion> <productName>${project.name}</productName> <internalName>AppName</internalName> <originalFilename>App.exe</originalFilename> </versionInfo> </configuration> </execution> </executions> </plugin> </plugins> </pluginManagement> </build> I run : mvn clean compile assembly:single to create my jar app with all Maven dependencies. To create the .exe I do : mvn package but nothing is created under target folder. Am I missing a goal or a configuration ? Ismail

    Read the article

  • plupload not working in wordpress theme files

    - by Kedar B
    This is my code for image upload.... <a id="aaiu-uploader" class="aaiu_button" href="#"><?php _e('*Select Images (mandatory)','wpestate');?></a> <input type="hidden" name="attachid" id="attachid" value="<?php echo $attachid;?>"> <input type="hidden" name="attachthumb" id="attachthumb" value="<? php echo $thumbid;?>"> i want upload functionality more than one time in single page in wordpress.i have add js code for that same as first upload block but its not working. This is js code for image upload.... jQuery(document).ready(function($) { "use strict"; if (typeof(plupload) !== 'undefined') { var uploader = new plupload.Uploader(ajax_vars.plupload); uploader.init(); uploader.bind('FilesAdded', function (up, files) { $.each(files, function (i, file) { // console.log('append'+file.id ); $('#aaiu-upload-imagelist').append( '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b>' + '</div>'); }); up.refresh(); // Reposition Flash/Silverlight uploader.start(); }); uploader.bind('UploadProgress', function (up, file) { $('#' + file.id + " b").html(file.percent + "%"); }); // On erro occur uploader.bind('Error', function (up, err) { $('#aaiu-upload-imagelist').append("<div>Error: " + err.code + ", Message: " + err.message + (err.file ? ", File: " + err.file.name : "") + "</div>" ); up.refresh(); // Reposition Flash/Silverlight }); uploader.bind('FileUploaded', function (up, file, response) { var result = $.parseJSON(response.response); // console.log(result); $('#' + file.id).remove(); if (result.success) { $('#profile-image').css('background-image','url("'+result.html+'")'); $('#profile-image').attr('data-profileurl',result.html); $('#profile-image_id').val(result.attach); var all_id=$('#attachid').val(); all_id=all_id+","+result.attach; $('#attachid').val(all_id); $('#imagelist').append('<div class="uploaded_images" data- imageid="'+result.attach+'"><img src="'+result.html+'" alt="thumb" /><i class="fa deleter fa-trash-o"></i> </div>'); delete_binder(); thumb_setter(); } }); $('#aaiu-uploader').click(function (e) { uploader.start(); e.preventDefault(); }); $('#aaiu-uploader2').click(function (e) { uploader.start(); e.preventDefault(); }); } });

    Read the article

  • How to solve non-linear equations using python

    - by stars83clouds
    I have the following code: #!/usr/bin/env python from scipy.optimize import fsolve import math h = 6.634e-27 k = 1.38e-16 freq1 = 88633.9360e6 freq2 = 88631.8473e6 freq3 = 88630.4157e6 def J(freq,T): return (h*freq/k)/(math.exp(h*freq/(k*T))-1) def equations(x,y,z,w,a,b,c,d): f1 = a*(J(freq1,y)-J(freq1,2.73))*(1-math.exp(-a*z))-(J(freq2,x)-J(freq2,2.73))*(1-math.exp(-z)) f2 = b*(J(freq3,w)-J(freq3,2.73))*(1-math.exp(-b*z))-(J(freq2,x)-J(freq2,2.73))*(1-math.exp(-z)) f3 = c*(J(freq3,w)-J(freq3,2.73))*(1-math.exp(-b*z))-(J(freq1,y)-J(freq1,2.73))*(1-math.exp(-a*z)) f4 = d*(J((freq3+freq1)/2,(y+w)/2)-J((freq3+freq1)/2,2.73))-(J(freq2,x)-J(freq2,2.73))*(1-math.exp(-z)) return (f1,f2,f3,f4) So, I have defined the equations in the above code. However, I now wish to solve the above set of equations using fsolve or other alternative non-linear numerical routine. I tried the following syntax but with no avail: x,y,z,w = fsolve(equations, (1,1,1,1)) I keep getting the error that "x" is not defined. I am executing all commands at the command-line, since I have no idea how to run a batch of commands as above automatically in python. I welcome any advice on how to solve this.

    Read the article

  • Many to many self join through junction table

    - by Peter
    I have an EF model that can self-reference through an intermediary class to define a parent/child relationship. I know how to do a pure many-to-many relationship using the Map command, but for some reason going through this intermediary class is causing problems with my mappings. The intermediary class provides additional properties for the relationship. See the classes, modelBinder logic and error below: public class Equipment { [Key] public int EquipmentId { get; set; } public virtual List<ChildRecord> Parents { get; set; } public virtual List<ChildRecord> Children { get; set; } } public class ChildRecord { [Key] public int ChildId { get; set; } [Required] public int Quantity { get; set; } [Required] public Equipment Parent { get; set; } [Required] public Equipment Child { get; set; } } I've tried building the mappings in both directions, though I only keep one set in at a time: modelBuilder.Entity<ChildRecord>() .HasRequired(x => x.Parent) .WithMany(x => x.Children ) .WillCascadeOnDelete(false); modelBuilder.Entity<ChildRecord>() .HasRequired(x => x.Child) .WithMany(x => x.Parents) .WillCascadeOnDelete(false); OR modelBuilder.Entity<Equipment>() .HasMany(x => x.Parents) .WithRequired(x => x.Child) .WillCascadeOnDelete(false); modelBuilder.Entity<Equipment>() .HasMany(x => x.Children) .WithRequired(x => x.Parent) .WillCascadeOnDelete(false); Regardless of which set I use, I get the error: The foreign key component 'Child' is not a declared property on type 'ChildRecord'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property. when I try do deploy my ef model to the database. If I build it without the modelBinder logic in place then I get two ID columns for Child and two ID columns for Parent in my ChildRecord table. This makes sense since it tries to auto create the navigation properties from Equipment and doesn't know that there are already properties in ChildRecord to fulfill this need. I tried using Data Annotations on the class, and no modelBuilder code, this failed with the same error as above: [Required] [ForeignKey("EquipmentId")] public Equipment Parent { get; set; } [Required] [ForeignKey("EquipmentId")] public Equipment Child { get; set; } AND [InverseProperty("Child")] public virtual List<ChildRecord> Parents { get; set; } [InverseProperty("Parent")] public virtual List<ChildRecord> Children { get; set; } I've looked at various other answers around the internet/SO, and the common difference seems to be that I am self joining where as all the answers I can find are for two different types. Entity Framework Code First Many to Many Setup For Existing Tables Many to many relationship with junction table in Entity Framework? Creating many to many junction table in Entity Framework

    Read the article

  • AppleScript: open frontmost file with another application

    - by jacobianism
    I'd like to write an AppleScript program to do the following (Automator would be fine too): I want to open the current active TextMate file (possibly there are several tabs open and other windows) with the application Transmit 2. (This will upload the file over FTP using Transmit's DockSend feature.) Here I've used a specific application (TextMate) but ideally I'd like it to work for any file currently active in any application. Ultimately I will assign a keyboard shortcut to run it. Here's what I have so far: tell application (path to frontmost application as text) set p to path of document 1 end tell tell application "Finder" open POSIX file p using "Transmit 2" end tell I've tried many variants of this and nothing works. EDIT: I have found this page: http://wiki.macromates.com/Main/Howtos and someone has made exactly the script I'm looking for: tell application "Transmit" to open POSIX file "$TM_FILEPATH" This is for Transmit [not 2] and I think for TextMate pre v2. I get the error (when using Transmit 2): Transmit 2 got an error: AppleEvent handler failed. One of the updates to v2 has broken it (not sure which one).

    Read the article

  • Audio decoding delay when changing the audio language

    - by mahendiran.b
    My gstreamer Pipeline is like this Approach1 --------------input-selector->Queue->AduioParser->AudioSink | Souphttpsrc->tsdemux-->| | --------------- Queue->videoParser->videoSink In this approach 1, there is a delay in audio decoding when I toggle between various audio language. Approach2 ------ input-selector-> Queue->AduioParser->AudioSink | Souphttpsrc->tsdemux---multiqueue>| | ------- Queue->videoParser->VideoSink But there is no delay is observed in approach2. Can anyone please explain the reason behind this ? what is the specialty of multiqueue here?

    Read the article

  • How to parse amadeus air ticket file

    - by Andrus
    Amadeous produces AIR file like below for every flyight reservation. I need to read reservation number and source and destionation airports from this file. I searched goog for "amadeous air format" but havent found format description. Wikipedia entry about EDIFACt is a bit different, it does not describe this content. Where to fnd information about the file structure ? How to parse this file ? I have not idea about the file stucture, does it contain records like sql table or is it some reservation protocol instructions like postscript file ? Application should work in Microsoft Windows and preferably in Visual FoxPro or C# language. FoxPro or Microsoft Visual Studio 2012 Express can used as programming environment Google returns only Amadeus users guides and tutorials like in comment and in http://www.amadeusschweiz.com/en/documentation/usermanuals.html Those are user manuals. Most promising looks Amadeus Air user guide from this: File which I received name was air.txt and first token in file is AIR-BLK206 Maybe BLK206 is some booking format descriptor. Google returns some documens like my using this so it looks like it is commonly used. This file probably describes how to reserve ticket, which produces air.txt file. I seacrched this and ticket user guide for BLK but those do not contains this abbreviation. Commands in user manual look different than those from this file. How to use this information to extract reservation number and destination airport from this file ? I havent found format description using google. There are amadeus user guides, tutorials ja quick reference files similar which you posted but I do'nt understand how to use them to parse this file. One message describes that this is form of EDIFACT. However EDIFACT message sample in Wikipedia is also diffrerent. I need to create quick prototype to customer which shows that we vcan read those files. Maybe there are some programs which can used to display it in human readable form ?

    Read the article

  • Binding to static property

    - by Anthony Brien
    I'm having a hard time binding a simple static string property to a text box. Here's the class with the static property: public class VersionManager { private static string filterString; public static string FilterString { get { return filterString; } set { filterString = value; } } } In my xaml, I just want to bind this static property to a text box: <TextBox> <TextBox.Text> <Binding Source="{x:Static local:VersionManager.FilterString}"/> </TextBox.Text> </TextBox> Everything compiles, but at run time, I get the following exception: Cannot convert the value in attribute 'Source' to object of type 'System.Windows.Markup.StaticExtension'. Error at object 'System.Windows.Data.Binding' in markup file 'BurnDisk;component/selectversionpagefunction.xaml' Line 57 Position 29. Any idea what I'm doing wrong?

    Read the article

  • Corliss Expert Group Home Security: How to Secure Your Home without Spending Too Much?

    - by Mika Esmond
    HOME SECURITY: HOW TO SECURE YOUR HOME WITHOUT SPENDING TOO MUCH Imagine if there were no burglar or criminals who threaten the safety of our homes; we will be surprised how much savings we would have on several things we do to secure ourselves and our loved ones. We would not need fences, gates with locks, doors locks, window grills, CCTV cams, perimeter lighting, shotguns and baseball bats. The cost of maintaining these things can run up to the entire cost of building another room or, in some cases, a whole new house. The rationale for home security is the same for national security. A nation maintains an army whether it has enemies or not; so, whether burglars will come or not, we have to prepare for the eventuality. Hence, we end up spending for something we might never put into the actual use it was intended for. You buy a pistol and when a burglar breaks in you fire the gun either to scare or disable the intruder. We hope we will never have to use these things; but we still buy them for the peace of mind that comes from knowing we can secure or protect our family and home.

    Read the article

  • Recovering data from mangodb raw files

    - by Jin Chen
    we use mongodb for our database and set the replset(two servers), but we mistakenly deleted some raw files that under /path/to/dbdata on both servers, after we used tool to get back the deleted files(we ran the extundelete on both server and mix the result together), like database.1, database.2 etc. we could not start the mongod, it raised the following error when starting mongod or executing mongodump, here is the console output: root@mongod:/opt/mongodb# mongodump --repair --dbpath /opt/mongodb -d database_production Thu Aug 21 16:22:43.258 [tools] warning: repair is a work in progress Thu Aug 21 16:22:43.258 [tools] going to try and recover data from: database_production Thu Aug 21 16:22:43.262 [tools] Assertion failure isOk() src/mongo/db/pdfile.h 392 0xde1b01 0xda42fd 0x8ae325 0x8ac492 0x8bd8e0 0x8c1c51 0x80e345 0x80e607 0x80e6a4 0x6db92a 0x6dc1ff 0x6e0db9 0xd9e45e 0x6ccdc7 0x7f499d856ead 0x6ccc29 mongodump(_ZN5mongo15printStackTraceERSo+0x21) [0xde1b01] mongodump(_ZN5mongo12verifyFailedEPKcS1_j+0xfd) [0xda42fd] mongodump(_ZNK5mongo7Forward4nextERKNS_7DiskLocE+0x1a5) [0x8ae325] mongodump(_ZN5mongo11BasicCursor7advanceEv+0x82) [0x8ac492] mongodump(_ZN5mongo8Database19clearTmpCollectionsEv+0x160) [0x8bd8e0] mongodump(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x7b1) [0x8c1c51] mongodump(_ZN5mongo6Client7Context11_finishInitEv+0x65) [0x80e345] mongodump(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x87) [0x80e607] mongodump(ZN5mongo6Client12WriteContextC1ERKSsS3+0x54) [0x80e6a4] mongodump(_ZN4Dump7_repairESs+0x3a) [0x6db92a] mongodump(_ZN4Dump6repairEv+0x2df) [0x6dc1ff] mongodump(_ZN4Dump3runEv+0x1b9) [0x6e0db9] mongodump(_ZN5mongo4Tool4mainEiPPc+0x13de) [0xd9e45e] mongodump(main+0x37) [0x6ccdc7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7f499d856ead] mongodump(__gxx_personality_v0+0x471) [0x6ccc29] assertion: 0 assertion src/mongo/db/pdfile.h:392 Thu Aug 21 16:22:43.271 dbexit: Thu Aug 21 16:22:43.271 [tools] shutdown: going to close listening sockets... Thu Aug 21 16:22:43.271 [tools] shutdown: going to flush diaglog... Thu Aug 21 16:22:43.271 [tools] shutdown: going to close sockets... Thu Aug 21 16:22:43.272 [tools] shutdown: waiting for fs preallocator... Thu Aug 21 16:22:43.272 [tools] shutdown: closing all files... Thu Aug 21 16:22:43.273 [tools] closeAllFiles() finished Thu Aug 21 16:22:43.273 [tools] shutdown: removing fs lock... Thu Aug 21 16:22:43.273 dbexit: really exiting now my env: 1) Debian 3.2.35-2 x86_64(it's a XEN virtual machine) 2) mongodb 2.4.6 and we did not delete the .0 and .ns files we tried to create a new database with the same name and copy these db.ns and db.2, db.3 to the new db, we still met the same error. is there any way to check the valid of raw .ns and datafiles, and how to recover the database?

    Read the article

  • Multimaster Keepalived Configuration (Virtual IP with Load Balancing)

    - by Rad Akefirad
    Here are requirements: 1. High Availability 2. Load Balancing First configuration 1. Two linux servers have been configured with one static IP for each: 10.17.243.11, 10.17.243.12 2. Keepalived has been installed and configured with one VRRP instance to provide one virtual IP (10.17.243.10 as VIP, 10.17.243.11 as master and 10.17.243.12 as backup). 3. Everything works fine. The VIP is assigned to the master server (10.17.243.11) as long as it is up and running. As soon as it goes down, the VIP will be assigned to the backup server (10.17.243.12). 4. The problem here is all communication goes to the master server. Second configuration 1. I found active-active configuration for Keepalived which is possible by defining more than one VRRP instance. So that both server have two IPs (real 10.17.243.11 and virtual 10.17.243.10 for server #1 and real 10.17.243.12 and virtual 10.17.243.20 for server #2. 2. Everything works fine. we have two VIPs which are accessible (HA). But all communication coming to each IP still goes to one single machine (either server #1 or #2 depending on the IP). However I found some tricks on the DNS to overcome this limitation. But it's not acceptable in our case. Question: Is there any way to have one virtual IP which is assigned to both servers? By that I mean both servers are handling some part of workload (like the thing we do in web server load balancing)? By using either keepalived or some other tools? Thanks in advance.

    Read the article

  • Reverse Proxy to filter out js files from multiple hosts in nginx

    - by stwissel
    I have a website http://someplace.acme.com that I want my users to access via http://myplace.mycorp.com - pretty standard reverse proxy setup. The special requirement: any js file - either identified by the .js extension and/or the mime-type (if that is possible) text/javascript needs to be served from a different location, a local tool that inspects the js for potential threats. So I have location / { proxy_pass http://someplace.acme.com; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~* \.(js)$ { proxy_pass http://127.0.0.1:8188/filter?source=$1; proxy_redirect off; proxy_buffering off; } The JS still is served from remote and I have no idea how to check for the mime type. What do I miss?

    Read the article

  • does wordpress auto update work without a cron job?

    - by perler
    I'm a bit on a loss here. Since WP 3.7 you can update your wordpress automatically. Since then it's more hit and miss on several servers here. I would like to understand, if it is enough to enable automatic updates described here and how this would work without a cron job. I'm under the impression right now, that the upgrade is only started, when ever someone logs into the backend, is this correct? If so, is there a way to automate the updates via a cron job?

    Read the article

  • QPS for dnscache

    - by vedaprasad
    I have 2 internal DNS servers ( ns1 & ns 2 ) on ubuntu 12.04 which run dnscache , and my clients resolv.conf have something like nameserver ns1 nameserver ns2 nameserver 8.8.8.8 since all my load is taken by ns1 , where as ns2 sits idle until ns1 is down or not serving my request . i would like to add these 2 server under a LB VIP . but my network team wants to know the QPS of the ns servers so that their LB is loaded . so is there any way to find out the QPS of dns queries running Dncache

    Read the article

  • ipv6 : why ndp resolves to global scope address?

    - by Julien
    I'm facing a strange ipv6 behavior and I don't know how to solve it because I'm not familiar with ipv6. Maybe this behavior is normal. I hope that you will help me. ( I'm running under debian 6.0.9 with a custom kernel 3.2.58 ) machine A is "2a00:7d30:edf6:100::1" wants to ping machine B, which is "2a00:7d30:edf6:100::10". Both are on the same segment. machine A asks for the address of machine B and I don't understand why machine B gives its global scope address instead of the local scope one ? 10:59:02.082785 IP6 2a00:7d30:edf6:100::1 ff02::1:ff00:10: ICMP6, neighbor solicitation, who has 2a00:7d30:edf6:100::10, length 32 10:59:02.082821 IP6 2a00:7d30:edf6:100::10 2a00:7d30:edf6:100::1: ICMP6, neighbor advertisement, tgt is 2a00:7d30:edf6:100::10, length 32 after that machine A pings the global scope address of machine B and it works fine : 10:59:02.082927 IP6 2a00:7d30:edf6:100::1 2a00:7d30:edf6:100::10: ICMP6, echo request, seq 1, length 64 10:59:02.082960 IP6 2a00:7d30:edf6:100::10 2a00:7d30:edf6:100::1: ICMP6, echo reply, seq 1, length 64 Thank you for you help best regards Julien

    Read the article

  • Create account for service

    - by Andy
    I am configuring a new server. The server is running Hudson that is going to copy some files from this server to another. The other server is a virtual machine. Both running Windows Server 2012. Hudson is started on server A with log on as "Local System". When I come to the copy phase it says "Access denied". Changing the log on to "Administrator" works. However, I guess this is bad. I do not have much experience with user management. I tried to create a own hudson account on both servers A and B. I tried to log on as hudson account in the service-management but it doesn't start. How would you create an account for this particular service that has access to the shared folder on server B and can be used to start the service on server A? I guess I need two accounts with same username and password on server A and server B? The folder on Server B is shared with everyone and the guest account is enabled.

    Read the article

  • set proxy for vpn server on ubuntu server 12.4

    - by Morteza Soltanabadiyan
    I have a vpn server with HTTPS, L2TP , OPENVPN , PPTP. i want to set proxy in the server so all connection that comes from vpn clients use the proxy that i set in my server. I made a bash script file for it , but proxy not working. gsettings set org.gnome.system.proxy mode 'manual' gsettings set org.gnome.system.proxy.http enabled true gsettings set org.gnome.system.proxy.http host 'cproxy.anadolu.edu.tr' gsettings set org.gnome.system.proxy.http port 8080 gsettings set org.gnome.system.proxy.http authentication-user 'admin' gsettings set org.gnome.system.proxy.http authentication-password 'admin' gsettings set org.gnome.system.proxy use-same-proxy true export http_proxy=http://admin:[email protected]:8080 export https_proxy=http://admin:[email protected]:8080 export HTTP_PROXY=http://admin:[email protected]:8080 export HTTPS_PROXY=http://admin:[email protected]:8080 Now , i dont know what to do to make a global proxy for server and all vpn clients use it automatically.

    Read the article

  • Godaddy one page hosting

    - by liv a
    Disclaimer: not sure this is the right place for this kind of question, sorry in advance, just point me to the right place and I'll move it. In godaddy when paying only for domain, without hosting, they state you can get one page hosting for free but that option only opens their web-builder. I want to create a nicely design landing page, where the content is static.Is there a way to make my domain point to a wordpress one page or self created html one page/ landing page?

    Read the article

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