on-internet

MySQL SELECT query in CodeIgniter WHERE a comma-separated column contains a specific whole value

This is my mysql query: $acountry = 1; $this->db->where_in('varcountry', $acountry); $val = $this->db->get('tblagencies')->result(); In database table the varcountry filed is stored like this 1,2,3,4; its type is varchar. Each row in the table has multiple countries -- that is the reason to use varchar datatype. I want to select table rows which have $acountry value in the field varcountry. How can I do that? Is the above code correct?

Join the discussion →

Enter Text From Excel cells to Word and retain the formatting

I have the fllowing code strMyFormat1 = oWB.Worksheets(strSelectedSheet).Range(strStemLocation).NumberFormat WordApp.Selection.TypeText Format(oWB.Worksheets(strSelectedSheet).Range(strStemLocation), strMyFormat1) & vbCr But it does not retain the format of the Excel Cell e.g. if the Excel Cell is bold I want that to be retained when entering into my word doc I know it works with copy and paste but I dont want to do that

Join the discussion →

Zend Framework Error: Failed opening required 'Zend/Application.php'

I get the following error when I try to run the project created by Zend Framework. Its looking for Zend/Application.php and that is available in the directory that is in my include_path. I do have read permissions on the directory. PHP Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='/var/www/vhosts/moderncloud.net/om/library:.:/var/www/vhosts/moderncloud.net/om /library:') in /var/www/vhosts/moderncloud.net/om/public/index.php on line 24 <?php // Define path to application directory //defined('APPLICATION_PATH') // || define('APPLIC

Join the discussion →

What is the best way to break HTML text on slashes (/)?

I have an HTML table 360px wide, which works great. The challenge is that sometimes a url appears http://this/is/a/really-really-really-really-really/long/url in the text. This causes the table to expand horizontally and a scroll bar appears on the bottom. I don't think overflow:hidden will work because half of the text would be hidden. What is the best way to force breaking the line on slashes (/) and dashes (-) in CSS (hopefully)? It should work with IE7+, Chrome, Firefox and Safari. Working in Rails 3 and jQuery.

Join the discussion →

Command-line file copy to remote share with different login

I want to copy a file to a remote location. This task will run from SQL Server (Agent) scheduler, and thus the COPY will run under the SQL Service account, and I don't want to create matching credentials on the remote machine. Only way I figured was: NET USE X: \RemoteServer\RemoteShare ThePassword /USER:RemoteUserID then I can run a command to copy to X: However, X: cannot be relied upon to be persistent, so I came up with: NET USE X: /DELETE NET USE X: \\RemoteServer\RemoteShare ThePassword /USER:RemoteUserID COPY MyFile X: NET USE X: /DELETE and ignored the initial delete if X: was not alre

Join the discussion →

How to make exe files from a node.js app?

I have a node app that I wrote, that I run as follows: node.exe app.js inputArg Is there some way I can package this into a .exe by itself? So I can just do something like this? App.exe inputArg I have some way of faking this by using a batch file, so I can do this: App.bat inputArg But this requires that I have all the dependencies and node in that folder, which is not ideal.

Join the discussion →

How are functions curried?

I understand what the concept of currying is, and know how to use it. These are not my questions, rather I am curious as to how this is actually implemented at some lower level than, say, Haskell code. For example, when (+) 2 4 is curried, is a pointer to the 2 maintained until the 4 is passed in? Does Gandalf bend space-time? What is this magic?

Join the discussion →

Install 'imagick' on Mac

I need to install the imagick extension for PHP. I have already installed ImageMagick. Then I did "sudo pecl install imagick". After this, I had such output in the console: Installing '/usr/include/php/ext/imagick/php_imagick.h' Installing '/usr/include/php/ext/imagick/php_imagick_defs.h' Installing '/usr/include/php/ext/imagick/php_imagick_shared.h' Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so' But as I'm using XAMPP, my extension directory (as I understand) is /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626. So what should I d

Join the discussion →

Operator precedence: multiple expressions with && and ||

I encountered a code line that looks like this: if ($users == 'all' || $_POST['user'] == 1 && $users == 'admins' || $_POST[ 'user' ] == 0 && $users == 'mods') ... I don't understand how are all these conditions met because there are not parentheses between them :( Is || more important than && ? Which parts get evaluated first?

Join the discussion →

Maven Could Not Resolve Dependency Via Local Nexus Repository

Why is Maven unable to resolve dependency with maven central when configured with our local Nexus Repository? I setup an in-house Sonatype Nexus repository and configure the maven to check my local Nexus instead of getting artifacts directly from public repositories. Our project was able to download the most artifacts except one artifact in Maven central. Here is the build error: Failed to execute goal on project shindig-gadgets: Could not resolve dependencies for project org.apache.shindig:shindig-gadgets:jar:3.0.0-SNAPSHOT: Could not find artifact com.ibm.icu:icu4j:jar:4.6 in nexus (http://m

Join the discussion →

Camping in national parks in Sri Lanka

Can you just take a tent, take some food and stay for a few days in national park in Sri Lanka? First of all is it legal to do so? For example are campfires allowed? And if it is legal is it safe? Are there any dangerous animals?

Join the discussion →

SQLite composite key (2 foreign keys) Link table

I've read the BNF grammar for the SQLite CREATE TABLE command found here: http://www.sqlite.org/lang_createtable.html. I was wondering how to create a link table. Let's say I have two tables: houses and electrical_items. I want to create a link table to have the house_id and the item_id as a composite key. However, SQLite doesn't appear to allow a primary key to be a foreign key? N.B. I want a third field pap_tested which stores the date the electrical item in the house was pap_tested. This linking table via composite primary key seems like the best approach.

Join the discussion →

webservice...cannot be resolved as a type

Im trying to implement a web service for an android app (with Phonegap) I have an Interface: package webservice; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface HelloService { @WebMethod(operationName = "hello") public String hello(String name); } and the implementation of it: package webservice; import javax.jws.*; import android.webkit.WebView; import com.phonegap.DroidGap; @WebService public class HelloServiceImpl implements HelloService { //Constructor for a invocation with javascript public LottozahlenServiceImpl(DroidGap gap, WebView view){ } public

Join the discussion →

Post an empty body to REST API via HttpClient

The API I'm trying to call requires a POST with an empty body. I'm using the WCF Web API HttpClient, and I can't find the right code that will post with an empty body. I found references to some HttpContent.CreateEmpty() method, but I don't think it’s for the Web API HttpClient code since I can't seem to find that method.

Join the discussion →

Devexpress Master detail grid control

Winform application. Is it possible to have devexpress master-detail grid control in winforms where the master and detail grid have no relation between them?? In web application devexpress detal grid doesn't require a relation between the master grid. So is this possible in Winforms application???

Join the discussion →

Implementation of Chazelle's triangulation algorithm

There is an algorithm for triangulating a polygon in linear time due to Chazelle (1991), but, AFAIK, there aren't any standard implementations of his algorithm in general mathematical software libraries. Does anyone know of such an implementation?

Join the discussion →

There is no Action mapped for namespace / and action name HelloWorld

I am trying to run a simple struts 2 HelloWorld application ,when i run it ,says "There is no Action mapped for namespace / and action name HelloWorld.Can somebody please help. WARNING: Could not find action or result There is no Action mapped for namespace / and action name HelloWorld. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwor

Join the discussion →

Unable to debug VSIX project

I'm trying to develop my first visual studio extensions project, I have VS10 SDK installed and was able to create a new project and can build it fine, however when I attempt to debug symbols are not loaded. I know that I can debug to VSIX project since I have downloaded a sample project online and it symbols are loaded and break points are being hit fine http://weshackett.com/2009/11/configure-vsix-project-to-enable-debugging/). So must be something specifically to do with the way I have created the VSIX project ( maybe !). One thing I do notice is that the dll and files aren't being copied ov

Join the discussion →

Merge commit without parent

Let's say I have the following commits in my master: master : ---A----B----C----D---E Now I need to create new branch from commit A and include only changes in commit C master : ---A----B----C----D---E \ branch2 : \-------C So I need to put in my branch2 commit C without B How can I do that ?

Join the discussion →

CSS "float:right" property equivalent in LinearLayout on android?

On CSS we can write : <div style="float:right"> Text1 </div> <div style="float:right"> Text2 </div> by this way Text1 will appear on the right .. I'm trying to do the same with LinearLayout , the View should appear from right to left : <LinearLayout android:id="@+id/linearLayout1" android:layout_gravity="right" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:weightSum="2" android:orientation="horizontal"> <!-- First Column should be on the right : Text1--> <LinearLayout android:id="@+id/linearLayout2" android:lay

Join the discussion →

Keep file name in FileUpload control after postBack

I have got problem with FileUpload control. I have this one, two drop down list, text box and button. If I select in first dropDownList "Yes" second one become disable and set value on NO (In second ddl I have two option YES or NO and in first one as well) however if I select NO in first dropDownList I posible to choose both option in second dropDownList. First ddl change second one on postBack using selectedIndexChanged evet and when it happends I loose file name in UploadFile control which I set before. Code sample: <asp:FileUpload ID="fuUploadGeometry" runat="server" Width="100%" /> <asp:Dr

Join the discussion →

Load scripts asynchronously

I am using several plugins, custom widgets and some other libraries from jQuery. As a result, I have several .js and .css files. I need to create a loader for my site because it takes some time to load. It will be nice if I can display the loader before importing all the: <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="js/myFunctions.js"></script> <link type="text/css" href="css/main.css" rel="stylesheet" /> ... .... etc. I have found several tutorials that enable me to import a JavaScript library asynchronously. For example, I can do s

Join the discussion →

Javascript Obfuscator to run locally which each compile

I want a free command line application or Java application that I can run on one of my JavaScript files and obfuscate it. I prefer to run it when I compile my website in visual studio locally, but it can be a software that runs locally and I will run it manually. I want a strong obfuscator that even when reversed engineer, it will be very difficult to understand the code. My project was built with ASP.net and C# if that matters for the answer. Thanks!

Join the discussion →

WebDriver Automation on verifying an email

I'm using WebDriver and Java to automate some web pages. I have a scenario that I'm not sure the best way to manage. A website provides the option to leave a comment, but if you are not a user it sends you the email with a link to click to activate the user and add the comment. Is there a clean way to automate leaving the site to wait for the email, and when it's found clicking the link.

Join the discussion →
Older stories