hello,
I have a little problem using c# to find tables inside Word textboxes.
Using this method (abstractDoc.Tables.Count) I get only the number of the main tables.
What would be the solution to reach the tables that are inside textboxes ?
I thank you in advance.
How to find maximum occuring integer(Mode) in an unsorted array of integers? One O(nlogn) approach I could think of is to sort. Is there any other best approach?
This may not be directly related to programming, but I always find it hard to get quality icons that can be used for software.
I currently have the need for some type of "green checkmark image", and I always seem to be looking for print, save, delete types of icons...
Anybody have good resources?
Note: I rather not be stealing someone's intellectual property.
I need to move all the hard coded strings in my source code in .resx files. There is a tool that could help me find all the hardcoded strings within C# code?
from logn time ago i have seen a plugin i think it is Accordion plugin
its like that
item 1 >>> item4
it merge it in one item and when hover by mouse its will be
item 1 > item 2 > item 3 > item4
agian
i will kill my self i can not find it
I am trying to find words starts with a specific character like:
'Lorem ipsum #text. Second lorem ipsum. How #are You. It's
ok. Done. Something #else now.'
I need to get all words starts with "#". so my expected results are #text, #are, #else
Any ideas?
I have two android projects, ProjA requires ProjB (in Eclipse Properties Java Build Path Projects Add ProjB). Every thing compiles ok in Eclipse, but when I run ProjA I get an error:
Could not find method XXX, referenced
from method YYY.
Where XXX - is the method from ProjB.
How can I fix the settings?
I'm getting the Cannot find symbol error from my code. Does anyone know what can cause this problem?
// Register JDBC driver Class.forName("net.sourceforge.jtds.jdbc.Driver"); method forName(java.Lang.String)
Class.forName("net.sourceforge.jtds.jdbc.Driver);
^
when I invoke "<java classname='org.apache.axis2.wsdl.wsdl2java'> <arg value ...> ...", It works well !!!
But when I try to invoke "<java classname='org.apache.axis2.wsdl.java2wsdl'> ...", I always get an error "Can not find org.apache.axis2.wsdl.java2wsdl"
Can anybody tell me why? Thanks.
I am trying to figure out where the ocean is in an arbitrary Google Maps view.
I actually have the lat lon (a range of points, when joined together form the coastline) of the coastline. But how do I tell which side of this line is the coastline?
One possible solution would be to find the latlon of the nearest service or town or business or something, and then the ocean is obviously on the other side (given a small enough enclosing polygon).
Is there a better way?
I want to find out which tables have been modified in the last hour in a MySQL database. How can I do this?
I am new to MySQL so please try to explain it as simply as you can.
thank you!
I have this code:
With shtControleblad
Dim strsql_basis As String
strsql_basis = "INSERT INTO is_calculatie (offerte_id) VALUES ('" & Sheets("controleblad").Range("D1").Value & "')"
rs.Open strsql_basis, oConn, adOpenDynamic, adLockOptimistic
Dim last_id As String
last_id = "select last_insert_id()"
End With
The string last_id is not filled. What is wrong? I need to find te last_insert_id so I can use it in an other query.
I am having a sorted list which is rotated and I would like to do a binary search on that list to find the minimum element.
Lets suppose initial list is {1,2,3,4,5,6,7,8}
rotated list can be like {5,6,7,8,1,2,3,4}
Normal binary search doesn't work in this case. Any idea how to do this.
hi!
i wanna parse a json like this
http://maps.google.com/maps/api/geocode/json?address=milano&sensor=false
only to find the latitude and longitude of an address (in this case is milano).
anyone can help me? thanks a lot in advance :)
Hi,
I need to find an inner text of an element inside an XmlDocument and return it's Xpath. for example, searching for "ThisText" inside :
<xml>
<xml2 val="ThisText"></xml2>
</xml>
should return the Xpath of xml2
what's the most efficient way of doing this in c#?
How to find the local version of an installed node.js/npm package?
This prints the version of npm itself:
npm -v <package-name>
This prints a cryptic error:
npm version <package-name>
For some reason, probably because of the weird arguments ordering, or because of the false positives mentioned above, I just can't remember the proper command. So this question is a note for self that might help others.
I have been trying to modify this log4bash implementation but I cannot manage to make it work. Here's a sample:
#!/bin/bash
TRUE=1
FALSE=0
############### Added for testing
log4bash_LOG_ENABLED=$TRUE
log4bash_rootLogger=$TRACE,f,s
log4bash_appender_f=file
log4bash_appender_f_dir=$(pwd)
log4bash_appender_f_file=test.log
log4bash_appender_f_roll_format=%Y%m
log4bash_appender_f_roll=$TRUE
log4bash_appender_f_maxBackupIndex=10
####################################
log4bash_abs(){
if [ "${1:0:1}" == "." ]; then
builtin echo ${rootDir}/${1}
else
builtin echo ${1}
fi
}
log4bash_check_app_dir(){
if [ "$log4bash_LOG_ENABLED" -eq $TRUE ]; then
dir=$(log4bash_abs $1)
if [ ! -d ${dir} ]; then
#log a seperation line
mkdir $dir
fi
fi
}
# Delete old log files
# $1 Log directory
# $2 Log filename
# $3 Log filename suffix
# $4 Max backup index
log4bash_delete_old_files(){
##### Added for testing
builtin echo "Running log4bash_delete_old_files $@" &2
#####
if [ "$log4bash_LOG_ENABLED" -eq $TRUE ] && [ -n "$3" ] && [ "$4" -gt 0 ]; then
local directory=$(log4bash_abs $1)
local filename=$2
local maxBackupIndex=$4
local suffix=$(echo "${3}" | sed -re 's/[^.]/?/g')
local logFileList=$(find "${directory}" -mindepth 1 -maxdepth 1 -name "${filename}${suffix}" -type f | xargs ls -1rt)
local fileCnt=$(builtin echo -e "${logFileList}" | wc -l)
local fileToDeleteCnt=$(($fileCnt-$maxBackupIndex))
local fileToDelete=($(builtin echo -e "${logFileList}" | head -n "${fileToDeleteCnt}" | sed ':a;N;$!ba;s/\n/ /g'))
##### Added for testing
builtin echo "log4bash_delete_old_files About to start deletion ${fileToDelete[@]}" &2
#####
if [ ${fileToDeleteCnt} -gt 0 ]; then
for f in "${fileToDelete[@]}"; do
#### Added for testing
builtin echo "Removing file ${f}" &2
####
builtin eval rm -f ${f}
done
fi
fi
}
#Appender
# $1 Log directory
# $2 Log file
# $3 Log file roll ?
# $4 Appender Name
log4bash_filename(){
builtin echo "Running log4bash_filename $@" &2
local format
local filename
log4bash_check_app_dir "${1}"
if [ ${3} -eq 1 ];then
local formatProp=${4}_roll_format
format=${!formatProp}
if [ -z ${format} ]; then
format=$log4bash_appender_file_format
fi
local suffix=.`date "+${format}"`
filename=${1}/${2}${suffix}
# Old log files deletion
local previousFilenameVar=int_${4}_file_previous
local maxBackupIndexVar=${4}_maxBackupIndex
if [ -n "${!maxBackupIndexVar}" ] && [ "${!previousFilenameVar}" != "${filename}" ]; then
builtin eval export $previousFilenameVar=$filename
log4bash_delete_old_files "${1}" "${2}" "${suffix}" "${!maxBackupIndexVar}"
else
builtin echo "log4bash_filename $previousFilenameVar = ${!previousFilenameVar}"
fi
else
filename=${1}/${2}
fi
builtin echo $filename
}
######################## Added for testing
filename_caller(){
builtin echo "filename_caller Call $1"
output=$(log4bash_abs $(log4bash_filename "${log4bash_appender_f_dir}" "${log4bash_appender_f_file}" "1" "log4bash_appender_f" ))
builtin echo ${output}
}
#### Previous logs generation
for i in {1101..1120}; do
file="${log4bash_appender_f_file}.2012${i:2:3}"
builtin echo "${file} $i"
touch -m -t "2012${i}0000" ${log4bash_appender_f_dir}/$file
done
for i in {1..4}; do
filename_caller $i
done
I expect log4bash_filename function to step into the following if only when the calculated log filename is different from the previous one:
if [ -n "${!maxBackupIndexVar}" ] && [ "${!previousFilenameVar}" != "${filename}" ]; then
For this scenario to apply, I'd need ${!previousFilenameVar} to be correctly set, but it's not the case, so log4bash_filename steps into this if all the time which is really not necessary...
It looks like the issue is due to the following line not working properly:
builtin eval export $previousFilenameVar=$filename
I have a some theories to explain why:
in the original code, functions are declared and exported as readonly which makes them unable to modify global variable. I removed readonly declarations in the above sample, but probleme persists.
Function calls are performed in $() which should make them run into seperated shell instances so variable modified are not exported to the main shell
But I cannot manage to find a workaround to this issue...
Any help is appreciated, thanks in advance!
In my program I have a dataTable and I´d like to know if is there a column which name starts with abc.
For example I have a DataTable and its name is abcdef. I like to find this column using something like this:
DataTable.Columns.Constains(ColumnName.StartWith(abc))
Because I know only part of the column name, I cannot use a Contains method.
Is there any simple way how to do that?
Thanks a lot.
Hi
Im looking at some codes (in C++) and it gets quite confusing when there is operator overloading. Is there a simpler way to find out whether "()" or any other symbol is overloaded?
Hi
I'm looking for a regexp that find all images path in an image tag (src) and transform all images path by cid:filename
<img src="../images/text.jpg" alt="test" />
to
<img src="cid:test" alt="test" />
Thanks for your help
Chris
Hi there,
I have a byte array and wish to find the first occurance (if any) of a specific byte.
Can you guys help me with a nice, elegant and efficient way to do it?
/// Summary
/// Finds the first occurance of a specific byte in a byte array.
/// If not found, returns -1.
public int GetFirstOccurance(byte byteToFind, byte[] byteArray)
{
}