on-internet

Set position absolute and margin

I would like to set an element's position to absolute and have a margin-bottom, but it seems that the margin-bottom doesn't have an effect. HTML: <div id='container'></div> CSS: #container { border: 1px solid red; position: absolute; top: 0px; right: 0px; width: 300px; margin-bottom: 50px; // this line isn't working }

Join the discussion →

"" What does it mean?

I use a fantastic javascript organization tree generator named "ECOTree" but the drawing does not work when I put <!DOCTYPE html>. Labels in the boxes are not put in the boxes correctly. You can see the error at sample1.htm on the site below. Could anybody suggest me how to fix. http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=16192 (In order to follow my project rule, I have to define <!DOCTYPE html>)

Join the discussion →

Run .bat file from C#

i am facing a strange issue , i have a .bat file which contains a code for renaming a file , when i open the .bat file manually it does what it is written on it which is renaming a file , but when i try to open it programtically from C# , it doesnt do anything , it jsut open the file and do not compile what it is written into . i typed that code : Process.Start(@"file.bat"); I also knew if you typed the path into cmd and pressed enter it will open the file and compile it , so i wrote that : ProcessStartInfo psi3 = new ProcessStartInfo("cmd", "/c " + '"'+"D:\\my Work\\My Soft\\CA Delete\\CA Del

Join the discussion →

itextsharp place Pdfptable at desired position

Header Content and Pdftable is overlapping How can I place PdfPTable at any position in the pdf page using (x, y) positioning like (100, 200) or (15, 100) at any place on the pdf page? Header Table using PdfEventHelper public override void OnEndPage(PdfWriter writer, Document document) { AddHeader(writer, document); } public void AddHeader(PdfWriter writer, Document document) { // set no of rows PdfPTable headerTable = new PdfPTable(1); // set the width headerTable.TotalWidth = document.PageSize.Width; headerTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER; PdfPCell company = new P

Join the discussion →

machine.config' is denied

My application is running on windows server 2000 and IIS 6. Up until this morning the application was working fine. But now I'm getting the error below: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: An error occurred loading a configuration file: Access to the path 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\machine.config' is denied. Source Error: [No relevant source lines] Source F

Join the discussion →

Failed to instantiate SLF4J LoggerFactory on Spring 'mvc-basic' tutorial

I'm trying a Spring 3.x tutorial on Eclipse 3.7 with m2e and Maven Integration for WTP plugins installed. I converted the above tutorial to Maven Project, but when i deploy the web application i get the following exception: Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: org/apache/log4j/Level My pom.xml look like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0

Join the discussion →

Get n-th bit of an integer

I am given a large integer a, and a (relatively small) integer n. What is the fastest way to get the nth bit (with the least significant bit being 0) of the binary representation of a using native Python?

Join the discussion →

ExecuteReader: CommandText property has not been initialized

I've done a few hours of research but nothing seems to apply to my current situation. Using: Visual Studio 2010 .net 4.0, Language: C# Issue: I created a form and then drag and dropped the Specific Table from my Datasources onto the form to have VS2010 create the data table for me. When I attempted to change or add values to the database using the data table, I get the error listed above "ExecuteReader: CommandText property has not been initialized". As from my previous research, NO, I have not defined a CommandText nor do I know where to create one considering VS2010 created all the datatable

Join the discussion →

What is ':-!!' in C?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if condition is true, but also produce a result (of value 0 and type size_t), so the expression can be used e.g. in a structure initializer (or where-ever else comma expressions aren't permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) What does :-!! do? Update: In recent times, the macro has been moved to /usr/include/linux/build_bug.h

Join the discussion →

MATLAB C API: What does mxDestroyArray(NULL) do?

I use MATLAB's mxDestroyArray() function and wonder how to do proper error handling. If I called mxCreate*Array() or similiar, I get a valid pointer on success and NULL on failure, i. e. if memory is full. If I create several arrays in this way and at least one fails, I would like to free all what I don't need any longer. Here I am wondering: Do I need to explicitly check every value? if (error) { if (a) mxDestroyArray(a); if (b) mxDestroyArray(b); if (c) mxDestroyArray(c); } or can I just omit the checks? if (error) { mxDestroyArray(a); mxDestroyArray(b); mxDestroyArray(c); }

Join the discussion →

ZK Listbox: Horizontal scrollbar not appearing with hflex=min (in other container/Tabbox)

Here's a snap of the problem: Link to a picture of the problem Layout works correctly without hflex="min" - but of course then the columns are too narrow. Here is the blowup: <?xml version="1.0" encoding="UTF-8"?> <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> <zk> <style> .module-alternative-amount-cell { text-align: right; } .cost-entry-alternative-amount-cell { text-align: right; } </style> <window id="thisEditor" width="99%"> <!-- header label --> <vbox> <space height="5px" /> <hbox> <space width="5px" /> <label id="header" value="A header" style="font-weight:bold;font-

Join the discussion →

Recover the deleted files in amazon ec2

How I would recover the recent deleted files from amazon ec2 ubuntu server.For example The all "tar" files are removed unfortunately in amazon ec2 + ubuntu 11.04 instance. The removed files should be retrieved. Could you suggest for this problem?

Join the discussion →

Connect to SQL Server instance using pymssql

I'm attempting to connect to a SQL Server instance from a Windows box using pymssql (version 2.0.0b1-dev-20111019 with Python 2.7.1). I've tried the most basic approach from the console: import pymssql c = pymssql.connect(host = r'servername\instance', user = 'username', password = 'userpassword') In response to this, I get the very helpful error: InterfaceError: Connection to the database failed for an unknown reason. I am reasonably confident that the connection information is correct, as it works when I use adodbapi, with the following commands: import adodbapi c = adodbapi.connect(r'Provid

Join the discussion →

Extjs using store proxy api; CRUD

Hi I have attempted to implement writer.js and I am getting an error: Uncaught TypeError: Object # has no method 'read' here is a snippet of my code and would appreciate any help with this issue: Ext.onReady(function(){ var store = Ext.create('Ext.data.Store', { model: 'User', autoLoad: true, autoSync: true, proxy: { type: 'ajax', api: { read: '/orm_2/view/user/app/remote/app/controllers/users.php?action=view', create: '/orm_2/view/user/app/remote/app/controllers/users.php?action=create', update: '/orm_2/view/user/app/remote/app/controllers/users.php?action=update', destroy: '/orm_2/view/user/

Join the discussion →

Fulltext search query not working in CodeIgniter

I'm trying to run a fulltext index search in CodeIgniter. My search function looks like this: public function get_searchresult_count($searchresult) { $today_date = date('Y-m-d'); $db_photos = $this->load->database('photos', TRUE); $db_photos->select('*'); $db_photos->from('photos'); $db_photos->where('MATCH (`title`, `description`) AGAINST ("'.$searchresult.'")', NULL); $db_photos->where('approved', '1'); return $db_photos->count_all_results(); } I need the return to be count_all_results because it needs to get a number for the pagination of the results. I can't get it working, I get this erro

Join the discussion →

How can I convert leading spaces to tabs in Vim or Linux?

I've looked over several questions on Stack Overflow for how to convert spaces to tabs without finding what I need. There seem to be more questions about how to convert tabs to spaces, but I'm trying to do the opposite. In Vim I've tried :retab and :retab! without luck, but I believe those are actually for going from tabs to spaces anyways. I tried both expand and unexpand at the command prompt without any luck. How can I convert leading spaces to tabs using either Vim or the shell?

Join the discussion →

what does curly brackets {} do in a PHP string? [duplicate]

For example, check this following query; $query = "SELECT * FROM users WHERE user='{$_POST['username']}'; What's the use? In string contexts, I do understand the problem it solves. I can do stuff like $animal = "cat" echo "{$animal}s." // outputs cats but in the SQL I posted above, I just don't get it. Wouldn't the following be equally good? $query = "SELECT * FROM users WHERE user='$_POST['username']' AND password='$_POST['password']'"; So, Where does using the { and } get handy? Appreciate any example in SQL context?

Join the discussion →

Under what circumstances can malloc return NULL?

It has never happened to me, and I've programming for years now. Can someone give me an example of a non-trivial program in which malloc will actually not work? I'm not talking about memory exhaustion: I'm looking for the simple case when you are allocating just one memory block in a bound size given by the user, lets say an integer, causes malloc to fail.

Join the discussion →

Detect if device is iOS

I'm wondering if it's possible to detect whether a browser is running on iOS, similar to how you can feature detect with Modernizr (although this is obviously device detection rather than feature detection). Normally I would favour feature detection instead, but I need to find out whether a device is iOS because of the way they handle videos as per this question YouTube API not working with iPad / iPhone / non-Flash device

Join the discussion →

Multithreaded file copy for Linux needed

I have a "large" amount of data that needs to be copied every day. (6TB) It is 15 disks presented from a SAN over Fibre Channel and being copied to a local array consisting of 22 spindles. sources are /mnt/disk1 /mnt/disk2 /mnt/disk3 destination is /mnt/Data/SystemBackup/ Due to the nature of our SAN, single threaded file copy is not very fast; but it is very capable of 600+mb/sec if we ask it in the right way. :) I need a way to spawn multiple threads in a file copy. There are MANY ways to do this in windows... but I can't find any native methods available to Linux. Could something like Pytho

Join the discussion →

What to advise graphics designer designing layout and images to be suitable for multiple screens?

I've read the Android Developers guidance on Supporting Multiple Screens here... http://developer.android.com/guide/practices/screens_support.html ... and I understand from a developer's perspective the easiest way to cater for most screens is to have three sets of drawables and layouts (ldpi, mdpi, hdpi) and to use relative positioning in layout files and to specify heights, widths etc in density independent pixels. I'm going to have a graphics designer design my screens and the individual buttons, images etc who'll be designing for high density screens (240dpi) and then scaling the graphics

Join the discussion →

How to I set up a vendor branch workflow for Plastic SCM?

I have been thrown into a software development project where we have a PHP application from a vendor with fairly regular code updates. I need to be able to build on top of this code while, at the same time, I need to be able to track the changes in the vendor's code and merge them into our own code releases. I envision it as something like this: VENDOR v1.0 --------v1.2-----------v1.3--------v2.0---------v2.1------ETC. | V V V OUR BRANCH v1.0-------v1.1---------v1.2------ETC. I am starting this from scratch and looking for recommendations on the source control software to use (I am considering

Join the discussion →
Older stories