Daily Archives

Articles indexed Friday September 21 2012

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

  • Direct VoIP call from one iOS device to another

    - by user1682856
    Could you please give some advises. I'am going to develop peer-to-peer VoIP iOS application. And want do it without any SIP proxy, SIP providers and other servers. Just VoIP calls frpm iOSdevice-to-iOSdevice. Both iOSdevice could be somewhere in Internet. Is it real in VoIP (with PJSIP for example and general with SIP)? Could you please point me to main keys that I need for development. I'am already read these topics. Is it real solve problems with addressing in my configuration. Anybody know is PJSIP could help with correcting addresing.

    Read the article

  • Get the Value of Array that contains A String in Objective-C

    - by jaytrixz
    How can I get the value of an array that has one value which is a string in Objective-C? I'm actually getting confused on how to properly get the string value inside the array I'm accessing. I'm getting the value of an array named "sMessage" that has one value of type NSString "success". This is the response from the API: ({"sMessage":"success"}) I'm trying to get the value by using this code and logs it to the console: NSArray *resultsArray = [json objectForKey:@"sMessage"]; NSString *loginResult = [[resultsArray valueForKey:@"sMessage"] lastObject]; NSLog(@"Result is: %@", loginResult);

    Read the article

  • JPA - Performance with using multiple entity manager

    - by Nguyen Tuan Linh
    My situation is: The code is not mine I have two kinds of database: one is Dad, one is Son. In Dad, I have a table to store JNDI name. I will look up Dad using JNDI, create entity manager, and retrieve this table. From these retrieved JNDI names, I will create multiple entity managers using multiple Son databases. The problem is: Son have thousands of entities. It takes each Son database around 10 minutes to load all entities. If there is 4 Son databases, it will be 40 minutes. My question: Is there any way to load all entities and use them for all entity manager? Please look at the code below For each Son JNDI: Map<String, String> puSonProperties = new HashMap<String, String>(); puSonProperties.put("javax.persistence.jtaDataSource", sonJndi); EntityManagerFactory emf = Persistence.createEntityManagerFactory("PUSon", puSonProperties); PUSon - All of them use the same persistence unit log.info("Verify entity manager for son: {0} - {1}", sonCode, emSon.find(Son_configuration.class, 0) != null ? "ok" : "failed!"); This is the actual code where the loading of all entities begins. 10 mins.

    Read the article

  • Bootstrap stop Modal showing on page load

    - by Subby
    I only want the Modal to show when I click on a certain button. At the moment, the Modal shows itself whenever I load the page. Can someone please tell me where I am going horribly wrong? <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">Modal header</h3> </div> <div class="modal-body"> <p>One fine body…</p> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn btn-primary">Save changes</button> </div> </div> I am using ASP.NET MVC 3 EDIT: I am NOT using any Javascript at the moment.

    Read the article

  • Automatically copy files without overwriting, but creating numbered ones instead

    - by user1688322
    I need to copy files at a regular interval, eg once an hour so I tried setting up an xcopy batch saying it should copy the files it needs to copy to another folder. Now when it copies, it overwrites the files which is not what it is supposed to do. When a file is copied, it should create a new file instead, named something like File.txt, File-COPY1.txt, File-COPY2.txt or something like that. Any way to do that? Thanks in advance.

    Read the article

  • it is possible to "group by" without losing the original rows?

    - by toPeerOrNotToPeer
    i have a query like this: ID | name | commentsCount 1 | mysql for dummies | 33 2 | mysql beginners guide | 22 SELECT ..., commentsCount // will return 33 for first row, 22 for second one FROM mycontents WHERE name LIKE "%mysql%" also i want to know the total of comments, of all rows: SELECT ..., SUM(commentsCount) AS commentsCountAggregate // should return 55 FROM mycontents WHERE name LIKE "%mysql%" but this one obviously returns a single row with the total. now i want to merge these two queries in one single only, because my actual query is very heavy to execute (it uses boolean full text search, substring offset search, and sadly lot more), then i don't want to execute it twice is there a way to get the total of comments without making the SELECT twice? !! custom functions are welcome !! also variable usage is welcome, i never used them...

    Read the article

  • How to test using conditional defines if the application is Firemonkey one?

    - by Gad D Lord
    I use DUnit. It has an VCL GUITestRunner and a console TextTestRunner. In an unit used by both Firemonkey and VCL Forms applications I would like to achieve the following: If Firemonkey app, if target is OS X, and executing on OS X - TextTestRunner If Firemonkey app, if target is 32-bit Windows, executing on Windows - AllocConsole + TextTestRunner If VCL app - GUITestRunner {$IFDEF MACOS} TextTestRunner.RunRegisteredTests; // Case 1 {$ELSE} {$IFDEF MSWINDOWS} AllocConsole; {$ENDIF} {$IFDEF FIREMONKEY_APP} // Case 2 <--------------- HERE TextTestRunner.RunRegisteredTests; {$ELSE} // Case 3 GUITestRunner.RunRegisteredTests; {$IFEND} {$ENDIF} Which is the best way to make Case 2 work?

    Read the article

  • Are there known problems with >= and <= and the eval function in JS?

    - by Augier
    I am currently writing a JS rules engine which at one point needs to evaluate boolean expressions using the eval() function. Firstly I construct an equation as such: var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator + " " + "relation.value"; relation.relatedTrigger.previousValue is the value I want to compare. relation.operator is the operator (either "==", "!=", <=, "<", "", ="). relation.value is the value I want to compare with. I then simply pass this string to the eval function and it returns true or false as such: return eval(equation); This works absolutely fine (with words and numbers) or all of the operators except for = and <=. E.g. When evaluating the equation: relation.relatedTrigger.previousValue <= 100 It returns true when previousValue = 0,1,10,100 & all negative numbers but false for everything in between. I would greatly appreciate the help of anyone to either answer my question or to help me find an alternative solution. Regards, Augier. P.S. I don't need a speech on the insecurities of the eval() function. Any value given to relation.relatedTrigger.previousValue is predefined. edit: Here is the full function: function evaluateRelation(relation) { console.log("Evaluating relation") var currentValue; //if multiple values if(relation.value.indexOf(";") != -1) { var values = relation.value.split(";"); for (x in values) { var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator + " " + "values[x]"; currentValue = eval(equation); if (currentValue) return true; } return false; } //if single value else { //Evaluate the relation and get boolean var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator + " " + "relation.value"; console.log("relation.relatedTrigger.previousValue " + relation.relatedTrigger.previousValue); console.log(equation); return eval(equation); } } Answer: Provided by KennyTM below. A string comparison doesn't work. Converting to a numerical was needed.

    Read the article

  • Access to the path Server.MapPath is denied

    - by Alex
    I created one pdf document var document = new Document(); string path = Server.MapPath("AttachementToMail"); PdfWriter.GetInstance(document, new FileStream(path + "/"+DateTime.Now.ToShortDateString()+".pdf", FileMode.Create)); Now I want to download this document Response.ContentType = "Application/pdf"; Response.AppendHeader("Content-Disposition", "attachment; filename="+ DateTime.Now.ToShortDateString() + ".pdf" + ""); Response.TransmitFile(path); Response.End(); but it gave me error Access to the path '~\AttachementToMail' is denied. read / write access for IIS_IUSRS exists

    Read the article

  • How can I fade in a JPanel & children?

    - by Christian 'fuzi' Orgler
    I know that I can fade in a panel, by adding the alpha value to the background color & a timer. But how can I fade in a panel with child components (like a JLabel)? EDIT _fadeTimer = new Timer(40, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (_alpha == 255) { _fadeTimer.stop(); } else { pnl_hint.setBackground(new Color( bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), (_alpha += 1))); pnl_hint.updateUI(); } } }); _fadeTimer.start();

    Read the article

  • Load external pages using jquery

    - by user1688011
    I'm trying to use jquery to load external pages into the current without reloading. Apparently everything works fine except of one little issue, I hope I'll be clear as much as possible. When I call the page 'info.php' it is loaded into the #content div. That's what the script supposed to do, the problem is that in the main page, which contains the script and the #content div, I already have some code that I want it to be executed when someone visit the page and not to be called from external page. That is actually the case but when I click on one of the links in the menu, I can't go back to the initial content.. <script> $(function() { $('#nav a').click(function() { var page = $(this).attr('href'); $('#content').load(page + '.php'); return false; }); }); </script> <ul id="nav"> <li><a href="#">Page1</a></li> <li><a href="about">About</a></li> <li><a href="contact">Contact</a></li> <li><a href="info">Info</a></li> </ul> <div id="content"> Here I have some code that I wanted to be attributed to the "Page1" </div> Do you have any suggestions how to fix this issue? Thanks

    Read the article

  • Efficient list compacting

    - by Patrik
    Suppose you have a list of unsigned ints. Suppose some elements are equal to 0 and you want to push them back. Currently I use this code (list is a pointer to a list of unsigned ints of size n for (i = 0; i < n; ++i) { if (list[i]) continue; int j; for (j = i + 1; j < n && !list[j]; ++j); int z; for (z = j + 1; z < n && list[z]; ++z); if (j == n) break; memmove(&(list[i]), &(list[j]), sizeof(unsigned int) * (z - j))); int s = z - j + i; for(j = s; j < z; ++j) list[j] = 0; i = s - 1; } Can you think of a more efficient way to perform this task? The snippet is purely theoretical, in the production code, each element of list is a 64 bytes struct EDIT: I'll post my solution. Many thanks to Jonathan Leffler. void RemoveDeadParticles(int * list, int * n) { int i, j = *n - 1; for (; j >= 0 && list[j] == 0; --j); for (i = 0; i < j; ++i) { if (list[i]) continue; memcpy(&(list[i]), &(list[j]), sizeof(int)); list[j] = 0; for (; j >= 0 && list[j] == 0; --j); if (i == j) break; } *n = i + 1; }

    Read the article

  • Importing hibernate configuration file into Spring applicationContext

    - by Himanshu Yadav
    I am trying to integrate Hibernate 3 with Spring 3.1.0. The problem is that application is not able to find mapping file which declared in hibernate.cfg.xml file. Initially hibernate configuration has datasource configuration, hibernate properties and mapping hbm.xml files. Master hibernate.cfg.xml file exist in src folder. this is how Master file looks: <hibernate-configuration> <session-factory> <!-- Mappings --> <mapping resource="com/test/class1.hbm.xml"/> <mapping resource="/class2.hbm.xml"/> <mapping resource="com/test/class3.hbm.xml"/> <mapping resource="com/test/class4.hbm.xml"/> <mapping resource="com/test/class5.hbm.xml"/> Spring config is: <bean id="sessionFactoryEditSolution" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="data1"/> <property name="mappingResources"> <list> <value>/master.hibernate.cfg.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> </props> </property> </bean>

    Read the article

  • Controlling QR Code Scanning Actions

    - by Elijah
    I am looking to create a QR code that does the following: When scanned from inside an application, it dislpays a custom alert, (Ex. "You won $5") When scanned with a different QR code reader (non app) it goes to a mobile web page that directs the user to download the application. My main question is: Can you control what happens when a QR code is scanned by a reader that is not your own? (A 'default' action, if you will)

    Read the article

  • Symfony 2 form repeated validation in Entity with annotation

    - by Sukhrob
    My question is "How can I do form repeated validation in Entity with annotation?". I have an Account entity with (email, password and confirmPassword) attributes. When a new user registers a new account, he/she has to fill in email, password and confirmPassword fields. Obviously, password and confirmPassword fields must match. I saw an example of this validation with pure php (form builder) in Stachoverflow like below. $builder->add('password', 'repeated', array( 'type' => 'password', 'first_name' => 'Password', 'second_name' => 'Password confirmation', 'invalid_message' => 'Passwords are not the same', )); But, this is not what I want. I want this functionality with annotation in my Account entity. Maybe * @Assert\Match( * matchField = "password", * message = "The password confirmation does not match password." * ) protected $confirmPassword;

    Read the article

  • How to maintain an ordered table with Core Data (or SQL) with insertions/deletions?

    - by Jean-Denis Muys
    This question is in the context of Core Data, but if I am not mistaken, it applies equally well to a more general SQL case. I want to maintain an ordered table using Core Data, with the possibility for the user to: reorder rows insert new lines anywhere delete any existing line What's the best data model to do that? I can see two ways: 1) Model it as an array: I add an int position property to my entity 2) Model it as a linked list: I add two one-to-one relations, next and previous from my entity to itself 1) makes it easy to sort, but painful to insert or delete as you then have to update the position of all objects that come after 2) makes it easy to insert or delete, but very difficult to sort. In fact, I don't think I know how to express a Sort Descriptor (SQL ORDER BY clause) for that case. Now I can imagine a variation on 1): 3) add an int ordering property to the entity, but instead of having it count one-by-one, have it count 100 by 100 (for example). Then inserting is as simple as finding any number between the ordering of the previous and next existing objects. The expensive renumbering only has to occur when the 100 holes have been filled. Making that property a float rather than an int makes it even better: it's almost always possible to find a new float midway between two floats. Am I on the right track with solution 3), or is there something smarter?

    Read the article

  • show horizontal scroll bar in jqgrid

    - by Hunt
    Please see the link below, http://www.logicatrix.com/example/records.html In this table there are many columns included , so what i want is to get fit the whole table into drawn gray border i.e. div element with class name bms-dashboard-body. with a horizontal scroll bar just like an excel sheet has on the right bottom corner a small one. is it possible to create liquid layout of this jqgrid table ? if someone has another approach , to fit the this table then i don't mind.

    Read the article

  • Merge Word Documents (Office Interop & .NET), Keeping Formatting

    - by mbmccormick
    I'm having some difficulty merging multiple word documents together using Microsoft Office Interop Assemblies (Office 2007) and ASP.NET 3.5. I'm able to merge the documents, but some of my formatting is missing (namely the fonts and images). My current merge code is shown below. private void CombineDocuments() { object wdPageBreak = 7; object wdStory = 6; object oMissing = System.Reflection.Missing.Value; object oFalse = false; object oTrue = true; string fileDirectory = @"C:\documents\"; Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document wDoc = WordApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); string[] wordFiles = Directory.GetFiles(fileDirectory, "*.doc"); for (int i = 0; i < wordFiles.Length; i++) { string file = wordFiles[i]; wDoc.Application.Selection.Range.InsertFile(file, ref oMissing, ref oMissing, ref oMissing, ref oFalse); wDoc.Application.Selection.Range.InsertBreak(ref wdPageBreak); wDoc.Application.Selection.EndKey(ref wdStory, ref oMissing); } string combineDocName = Path.Combine(fileDirectory, "Merged Document.doc"); if (File.Exists(combineDocName)) File.Delete(combineDocName); object combineDocNameObj = combineDocName; wDoc.SaveAs(ref combineDocNameObj, ref m_WordDocumentType, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing); } I don't care necessarily how this is accomplished. It could output via PDF if it had to. I just want the formatting to carry over. Any help or hints that you could provide me with would be appreciated! Thanks!

    Read the article

  • navigate all items in a wpf tree view

    - by Brian Leahy
    I want to be able to traverse the visual ui tree looking for an element with an ID bound to the visual element's Tag property. I'm wondering how i do this. Controls don't have children to traverse. I started using LogicalTreeHelper.GetChildren, which seems to work as intended, up until i hit a TreeView control... then LogicalTreeHelper.GetChildren doesnt return any children. Note: the purpose is to find the visual UI element that corresponds to the data item. That is, given an ID of the item, Go find the UI element displaying it. Edit: I am apparently am not explaining this well enough. I am binding some data objects to a TreeView control and then wanting to select a specific item programaticly given that business object's ID. I dont see why it's so hard to travers the visual tree and find the element i want, as the data object's ID is in the Tag property of the appropriate visual element. I'm using Mole and I am able to find the UI element with the appropriate ID in it's Tag. I just cannot find the visual element in code. LogicalTreeHelper does not traverse any items in the tree. Neither does ItemContainerGenerator.ContainerFromItem retrieve anything for items in the tree view.

    Read the article

  • RadioButtonList.SelectedIndex vs RadioButtonList.SelectedValue

    - by Pinpin
    Out of curiosity, anyone knows the particulars of the internal implementation of ListControl.SelectedIndex = (int) <new valueIndex> VS ListControl.SelectedValue = <new value>.ToString() I'm having difficulties with a custom validation object we've built here to process all validation in one sweep. I suspect using <SelectedValue = > will raise a SelectedIndexChanged event, even though both the value and index remain the same, both before and after the operation. (The ListControl's values are populated declaratively....) As ever, thank you for your time!

    Read the article

  • BigQuery - Best Practices for Running Queries on Massive Datasets

    BigQuery - Best Practices for Running Queries on Massive Datasets Join Michael Manoochehri and Ryan Boyd from the big data Developer Relations team on Friday, September 21th, at 10am PDT, as they discuss best practices for answering questions about massive datasets with Google BigQuery. They'll explore interesting Big Data use cases with some of our public datasets, using BigQuery's SQL-like language to return query results in seconds. They will also cover some of BigQuery's unique query functions as well. For a general overview of BigQuery, watch our overview video: youtu.be Please use the moderator below (goo.gl to ask your questions, which will be answered live! More info here: developers.google.com From: GoogleDevelopers Views: 0 0 ratings Time: 00:00 More in Science & Technology

    Read the article

  • Hyper-V/Ubuntu server 12.04 - VM does not stop

    - by Alex T.
    i just installed a ubuntu 12.04 server on a 2008 R2 Hyper-V server and all is fine (networking/storage ...). There is just one thing, when i halt my linux (using "sudo halt"), i can see on the console that the system is halted but the vm status on hyper-v is still "started". Then i need to stop it on the hyper-v management tool. Anybody has an idea on how to properly stop this VM on hyper-V automatically ? Thanks, Alex

    Read the article

  • Magento hosting on a budget

    - by spa
    I have to do a setup for Magento. My constraint is primarily ease of setup and fault tolerance/fail over. Furthermore costs are an issue. I have three identical physical servers to get the job done. Each server node has an i7 quad core, 16GB RAM, and 2x3TB HD in a software RAID 1 configuration. Each node runs Ubuntu 12.04. right now. I have an additional IP address which can be routed to any of these nodes. The Magento shop has max. 1000 products, 50% of it are bundle products. I would estimate that max. 100 users are active at once. This leads me to the conclusion, that performance is not top priority here. My first setup idea One node (lb) runs nginx as a load balancer. The additional IP is used with domain name and routed to this node by default. Nginx distributes the load equally to the other two nodes (shop1, shop2). Shop1 and shop2 are configured equally: each server runs Apache2 and MySQL. The Mysqls are configured with master/slave replication. My failover strategy: Lb fails = Route IP to shop1 (MySQL master), continue. Shop1 fails = Lb will handle that automatically, promote MySQL slave on shop2 to master, reconfigure Magento to use shop2 for writes, continue. Shop2 fails = Lb will handle that automatically, continue. Is this a sane strategy? Has anyone done a similar setup with Magento? My second setup idea Another way to do it would be to use drbd for storing the MySQL data files on shop1 and shop2. I understand that in this scenario only one node/MySQL instance can be active and the other is used as hot standby. So in case shop1 fails, I would start up MySQL on shop2, route the IP to shop2, and continue. I like that as the MySQL setup is easier and the nodes can be configured 99% identical. So in this case the load balancer becomes useless and I have a spare server. My third setup idea The third way might be master-master replication of MySQL databases. However, in my optinion this might be tricky, as Magento isn't build for this scenario (e.g. conflicting ids for new rows). I would not do that until I have heard of a working example. Could you give me an advice which route to follow? There seems not one "good" way to do it. E.g. I read blog posts which describe a MySQL master/slave setup for Magento, but elsewhere I read, that data might get duplicated when the slave lags behind the master (e.g. when an order is placed, a customer might get created twice). I'm kind of lost here.

    Read the article

  • Printer redirection on server 2003

    - by user137841
    On windows server 2003 when one user connects to the server via RDP the default printer of the server for her profile does not change to the redirected printer of the session. This only happens with the one user all the other users default printers defaults to their session printer automatically. I tried the following solution but there was no \Terminal Server\Printer Redirection in gpedit.msc http://technet.microsoft.com/en-us/library/cc731963(v=ws.10).aspx Computer Configuration\Policies\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Printer Redirection Is there a different place to check the Printer Redirection?

    Read the article

  • incorrect DNS entries on server 2008 r2

    - by user137841
    On the main DC (windows server 2008 R2 standard) in our network I have to clear some old DNS entries every now and then in the Forward and Reverse Lookup Zones. I have set the server Aging/Scavenging settings to Scavenge stale resource records, with both the No-refresh interval and Refresh interval to 5 days. Yet every now and then I still have to logon to the sever and remove the DNS entries for computers that is not part of the domain anymore or has been renamed ect. Is there a different way to automatically remove the old entries?

    Read the article

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