Search Results

Search found 1326 results on 54 pages for 'sci fi'.

Page 14/54 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Bash Shell Script: Nested Select Statements

    - by CCG121
    I have A Script that has a Select statement to go to multiple sub select statements however once there I can not seem to figure out how to get it to go back to the main script. also if possible i would like it to re-list the options #!/bin/bash PS3='Option = ' MAINOPTIONS="Apache Postfix Dovecot All Quit" APACHEOPTIONS="Restart Start Stop Status" POSTFIXOPTIONS="Restart Start Stop Status" DOVECOTOPTIONS="Restart Start Stop Status" select opt in $MAINOPTIONS; do if [ "$opt" = "Quit" ]; then echo Now Exiting exit elif [ "$opt" = "Apache" ]; then select opt in $APACHEOPTIONS; do if [ "$opt" = "Restart" ]; then sudo /etc/init.d/apache2 restart elif [ "$opt" = "Start" ]; then sudo /etc/init.d/apache2 start elif [ "$opt" = "Stop" ]; then sudo /etc/init.d/apache2 stop elif [ "$opt" = "Status" ]; then sudo /etc/init.d/apache2 status fi done elif [ "$opt" = "Postfix" ]; then select opt in $POSTFIXOPTIONS; do if [ "$opt" = "Restart" ]; then sudo /etc/init.d/postfix restart elif [ "$opt" = "Start" ]; then sudo /etc/init.d/postfix start elif [ "$opt" = "Stop" ]; then sudo /etc/init.d/postfix stop elif [ "$opt" = "Status" ]; then sudo /etc/init.d/postfix status fi done elif [ "$opt" = "Dovecot" ]; then select opt in $DOVECOTOPTIONS; do if [ "$opt" = "Restart" ]; then sudo /etc/init.d/dovecot restart elif [ "$opt" = "Start" ]; then sudo /etc/init.d/dovecot start elif [ "$opt" = "Stop" ]; then sudo /etc/init.d/dovecot stop elif [ "$opt" = "Status" ]; then sudo /etc/init.d/dovecot status fi done elif [ "$opt" = "All" ]; then sudo /etc/init.d/apache2 restart sudo /etc/init.d/postfix restart sudo /etc/init.d/dovecot restart fi done

    Read the article

  • Wrong chapter number on page headers except first page

    - by okhalid
    Hi, I am writing up my thesis in Latex and have a template. It works nicely for every thing else except one. Chapter numbers are correctly incremented on the first page of each chapter but for consecutive pages of each chapter, the header saying "Chapter x - This is a chapter title" have 1 always as chapter number. Following is the code sample from the CLS file which i think is relevant to the headers: \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule} \def\today{\ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi \space \number\year} \usepackage{setspace} \onehalfspacing \setlength{\parindent}{0pt} \setlength{\parskip}{2.0ex plus0.5ex minus0.2ex} \usepackage{vmargin} \setmarginsrb { 1.5in} % left margin { 0.6in} % top margin { 1.0in} % right margin { 0.8in} % bottom margin { 20pt} % head height {0.25in} % head sep { 9pt} % foot height { 0.3in} % foot sep \raggedbottom \setlength{\topskip}{1\topskip \@plus 5\p@} \doublehyphendemerits=10000 % No consecutive line hyphens. \brokenpenalty=10000 % No broken words across columns/pages. \widowpenalty=9999 % Almost no widows at bottom of page. \clubpenalty=9999 % Almost no orphans at top of page. \interfootnotelinepenalty=9999 % Almost never break footnotes. \usepackage{fancyhdr} \lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}} \rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage} \chead{}\lfoot{}\rfoot{}\cfoot{} \pagestyle{fancy} %% Chapter Heading --------------- \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}} %%-------------------------------------------------- \renewcommand{\sectionmark}[1]{} \renewcommand{\subsectionmark}[1]{} \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else \hbox{} \thispagestyle{empty} \newpage \if@twocolumn\hbox{}\newpage\fi\fi\fi} Thanks, Omer

    Read the article

  • Script throwing unexpected operator when using mysqldump

    - by Astron
    A portion of a script I use to backup MySQL databases has stopped working correctly after upgrading a Debian box to 6.0 Squeeze. I have tested the backup code via CLI and it works fine. I believe it is in the selection of the databases before the backup occurs, possibly something to do with the $skipdb variable. If there is a better way to perform the function then I'm will to try something new. Any insight would be greatly appreciated. $ sudo ./script.sh [: 138: information_schema: unexpected operator [: 138: -1: unexpected operator [: 138: mysql: unexpected operator [: 138: -1: unexpected operator Using bash -x script here is one of the iterations: + for db in '$DBS' + skipdb=-1 + '[' test '!=' '' ']' + for i in '$IGGY' + '[' mysql == test ']' + : + '[' -1 == -1 ']' ++ /bin/date +%F + FILE=/backups/hostname.2011-03-20.mysql.mysql.tar.gz + '[' no = yes ']' + /usr/bin/mysqldump --single-transaction -u root -h localhost '-ppassword' mysql + /bin/tar -czvf /backups/hostname.2011-03-20.mysql.mysql.tar.gz mysql.sql mysql.sql + rm -f mysql.sql Here is the code. if [ $MYSQL_UP = "yes" ]; then echo "MySQL DUMP" >> /tmp/update.log echo "--------------------------------" >> /tmp/update.log DBS="$($MYSQL -u $MyUSER -h $MyHOST -p"$MyPASS" -Bse 'show databases')" for db in $DBS do skipdb=-1 if [ "$IGGY" != "" ] ; then for i in $IGGY do [ "$db" == "$i" ] && skipdb=1 || : done fi if [ "$skipdb" == "-1" ] ; then FILE="$DEST$HOST.`$DATE +"%F"`.$db.mysql.tar.gz" if [ $ENCRYPT = "yes" ]; then $MYSQLDUMP -u $MyUSER -h $MyHOST -p"$MyPASS" $db > $db.sql && $TAR -czvf - $db.sql | $OPENSSL enc -aes-256-cbc -salt -out $FILE.enc -k $ENC_PASS && rm -f $db.sql else $MYSQLDUMP --single-transaction -u $MyUSER -h $MyHOST -p"$MyPASS" $db > $db.sql && $TAR -czvf $FILE $db.sql && rm -f $db.sql fi fi done fi

    Read the article

  • OpenCL - incremental summation during compute

    - by user1721997
    I'm absolutelly novice in OpenCL programming. For my app. (molecular simulaton) I wrote a kernel for calculate intermolecular potential of lennard-jones liquid. In this kernel I need to compute cumulative value of the potential of all particles with one: __kernel void Molsim(__global const float* inmatrix, __global float* fi, const int c, const float r1, const float r2, const float r3, const float rc, const float epsilon, const float sigma, const float h1, const float h23) { float fi0; float fi1; float d; unsigned int i = get_global_id(0); //number of particles (typically 2000) if(c!=i) { // potential before particle movement d=sqrt(pow((0.5*h1-fabs(0.5*h1-fabs(inmatrix[c*3]-inmatrix[i*3]))),2.0)+pow((0.5*h23-fabs(0.5*h23-fabs(inmatrix[c*3+1]-inmatrix[i*3+1]))),2.0)+pow((0.5*h23-fabs(0.5*h23-fabs(inmatrix[c*3+2]-inmatrix[i*3+2]))),2.0)); if(d<rc) { fi0=4.0*epsilon*(pow(sigma/d,12.0)-pow(sigma/d,6.0)); } else { fi0=0; } // potential after particle movement d=sqrt(pow((0.5*h1-fabs(0.5*h1-fabs(r1-inmatrix[i*3]))),2.0)+pow((0.5*h23-fabs(0.5*h23-fabs(r2-inmatrix[i*3+1]))),2.0)+pow((0.5*h23-fabs(0.5*h23-fabs(r3-inmatrix[i*3+2]))),2.0)); if(d<rc) { fi1=4.0*epsilon*(pow(sigma/d,12.0)-pow(sigma/d,6.0)); } else { fi1=0; } // cumulative difference of potentials fi[0]+=fi1-fi0; } } My problem is in the line: fi[0]+=fi1-fi0;. In the one-element vector fi[0] are wrong results. I read something about sum reduction, but I do not know how to do it during the calculation. Exist any simple solution of my problem?

    Read the article

  • Detecting upload success/failure in a scripted command-line SFTP session?

    - by Will Martin
    I am writing a BASH shell script to upload all the files in a directory to a remote server and then delete them. It'll run every few hours via a CRON job. My complete script is below. The basic problem is that the part that's supposed to figure out whether the file uploaded successfully or not doesn't work. The SFTP command's exit status is always "0" regardless of whether the upload actually succeeded or not. How can I figure out whether a file uploaded correctly or not so that I can know whether to delete it or let it be? #!/bin/bash # First, save the folder path containing the files. FILES=/home/bob/theses/* # Initialize a blank variable to hold messages. MESSAGES="" ERRORS="" # These are for notifications of file totals. COUNT=0 ERRORCOUNT=0 # Loop through the files. for f in $FILES do # Get the base filename BASE=`basename $f` # Build the SFTP command. Note space in folder name. CMD='cd "Destination Folder"\n' CMD="${CMD}put ${f}\nquit\n" # Execute it. echo -e $CMD | sftp -oIdentityFile /home/bob/.ssh/id_rsa [email protected] # On success, make a note, then delete the local copy of the file. if [ $? == "0" ]; then MESSAGES="${MESSAGES}\tNew file: ${BASE}\n" (( COUNT=$COUNT+1 )) # Next line commented out for ease of testing #rm $f fi # On failure, add an error message. if [ $? != "0" ]; then ERRORS="${ERRORS}\tFailed to upload file ${BASE}\n" (( ERRORCOUNT=$ERRORCOUNT+1 )) fi done SUBJECT="New Theses" BODY="There were ${COUNT} files and ${ERRORCOUNT} errors in the latest batch.\n\n" if [ "$MESSAGES" != "" ]; then BODY="${BODY}New files:\n\n${MESSAGES}\n\n" fi if [ "$ERRORS" != "" ]; then BODY="${BODY}Problem files:\n\n${ERRORS}" fi # Send a notification. echo -e $BODY | mail -s $SUBJECT [email protected] Due to some operational considerations that make my head hurt, I cannot use SCP. The remote server is using WinSSHD on windows, and does not have EXEC privileges, so any SCP commands fail with the message "Exec request failed on channel 0". The uploading therefore has to be done via the interactive SFTP command.

    Read the article

  • Simple way to make wired internet wireless without router

    - by Anriëtte Combrink
    Hi there Is there any device which you can plug into an Ethernet port and then have it broadcast the internet connection it receives through Ethernet wirelessly with a set password (maybe a serial number on device itself)? The problem is, I have a Wi-fi capable device, an iPhone and I want to use the wired internet connection in a hotel room, but the iPhone needs a Wi-fi signal. How can I accomplish this with a rather simplistic device. // EDIT: Can this be achieved with an Apple Airport Express?

    Read the article

  • Shell Script if else

    - by user34104
    #!/bin/bash echo "Int. a number" read num1 echo "Int. another numer" read num2 if ["$num1"="$num2"]; then echo "Equals" else echo "Dif" fi if["$num1"<0]; then echo "The number $num1 is negative" else if ["$num2"<0]; then echo "The number $num2 is negative" fi # this code is not working, i've something wrong when i see if the number is < 0. thanks

    Read the article

  • Memcached Debuging/Server Logs Monitor the Memcached Servers?

    - by user1179459
    I have chat engine which is based on the Memcached variables, putting them into arrays and reading them in other end via jquery, which works fine 95% of the times, however when the server load is high memcached (presume its the memcached) the crash and browser gets stucks up. I dont think its jquery issue since this only happens when the server load is very high. I need a way to monitor the memcached servers or somehow write a log file into where the fails/errors comes in... Any idea on how i can do this ? or any idea why memcached servers fails ? I run the memcached as follows $GLOBALS['MemCached'] = FALSE; $GLOBALS['MemCached'] = new Memcache; $GLOBALS['MemCached']->pconnect('localhost', 11211); My memcached config is as follows #! /bin/sh # # chkconfig: - 55 45 # description: The memcached daemon is a network memory cache service. # processname: memcached # config: /etc/sysconfig/memcached # pidfile: /var/run/memcached/memcached.pid # Standard LSB functions #. /lib/lsb/init-functions # Source function library. . /etc/init.d/functions PORT=11211 USER=memcached MAXCONN=1024 CACHESIZE=128 OPTIONS="" if [ -f /etc/sysconfig/memcached ];then . /etc/sysconfig/memcached fi # Check that networking is up. . /etc/sysconfig/network if [ "$NETWORKING" = "no" ] then exit 0 fi RETVAL=0 prog="memcached" pidfile=${PIDFILE-/var/run/memcached/memcached.pid} lockfile=${LOCKFILE-/var/lock/subsys/memcached} start () { echo -n $"Starting $prog: " # Ensure that /var/run/memcached has proper permissions if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then chown $USER /var/run/memcached fi daemon --pidfile ${pidfile} memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch ${lockfile} } stop () { echo -n $"Stopping $prog: " killproc -p ${pidfile} /usr/bin/memcached RETVAL=$? echo if [ $RETVAL -eq 0 ] ; then rm -f ${lockfile} ${pidfile} fi } restart () { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status -p ${pidfile} memcached RETVAL=$? ;; restart|reload|force-reload) restart ;; condrestart|try-restart) [ -f ${lockfile} ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}" RETVAL=2 ;; esac exit $RETVAL

    Read the article

  • Control Less Window gets stuck in Win7

    - by dkjain
    Hi there is a dialer software (by ISP) that connects to my ISP's wi-fi network. Though it connects to the wi-fi network however a control-less windows gets stuck in the middle of the my win7 desktop screen and does not goes off. I cannot close it or minimize it as there are no controls on it. I want to know how to minimize or close the windows without killing the app via Task Manager. Regards, DK Jain.

    Read the article

  • BUILDROOT files during RPM generation

    - by khmarbaise
    Currently i have the following spec file to create a RPM. The spec file is generated by maven plugin to produce a RPM out of it. The question is: will i find files which are mentioned in the spec file after the rpm generation inside the BUILDROOT/SPECS/SOURCES/SRPMS structure? %define _unpackaged_files_terminate_build 0 Name: rpm-1 Version: 1.0 Release: 1 Summary: rpm-1 License: 2009 my org Distribution: My App Vendor: my org URL: www.my.org Group: Application/Collectors Packager: my org Provides: project Requires: /bin/sh Requires: jre >= 1.5 Requires: BASE_PACKAGE PreReq: dependency Obsoletes: project autoprov: yes autoreq: yes BuildRoot: /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/buildroot %description %install if [ -e $RPM_BUILD_ROOT ]; then mv /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/tmp-buildroot/* $RPM_BUILD_ROOT else mv /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/tmp-buildroot $RPM_BUILD_ROOT fi ln -s /usr/myusr/app $RPM_BUILD_ROOT/usr/myusr/app2 ln -s /tmp/myapp/somefile $RPM_BUILD_ROOT/tmp/myapp/somefile2 ln -s name.sh $RPM_BUILD_ROOT/usr/myusr/app/bin/oldname.sh %files %defattr(-,myuser,mygroup,-) %dir "/usr/myusr/app" "/usr/myusr/app2" "/tmp/myapp/somefile" "/tmp/myapp/somefile2" "/usr/myusr/app/lib" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/start.sh" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/filter-version.txt" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/name.sh" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/name-Linux.sh" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/filter.txt" %attr(755,myuser,mygroup) "/usr/myusr/app/bin/oldname.sh" %dir "/usr/myusr/app/conf" %config "/usr/myusr/app/conf/log4j.xml" "/usr/myusr/app/conf/log4j.xml.deliver" %prep echo "hello from prepare" %pre -p /bin/sh #!/bin/sh if [ -s "/etc/init.d/myapp" ] then /etc/init.d/myapp stop rm /etc/init.d/myapp fi %post #!/bin/sh #create soft link script to services directory ln -s /usr/myusr/app/bin/start.sh /etc/init.d/myapp chmod 555 /etc/init.d/myapp %preun #!/bin/sh #the argument being passed in indicates how many versions will exist #during an upgrade, this value will be 1, in which case we do not want to stop #the service since the new version will be running once this script is called #during an uninstall, the value will be 0, in which case we do want to stop #the service and remove the /etc/init.d script. if [ "$1" = "0" ] then if [ -s "/etc/init.d/myapp" ] then /etc/init.d/myapp stop rm /etc/init.d/myapp fi fi; %triggerin -- dependency, dependency1 echo "hello from install" %changelog * Tue May 23 2000 Vincent Danen <[email protected]> 0.27.2-2mdk -update BuildPreReq to include rep-gtk and rep-gtkgnome * Thu May 11 2000 Vincent Danen <[email protected]> 0.27.2-1mdk -0.27.2 * Thu May 11 2000 Vincent Danen <[email protected]> 0.27.1-2mdk -added BuildPreReq -change name from Sawmill to Sawfish The problem i found is that the files (filter.txt in particular) after the generation process on a Ubuntu system but not on SuSE system. Which might be caused by different rpm versions ? Currently we have an integration test which fails based on the non existing of the file (filter.txt under a buildroot folder?)

    Read the article

  • List total memusage by 32bit programs and 64bit programs

    - by egon
    How to get the total amount of memory used by 32bit applications and 64bit applications from the command line in Windows. I tried using tasklist /FI "MODULES eq wow64.dll" /FO CSV and then parsing the output and summing. But tasklist just freezes with any command that has something to do with modules (tasklist /m and tasklist /fi "modules eq wow64.dll" freeze). Are there any alternatives? Or some idea why tasklist freezes.

    Read the article

  • How to prevent wifi router from broadcasting multiple ssids?

    - by user1092288
    I have the following Wi-Fi router: http://www.beetel.in/business-solutions/international-business/adsl/450-four-port-wifi-modem And I am also posting screen shots of ISP settings (from 192.168.1.1). Problem is, my Wi-Fi router is broadcasting multiple SSIDs (even the SSIDs which I used in the past and aren't entered in settings at present). How do I resolve this to broadcast single SSID? I have already tried factory settings restore. SSID1 Settings SSID2 Settings SSID2 Settings- greyed-out, unable to change anything

    Read the article

  • C# Using Reflection to copy base class properties

    - by David Liddle
    I would like to update all properties from MyObject to another using Reflection. The problem I am coming into is that the particular object is inherited from a base class and those base class property values are not updated. The below code copies over top level property values. public void Update(MyObject o) { MyObject copyObject = ... FieldInfo[] myObjectFields = o.GetType().GetFields( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); foreach (FieldInfo fi in myObjectFields) { fi.SetValue(copyObject, fi.GetValue(o)); } } I was looking to see if there were any more BindingFlags attributes I could use to help but to no avail.

    Read the article

  • Core Location in iPhone Simulator 3.2 (iPad)

    - by choise
    So, i'm trying to port my app to iPad. I'm using CoreLocation. Apple says the iPad does have Location: Wi-Fi Digital compass Assisted GPS (Wi-Fi + 3G model) Cellular (Wi-Fi + 3G model) so it should be possible to get the position of my ipad (at least with 3g model) about 3km radius would be enought. but it doesnt work in simulator (3.2 ipad) (running 3.1.3 in simulator simulates me cupertino). is there a way to get the position in simulator (3.2 ipad) ? i live in germany and here the ipad isnt released yet, so i cannot test it on my device. thanks!

    Read the article

  • Checking existence of file types via extensions bash.

    - by Tommy
    Hi, I need to test if various file types exist in a directory. I've tried $ [ -f *.$fileext] where fileext is the file extension but that does not seem to work. Both of these methods work function checkext() { fileext=$1 ls *.$fileext>/dev/null 2>&1 if [ $? -eq 0 ] then echo "We have $fileext files!" else echo "We don't have any $fileext files!" fi } and function checkext2() { extention=$1 filescheck=(`ls *.$1`) len=${#filescheck[*]} if [ $len -gt 0 ] then echo "We have $extention files!" else if [ $len -eq 0 ] then echo "We don't have any $extention files!" else echo "Error" fi fi } The second method is less tidy as any ls error is shown so I prefer method 1. Could people please suggest any improvements, more elegant solutions e.t.c

    Read the article

  • Blank space after file extension -> weird FileInfo behaviour

    - by Axarydax
    Somehow a file has appeared in one of my directories, and it has space at the end of its extension - its name is "test.txt ". The weird thing is that Directory.GetFiles() returns me the path of this file, but I'm unable to retrieve file information with FileInfo class. The error manifests here: DirectoryInfo di = new DirectoryInfo("c:\\somedir"); FileInfo fi = di.GetFileSystemInfos("test*")[0] as FileInfo; //correctly fi.FullName is "c:\somedir\test.txt " //but fi.Exists==false (!) Is FileInfo class broken? Can I somehow retrieve information about this file? I really don't know how did that file appear on my file system, and I am unable to recreate some more of them. All of my attempts to create a new file with this type of extension have failed, but now my program is crashing when encoutering it. I can easily handle the exception when finding the file, but boy am I curious about this!

    Read the article

  • Deleting an Image that has been used by a WPF control

    - by Peter
    Hi, I would like to bind an Image to some kind of control an delete it later on. path = @"c:\somePath\somePic.jpg" FileInfo fi = new FileInfo(path); Uri uri = new Uri(fi.FullName, UriKind.Absolute); var img = new System.Windows.Controls.Image(); img.Source = new BitmapImage(uri); Now after this code I would like to delete the file : fi.Delete(); But I cannot do that since the image is being used now. Between code fragment 1 en 2 what can I do to release it? Thanks

    Read the article

  • GameKit peer to peer wifi without wireless router?

    - by Tim
    Hi all! Thanks in advance for any thoughts about this. I'm looking for a way to do realtime inter-app communication in iOS via wi-fi (I need about 150 ft range and don't think bluetooth offers this) and wonder about the peer-to-peer connectivity offered by GameKit which, apparently offers both bluetooth and wi-fi connectivity. My question is: must participating devices be members of an available wireless network (via a wireless router) or is this connectivity truly peer-to-peer requiring no router? I understand Wi-fi Direct is coming and would likely be an option. Just wondering if I can do this utilizing services available in iOS today. Thanks! Tim

    Read the article

  • Silverlight: Use reflection to get the BindingExpression (and value) for controls having a ContentPr

    - by sfx
    Hello, I need to use reflection to get the binding value in a control that is a DataGridTemplateColumn (e.g HyperLinkButton). Does anyone know how I might do this? It seems simple enough to do this with a TextBlock because it has a “TextProperty” dependency property, but I can’t seem to get a binding expression from a control that does not have an immediate “TextProperty”. Here is the code I’m using to acquire the binding expression for a TextBlock: FrameworkElement fe = (FrameworkElement)dependencyObj; FieldInfo fi = fe.GetType().GetField("TextProperty"); BindingExpression bindingExpression = fe.GetBindingExpression((DependencyProperty)fi.GetValue(null)) However, the following code never works for a dependency object that is a HyperLinkButton: FieldInfo fi = fe.GetType().GetField("ContentProperty"); Does anyone know how I might be able to get the BindingExpression (and binding value) for the content of a HyperLinkButton? Cheers, sfx

    Read the article

  • Reading from a file into an array in c

    - by NaNa21
    My file contains a series of numbers (integer, float, integer, float ....), each written on a separate line. The numbers of columns are different from one line to another i.e. 1 2.45 3 1.75 5 3.45 7 2.55 9 3.25 6 1.75 4 3.55 6 2.55 9 2.45 The program should read the contents of the entire file and place the data into an array of type float with an entry for each line. Here is my basic solution, but this is only suitable if I have fixed no of columns. float Read(FILE *pFile) { char line[50]; char letter[5]; fi = fopen("file.txt", "r"); while (fgets(line,200,fi)!=NULL) { sscanf(line,"%f %f %f",&a[i], &a2[i],&a3[i]); printf("%2.0f %2.5f %2.0f\n",a[i],a2[i],a3[i]); } fclose(fi); return a[i]; } Please HELP.

    Read the article

  • How to Display result of subquery rows as one column in MySQL?

    - by SIA
    Hi I have three tables Category, Movies and RelCatMov Category-table categoryid, categoryName 1 thriller 2 supsense 3 romantic 4 action 5 sci-fi Movies-table movieid, movieName 1 Avataar 2 Titanic 3 NinjaAssassin RelCatMov-table categoryid, MovieID 1 1 2 2 3 2 4 2 5 2 Now i Want to display a the record as MovieName Categories Titanic Suspense,Romantic,Sci-fi,action How to do this. I am writing a query select MovieName,(select categoryname from category b,relcatmov c where b.categoryid=c.categoryid and c.movieid=a.movieid) as categories from movies a; Error: Subquery returns more than one row!!! How to display the result of rows in one column? Please help!!!

    Read the article

  • How can I generate sql inserts from pipe delimited data?

    - by user568866
    Given a set of delimited data in the following format: 1|Star Wars: Episode IV - A New Hope|1977|Action,Sci-Fi|George Lucas 2|Titanic|1997|Drama,History,Romance|James Cameron How can I generate sql insert statements in this format? insert into table values(1,"Star Wars: Episode IV - A New Hope",1977","Action,Sci-Fi","George Lucas",0); insert into table values(2,"Titanic",1997,"Drama,History,Romance","James Cameron",0); To simplify the problem, let's allow for a parameter to tell which columns are text or numeric. (e.g. 0,1,0,1,1)

    Read the article

  • My laptop can not access internet after setup bridge with wired NIC and wireless NIC

    - by Victor S
    I setup a bridge using wired NIC and wireless NIC in order to make wireless NIC as a Wi-Fi AP to share wired internet access, after setup successfully, the Wi-Fi AP works as my expectation, but my laptop can not access internet, please give me a hand. Thanks. My hostapd.conf $ cat hostapd.conf interface=wlan0 bridge=br0 driver=nl80211 ssid=myAP hw_mode=g channel=11 dtim_period=1 rts_threshold=2347 fragm_threshold=2346 macaddr_acl=0 auth_algs=3 ieee80211n=0 wpa=3 wpa_passphrase=PassWord wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP Setup steps: $ sudo killall hostapd hostapd: no process found $ sudo hostapd -B hostapd.conf Configuration file: hostapd.conf Using interface wlan0 with hwaddr 00:26:5e:e8:4f:8e and ssid 'myAP' $ sudo brctl addbr br0 device br0 already exists; can't create bridge with the same name $ sudo ifconfig eth0 0.0.0.0 up $ sudo ifconfig wlan0 0.0.0.0 up $ sudo brctl addif br0 eth0 $ sudo brctl addif br0 wlan0 device wlan0 is already a member of a bridge; can't enslave it to bridge br0. $ sudo ifconfig br0 192.168.1.110 netmask 255.255.255.0 $ sudo route add default gw 192.168.1.1

    Read the article

  • How to Connect Your Android to Your PC’s Internet Connection Over USB

    - by Chris Hoffman
    People often “tether” their computers to their smartphones, sending their computer’s network traffic over the device’s cellular data connection. “Reverse tethering” is the opposite – tethering your Android smartphone or tablet to your PC to use your PC’s Internet connection. This method requires a rooted Android and a Windows PC, but it’s very easy to use. If your computer has Wi-Fi, it may be easier to create a Wi-Fi hotspot using a utility like Connectify instead. How to Make Your Laptop Choose a Wired Connection Instead of Wireless HTG Explains: What Is Two-Factor Authentication and Should I Be Using It? HTG Explains: What Is Windows RT and What Does It Mean To Me?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >