Posts

Showing posts from May, 2011

How to add an IBM DB2 server to SQL Server's Linked Server -

from .net, i'm able connect db2 database: first include reference "ibm.data.db2.iseries" then create new ibm.data.db2.iseries.idb2connection. connection string is datasource=chadb2server;userid=myusername;password=mypassword; then create ibm.data.db2.iseries.idb2command, , on. now i'm trying sql server 2005 access same data directly. in sql server management studio, right-click on linked servers, , select "new linked server..." linked server: chadb2server provider: ibm ole db provider db2 product name: ??? data source: chadb2server provider string: datasource=chadb2server;userid=myusername;password=mypassword; location: ??? i can leave location blank, product name can't empty , don't know fill in here. on security tab, select "be made using security context" , repeat userid , password. the linked server gets created, when try expand catalogs / default / tables, error message: ole db provider &#

perl - Downloading or requesting a page using a proxy list? -

i wondering if possible request internet page server via proxy taken proxy list. i don't know exact terms, i'll explain want: there feature in website counts ips or alike (perhaps cookies), such visitors counter. i'd "fool" "entering" page using many proxies. use tor, that's work - want visit page, let counter or whatever in page know visited, , that's all. i don't know tags add, had little experiments perl think direction, although couldn't find solution problem. thank in advance. you want this: #/usr/bin/perl use strict; use warnings; use lwp::useragent; $url = shift || 'http://www.google.com'; $a = lwp::useragent->new; $a->agent('mozilla/5.0'); $a->timeout(20); while (<data>) { $a->proxy( ['http'], $_ ); warn "failed page proxy $_\n" unless $a->get( $url )->is_success; } __data__ http://85.214.142.3:8080 http://109.230.245.167:80 http://211.222.20

Bizarre HTML problem. Inspector view different from source -

Image
i'm having strange problem inspector showing head content in body while source normal. causing this? this looks you've missed closing <head> -tag. maybe it's <head>…<head> in html.

c# - Problem with ADO.NET UPDATE code -

could take quick peek @ ado.net code? trying update row dataset, isn't working. missing elemental piece of code, , eluding me. have verified datarow has correct data in it, row accurate. many in advance. try { //basic ado.net objects sqldataadapter dbadapter = null; dataset returnds2 = new dataset(); //a new sql connection sqlconnection myconn = new sqlconnection(); myconn.connectionstring = "server=myserver.mydomain.com;" + "database=mydatabase;" + "user id=myuserid;" + "password=mypassword;" + "trusted_connection=true;"; //the sqlquery string sqlquery = "select * avlupdatemessages id = 21"; //another ado.net object command sqlcommand cmd = new sqlcommand(

passing string in a query to MySQL database in MATLAB -

i using mysql matlab, , want name user, , pass table in mysql, rejecting variable name in place of string var_name=input('enter name:'); mysql('insert table (name) values (var_name)'); any suggestions? i believe problem having same 1 in this other question . sounds want create command string contains ' delimited string, require escape each ' ' when create command string (note first example in this string handling documentation ). note may want use 's' option input function: var_name = input('enter name: ','s'); %# treats input string commandstring = sprintf('insert table (name) values (''%s'')', var_name); %# note 2 apostrophes --^ mysql(commandstring); if enter ken input, string commandstring contain following: insert table (name) values ('ken') and of course, others have mentioned, beware injection vulnerabilities .

wix - How do you add data containing a tab in a custom table -

when there tabs in custom table data compilation error occurs, if compiler thinks tab attempting create column. i have tried actual tab, xml escaped tab (&#x9;), , msi escaping tab ([{tab}], {tab} actual tab) example: <data column="">testing 1,2,3</data> in between 'testing' , '1,2,3' tab. the error is: custom table column '1,2,3' unknown. you can't -- data imported .msi package via tab-delimited file. see "archive file format" in msi sdk. if field can binary, can import file's content, can anything.

android - Text does not ellipsize -

i have textview set ellipsize when put text in doesn't so. ideas? <textview android:id="@+id/legalsview" android:ellipsize="end" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" /> try: android:singleline="true"

HTML5 History API with Standard links -

so, after redesigning site, thought use html5 history api, when saw brilliant use of here: http://diveintohtml5.ep.io/examples/history/casey.html problem is, code provided doesn't work me, (using chrome 8). not entirely sure why, refreshes page href value of link after partial content loaded. are there other examples of use of api? dont want history.js or uses hash/hashbangs fallback. i'm trying rid of these. any ideas? edit: firebug throws 'link has no value' @ me countless requests partially loaded content. after these page refreshes you have intercept link click , call own pushstate - if check out code on page see event handler: function addclicker(link) { link.addeventlistener("click", function(e) { if (swapphoto(link.href)) { history.pushstate(null, null, link.href); e.preventdefault(); } }, true); }

opengl es - iphone - Sharpen UIImage -

i want sharpen images in app. i found post how sharp/blur uiimage in iphone? and had @ apple's sample glimageprocessing but opengl es thing killed brain cells lot , still don't it. so, can pls give me piece of helper code sharpen uiimage? thanks this library might need - has image sharpen method. came across myself, haven't tried yet. let me know if works ;) https://github.com/esilverberg/ios-image-filters

rubygems - How do you update JRuby's gem command? -

how update version of gem jruby uses? jruby uses gem (1.5.1) , upgrade 1.8.7. want have gems installed in ruby/gems we run: bin/jruby gem install rubygems-update fetching: rubygems-update-1.8.5.gem (100%) installed rubygems-update-1.8.5 1 gem installed bin/jruby gem install --system error: while executing gem ... (optionparser::invalidoption) invalid option: --system (update not work either) bin/jruby gem update --system updating rubygems updating rubygems 1.8.5 installing rubygems 1.8.5 error: while executing gem ... (errno::ebadf) bad file descriptor - bad file descriptor how can install/update of gem (1.8.5) done? configuration: using maven install jruby. jruby installed at: ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar jruby-complete-1.6.3.jar not exploded. jruby-complete-1.6.3.jar has built "gem" (1.5.1) command it. command bin/jruby looks this: (bin/jruby) export jruby_build=1.6.3 export gem_home= ~/tools/rub

bpm - design pattern for business process modeling? -

assuming we're not interested in building no top of existing bpms, sort of design pattern, or books, or specific technology, valuable who'd build backoffice system takes care of business processes consist of wait states (waiting decision staff or result api calls) automated , manual process process definition audit logging ? i don't believe implementing business process management software want mess with! seems tedious me. don't believe want invest in (unless want create own bpm platform , sell other customers). why won't use existing solution? bpm platforms extensible , can built whatever want on top of them - , still able use core characteristics. there open source solutions (jbpm). of course shouldn't choose bpm solution based on price since when have bpm platform save money later on process implementation. find has of characteristics need out of box ! in case, answer question, don't think need special knowledge built bpm solutio

How to update Bundle in Apache Felix OSGi Framework -

i'm having troubles updating bundle gogo shell . have gogo shell running on terminal. bundles active in there. now when make changes code, steps necessary forward these changes running osgi framework? i ran update <bundleid> nothing happens. still runs same version compiled when started framework. before update command opened terminal , ran mvn clean install (i'm using maven-bundle-plugin along pax-construct ). when working maven, workflow checking updated code involves 2 terminals. after updating code, run mvn install project build actual bundle. keep track of absolute location on system target bundle built. in running framework, update bundle, giving url; update 25 file:///users/you/project/bundle/target/bundle.jar if you're free not use maven , pax runner, can take @ bndtools , eclipse plugin. can still take bundles bndtools builds you, , run them pax runner.

git tag - Require annotated tags and reject lightweight tags on git push -

is possible set policy on git repo disallows lightweight tags being pushed it? the git hook page mentions: the default update hook, when enabled — , hooks.allowunannotated config option unset or set false — prevents unannotated tags pushed. that references in turn update.sample chris johnsen mentions in comments. case "$refname","$newrev_type" in refs/tags/*,commit) # un-annotated tag short_refname=${refname##refs/tags/} if [ "$allowunannotated" != "true" ]; echo "*** un-annotated tag, $short_refname, not allowed in repository" >&2 echo "*** use 'git tag [ -a | -s ]' tags want propagate." >&2 exit 1 fi ;;

xml - PHP SimpleXML, get line of child during foreach loop -

i have script goes through simplexml object loaded file saved on server. now, if something's wrong while process xml file, want script report error, , preferably line of child error occurred. an example of xml: <xml> <product> <name>product one</name> <price>3.50</price> </product> <product> <name>product two</name> <price>42.00</price> </product> </xml> my script processes xml file this: <?php $log = 'error log'.php_eol; $xml = simplexml_load_file('file.xml'); foreach($xml->'product' $key->$val) { if(everything_is($okay)) { //process product } else { $log .= 'there error product on line '.$childline.php_eol; } } file_put_contents('log.txt',$log); ?> now, thing need know here is, there way find line current child in foreach loop on in xml file?.. i know libxml_get_errors() reports line of xml

Huffman encoding: how to write binary data in Python -

i have tried methods using struct module, shown lines commented out in code, didn't work out. have 2 options: can either write binary data code code (my code sequences of bits of length varying 3 13 bits), or convert whole string of n characters (n=25000+ in case) binary data. don't know how implement either methods. code: import heapq import binascii import struct def createfrequencytuplelist(inputfile): frequencydic = {} intputfile = open(inputfile, 'r') line in intputfile: char in line: if char in frequencydic.keys(): frequencydic[char] += 1 else: frequencydic[char] = 1 intputfile.close() tuplelist = [] mykey in frequencydic: tuplelist.append((frequencydic[mykey],mykey)) return tuplelist def createhuffmantree(frequencylist): heapq.heapify(frequencylist) n = len(frequencylist) in range(1,n): left = heapq.heappop(frequencylist) right

python - copy files and folders to another path using batch -

i have directory c:/go , inside go there tons of folders, subfolders , files. i need find inside go, files start net*.inf , oem*.inf , , copy folder, subfolders , files palce @ c:/ it must automatic using windows... batch script, c++, python...vbs pleasee!! in advance from command line, 1 way combine xcopy for loop : for /d %i in (net oem) xcopy /s c:\go\%i*.inf c:\go2\ in batch file replace %i %%i .

Can I set the Linux coredump file format for current current process only? -

some file introduce use sysctl, changed format globally , need admin permission do, there api or way change dump format current process in code? no. core format not specified in process table, , hence not possible change per-process. use pipe core handler filter cores , handle them desired. see core(5) man page details.

c# - WPF startup application execute after internet connection connected? -

i'm developing windows application using wpf.the program running in startup , should wait untill internet connection connected, executed. internet connection time connect. therefore im running thread ping(like this) server in space of 3 seconds watch connection status. public bool checkconnection() { try { //////////////check connction system.net.sockets.tcpclient clnt = new system.net.sockets.tcpclient(userconfig.configlist[2], convert.toint32(userconfig.configlist[3])); clnt.close(); return true; } catch (exception) { return false; } } if status true program executed. there efficient way of doing this. ideas please?????? there useful networkmanager class on over cp allow check network connection status using netconnectionstatus enum... you start timer check network connection every couple of seconds if (networkmanager.netconnectionstatu

jboss - Java Batch job in cluster environment [resolved] -

we have cluster 2 jboss nodes. have batch job loads users details active directory db. job run everyday. run before in non clustered environment , hence designed singleton. have clustered environment , not know best way achieve same result. want batch job run once day. use spring , hibernate , looked @ spring batch. not concise answer question. can please let me know if had implemented batch in cluster environment? best solution in scenario. thanks in advance help we implemented triggering , starting jobs externally via mq ( http request start job work well). scheduler puts message on queue , though have 'n' nodes listening queue, 1 node receive message , based on it's contents, start job. can http well. the real 'solution' schedule batch job 'externally' , not via internal cron trigger. actual start mechanism secondary that.

Incrementing a value using javascript and php and saving it in POST array -

i incrementing value of hidden element using javascript , , posting in $_post array. increases once , , remains same. please help. my file incrementing.php below code: <script language="javascript"> function nextclicked() { document.getelementbyid("labelclicked").value = document.getelementbyid("labelclicked").value + 1 ; document.forms["incrementing"].submit(); } </script> <?php if(isset($_post['labelclicked']) && $_post['labelclicked']>=1) { $_post['labelclicked'] = $_post['labelclicked'] +9; } ?> <?php if(isset($_post['clickednext'])) { echo 'value ='.$_post['labelclicked']; } else { echo "not clicked yet"; } ?> <form name = "incrementing" method="post" action="incrementing.php"> <div class=d2 align=left><a href="#" onc

c++ - Main in MFC console app (NOT WinMain, main) -

Image
for sample program, though doing me. wondering how happening. i created console application "mfc" checkbox enabled while creating project (vc2008). created standard _tmain implementaion afxwininit calls , all. wrote custom function main , called _tmain itself. now press f10 or f11 start debugging, goes main , not _tmain (yes, via _tmain itself) - how , why - that's question. no didn't set project setting @ all. 32-bit debug build. edit: interesting thing this: #include "stdafx.h" void main() { printf("this custom main"); } int _tmain(int argc, _tchar* argv[]) { if(false) // getting fooled, or fooling us? main(); return 0; } visual studio considers main entry point, , doesn't when start debugging f10/f11 - since false false , doesn't allow main called! my test shows goes _tmain first, before custom main .

jquery - My inputs don't show as expected -

i have code should: generate ten <input> s - done hide except first 3 - done show next input when changed in last visible one. part doesn't work! how can fix it? for (var = 0; < 10; ++i) { if (i == 0) { $('#tags').append('<input name="group_interests[]" class="group_interests" type="text" />'); } else { $('#tags').append('<input name="group_interests[]" class="group_interests default_text" type="text" value="start typing see list" />'); } } $('#tags .group_interests:gt(2)').hide(); $('#tags .group_interests:visible').last().focus( function() { $(this).next().show(); }); your focus bound same input. try instead: for (var = 0; < 10; ++i) { if (i == 0) { $('#tags').append('<input name="group_interests[]" class="group_interests" type

c++ - Qt - Visual Studio - Work with projects on multiple computers -

i work same visual studio projects on multiple computers (work/home) using dropbox sync between two. because vs creates large files, used remove following before uploading dropbox: files = .pdb, sdf, .ilk .exe .tmp folders = ipch/, release/, debug/, generatedfiles/ everything worked fine in past, however, problems have risen. receive following errors: moc'ing codeinterface.h... 1> system cannot find path specified. 1> moc'ing threadworker.h... 1> system cannot find path specified. 1> rcc'ing streamanalyser.qrc... 1> system cannot find path specified. 1>c:\program files\msbuild\microsoft.cpp\v4.0\microsoft.cppcommon.targets(151,5): error msb6006: "cmd.exe" exited code 3. so, think may have create new visual studio project , import classes manually. question are: best practices working projects on different computers? what files can deleted (for uploading dropbox)? does visual studio have sort of 'global settings'

iphone - Image on UIbutton visible on simulator but lost on device -

i have made application includes movie player in it. video starts playing on touching play button. have set image "play.png" on button , while running on simulator image shows on device image not show up.. checked application on ios 4.3 simulator , installed on device ios 3.2. because of older version ? thanks.. i don't think os version matters. check case of image name , 1 using. once happened me because of wrong case of image name. image name "portraitbackground.png" , writing "portraitbackground.png". remember simulator running on mac os not ios. anyway, check case , write image name is. think .png , .png treated different haven't experienced it.

php - Validating form with jquery(ajax), problem with captchas -

well bit stuck on using jquery, ajax , zend framework combined. found tutorial http://www.zendcasts.com/ajaxify-your-zend_form-validation-with-jquery/2010/04/ , made tests , got working, problem captcha value changes every post request(also csrf token), how check validation on data forms not on captcha fields ? currently have thought use method isvalidpartial() , redesign form. i've looked tutorial. file index.phtml, validating section of code function dovalidation(id) { var url = '/index/validateform' var data = {}; $("input").each(function() { data[$(this).attr('name')] = $(this).val(); }); $.post(url,data,function(resp) { $("#"+id).parent().find('.errors').remove(); $("#"+id).parent().append(geterrorhtml(resp[id], id)); },'json'); } you see, line $("input").each(function() { ... }) is walking on form inputs grab data them (and sen

java - command "mvn package" fails with status 137 -

packaging gwt project using "mvn package" fails , have following ouput: [info] scanning projects... [info] ------------------------------------------------------------------------ [info] building myproject [info] task-segment: [package] [info] ------------------------------------------------------------------------ [info] [apt:process {execution: default}] [info] [aspectj:compile {execution: default}] [info] [resources:resources {execution: default-resources}] [info] using 'utf-8' encoding copy filtered resources. [info] copying 5 resources [info] [compiler:compile {execution: default-compile}] [info] nothing compile - classes date [info] [aspectj:test-compile {execution: default}] [info] [resources:testresources {execution: default-testresources}] [info] using 'utf-8' encoding copy filtered resources. [info] copying 4 resources [info] [compiler:testcompile {execution: default-testcompile}] [info] not compiling test sources [info] [surefire:test {exec

mysql - Using :include and :conditions creates big queries? -

i want fetch posts commented specifc user eager loading of creator,editor,comments , forum. post.rb named_scope :list_of_post {|user_id| { :include => [:creator,:editor,:comments,:forum], :conditions => ["comments.user_id = ?",user_id] } } but named scope creates big query instead of small in queries creator,editor,comments , forum. this happening because of using :include , :conditions together. any solutions returns in queries each instead of 1 big query. i assume you're using rails 2 instead of scope : post.find(:conditions => {:id => user.comments.map(:post_id)}, :include => [...]) when migrate rails 3, @ squeel , ransack. requests easier.

c# - Target both x86 and x64 in the Windows Installer (VS2008) -

is there way create windows installer using visual studio 2008 target both x86 , x64 operating systems. in targetplatform property, have : x86 , x64 , itanium . , know there 1 somewhere called any cpu can't find it. also, don't want create 2 setup. any ideas ? thanks. it can done, not directly visual studio. general approach this: create generic msi contains both 32-bit , 64-bit resources create mst transforms (one 32-bit , 1 64-bit) modify msi based on target platform use exe bootstrapper dynamically detect platform , apply correct transform msi you can create transforms orca . if want commercial solution, can try advanced installer or installshield. if seems complicated, can use separate 32-bit , 64-bit packages.

c++ - Save a Bitset into a Struct Field -

i decedied not use macros bitwise operations rather use bitset. intending is, receive struct evaluate bits appened them struct. i receive struct, say: typedef struct{ uint8 status; //!< status } msgstatus; i need status , check each received bit, create bitset of recevied struct: m_msgbits = new msgstatus(); bitset<8> msgbits(m_msgbits->status); // evaluate bits now, after evaluation need appened received bits struct, say: typedef struct{ uint32 status; //!< status } msgoverallstatus; so, is: m_overallstatus = new msgoverallstatus(); bitset<16> overallbits(m_overallstatus->status); m_overallstatus.reset(); // 00000000 00000000 //then append bits in msgbits in overallbits, example: overallbits.set(0, msgbits[0]); overallbits.set(1, msgbits[1]); overallbits.set(2, msgbits[2]); //==== here dunno how ==== m_overallstatus->status = overallbits; i want assign bits struct field, error: cannot convert ‘std::bitset<16u>’ ‘uint16’ in assi

csv - C# : Split String and put it in the first column of a DataGridView -

i need take first line of file , put words of string first column of datagridview. i have written code csv file converted array list: arraylist filelist = new arraylist(); private void button2_click(object sender, eventargs e) { string line; // read file , display line line. //read path textbox system.io.streamreader file = new system.io.streamreader(textbox1.text); stringfordata=file.readline(); //this line because didn't need //the first //line of file while ((line = file.readline()) != null) { // puts elements array filelist.add(line.split(';')); } file.close(); } my file : name;surname;telephone;address; george;parado;3434;lili_2; jennifer;macin;3333;powel_34; nick;lukas;3322;manchester_44; i want datagridview : **subject type** name surname telephone address so need take first line of file , put first column of datagridview. as far have made method. a

php - Display Star Rating without voting -

i little stuck. i have mysql database items. each item has corresponding rating (0-5). now, when display list of items, want convert rating in stars. may not clickable. but how can display rating stars each rating? like: item[1] rating: 4 => display 4 stars item[2] rating: 2 => display 2 stars item[3] rating: 1 => display 1 star , on i calling existing rating this: php echo $item['item']['rating'] str_repeat() : print str_repeat('*', $item['item']['rating']);

testing - How to produce file i/o buffer on linux and other test? -

i want test app file i/o buffer overflow , other i/o error. how can produce such type of cases using programming ? you can use fuzz testing tool zzuf corrupt input program. simulate io errors. more broadly, after fault injection tool (of fuzzer 1 type).

c# - How would I serialize XML with nested Elements into an object -

i have xml has nested tags following: <?xml version="1.0" encoding="utf-8" ?> <questions> <question title="which of these circle?" type="graphics"> <text>which of these circle?</text> <image src="shapes.png" /> <answer correct="true"> <image src="circle.png"/> </answer> <answer> <image src="square.png"/> </answer> </question> <question title="click on circle" type="point"> <image src="imageofshapeswiththeanswerat200x150withasizeof20x20.png"/> <answer x="200" y="150" width="20" height="20" correct="true">circle</answer> <answer x="100" y="150" width="20" height="20">notcircle</answer> </question> <question

mysql - Using JPA1.0: How to write queries -

good day, i have weird problem: this following statement works query q = em.createquery("select m accountclass m"); whereas following statement not query q = em.createquery("select m accountclass"); i'm trying write statement allows me use clause; thank reading this. em.createquery expects jpql query , not sql query passed parameter. select m accountclass not valid jpql query, select m accountclass m valid. if wish learn further jpql, can start java ee tutorial chapter on jpql . the reason why select m accountclass m works in case, because as optional keyword. if wish issue clause, trivial - select m accountclass m m.x= :param1 , x attribute of accountclass class , param1 named parameter value has set using query.setparameter method.

In C, is it valid to declare a variable multiple times? -

i have below c code , expecting throw error "multiple declaration of variable", not doing so. #include <stdio.h> int i; int i; int main() { printf("%d",i); return 0; } now output 0 , why? and 1 more thing below code gives error expected #include <stdio.h> int main() { int i; int i; printf("%d",i); return 0; } o/p error saying re declaration of i the first definition of i tentative definition (the 2nd tentative definition). "de facto" definitions though (and definitions serve declarations), no mistake it. quote the standard : 6.9.2/2 a declaration of identifier object has file scope without initializer, , without storage-class specifier or storage-class specifier static, constitutes tentative definition. if translation unit contains 1 or more tentative definitions identifier, , translation unit contains no external definition identifier, b

How can I get the value of "%d" variables in dynamic_debug info of Linux kernel? -

i enabled config_dynamic_debug=y in linux kernel customized myself, , following dynamic_debug documentation shipped kernel source code, run following command enable output of debug information in bluetooth subsystem: echo -n 'file net/bluetooth/bnep/core.c line 722 +p' > /sys/kernel/debug/dynamic_debug/control which means debug info in line 772 of file net/bluetooth/bnep/core.c logged. after bnep.ko module loaded, checked output of /sys/kernel/debug/dynamic_debug/control , debug information there. but of them like: > net/bluetooth/bnep/core.c:422 [bnep]bnep_tx_frame - "skb %p dev %p type %d\012" i want know value represented %p or %d , don't know how it. thank much! you have enabled debug statement, reading /sys/kernel/debug/dynamic_debug/control tells you. from on, debug message sent normal kernel log, can view dmesg and/or syslog daemon (which log /var/log/messages or /var/log/everything/ , or similar path).

python - Should dict store key in order by inc? -

i have dict integers keys. tell me please, dict store data sorted keys or not? i wrote little code test (as follows): >>> >>> d = {1: 'a', 3: 'a'} >>> d {1: 'a', 3: 'a'} >>> d[2] = 'a' >>> d {1: 'a', 2: 'a', 3: 'a'} >>> but not sure behavior standard , works time. dictionaries in python not sorted. read more on dicts here: http://docs.python.org/library/stdtypes.html?highlight=dict#dict but can use sorted python built-in method sort keys: for k in sorted(mydict): mydict[k] # or here collections.ordereddict implementation you can mix sorted method , ordereddict use later(sure word in case not add new items - otherwise better use sorted method): d = {1: 'a', 3: 'a'} collections import ordereddict sorted_d = ordereddict((k, d[k]) k in sorted(d))

extjs4 - ExtJS 4.0 : Create Basic Form from existing markup -

i trying create basic form existing markup. did in extjs 3.3 way: var formel = document.createelement('form'); ........ var formsubmit = new ext.form.basicform(formel, { method:'post', fileupload:true }); it worked ext 3.3 basic form used accept form id or element dom first param. in ext 4.0, there no such option. need submit basic form later. can tell me: there other option in extjs 4 this? unfortunately cannot work ext js 4. in ext 4 forms not bound actual html form elements. instead on submit temporary form element generated , submitted server. you should submit form using js. here example how that.

VS 2005 Compile on Save C# -

this baffling me, unable find setting if exists. 90% sure code used compile on save before. started having issue when using c#, .net worked fine. but able rid of error lines etc, when choosing enter debug mode. example when have method public bool method1(){ //no code added yet blue line saying return } even when add return inside method line remains there on save. goes away when build. (this 1 example seems happen lots of other things) edit - in regards options compile on save. the options in build , run set correctly that should produce red underline , entry in error list window: "not code paths return value". produced intellisense parser, not compiler. saving file not remove error hint, opening project does. , fixing code of course. there bug of sorts in logic, in cases error list doesn't purged. workaround i've seen restart visual studio. i've seen intellisense warnings , affects error list, not editor. can't remember ex

Problems while loading configuration files in Ruby on Rails -

i having problems while loading configuration file in yaml. have added following code in application.rb file. appconfig.setup |config| config[:env] = rails.env config[:uri] = "yaml://#{rails.root}/config/app_config.yml" end but when try run server, shows following error. bad uri(is not uri?): yaml:///path_to_project/config/app_config.yml (uri::invalidurierror) how fix problem? i use stable solution on production last 2 years called configatron

uml - Differentiate aggregation and composition relationship using source code -

Image
is possible differentiate between composition , aggregation relationship reading source code? i tried find patterns , have listed them below. i taking example this site explain assume pattern composition public class engine { . . . } public class car { engine e = new engine(); ....... } aggregation public class address { . . . } public class person { private address address; public person(address address) { this.address = address; } . . . } i find these patterns differentiate composition (is part of ) defined field of class. example: [engine e] engine defined field e of class car instantiated , assigned within class. example: [engine e = new engine();] engine instantiated inside class aggregation (has a) defined field of class example: [private address address;] address defined field address of class person instatiated out side class example: [address address = new address();] address instatiated

How to list conflicted files (files with changes in both parents) in a git merge commit? -

qgit has nice option of seeing "interesting" files in merge commit, interesting file defined file has changes in both parents. corresponding command line see such files? git show --name-status sha1_of_merge will show commit message , files modified in both parents ( mm ). e.g. git.git repository in commit d907bf8ef32: merge branch 'jc/index-pack' see: $ git show --name-status d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340 commit d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340 merge: 54dbc1f 3de89c9 … mm builtin/index-pack.c mm builtin/pack-objects.c mm cache.h mm csum-file.c mm fast-import.c mm sha1_file.c if don't care commit message , such, git show manpage points format used merge commits: git diff-tree --cc . so, if want see commit hash , "interesting files" use: $git diff-tree --cc --name-status d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340 d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340 mm builtin/index-pack.c mm bui

signals - Python-dbus extra param to add_signal_receiver -

i'd pass param add_signal_receiver or somehow path signal received from. it's defined that: bus.add_signal_receiver(handle_signal, 'remotedevicefound', 'org.bluez.adapter', 'org.bluez', '/org/bluez/hci'+x) def handle_signal(address, cls, rssi): xxxx i wan't have many signal receivers @ same time , able read 'x' inside handle_signal function. the python dbus documenation has answer . provides following example pass sender handler function: def handler(sender=none): print "got signal %r" % sender iface.connect_to_signal("hello", handler, sender_keyword='sender') so, instead of using bus.add_signal_receiver , create interface signal providing object first , connect signal in example.

tomcat - Getting a 404 for /solr/update/extract on Solr 1.4.1 & Tika 0.4 -

i've installed solr 1.4.1, can't tika 0.4 (which included in contrib/extraction) work correctly. i'm getting 404 error when attempting hit http://localhost:8080/solr/ss/update/extract ("ss" core). i've moved of contrib/extraction jars web-inf directory of solr after has been deployed, "solr-cell" jar resides in "dist" directory. the method used above worked solr 3.3, pdf parsing broken in tika 0.8, decided revert solr 1.4.1 , tika 0.4. i'm using tomcat 7.0, if helps. i resolved issue. i had copied multicore directories ("core0" , "core1" in example/multicore) , using stripped down versions of solrconfig.xml. referred default example (located in example/solr) , grabbed "requesthandler" section "update/extract" , placed in stripped down version of solrconfig.xml , restarted solr web app within tomcat , file parsing works perfectly. i hope helps else.

TeamCity + Psake + SqlCmd Powershell infinite loop -

i'm trying use powershell runner in teamcity 6.5.2 run psake task depends on task calls out sqlcmd. if try this, teamcity seems infinite loop until times out or errors out. i'm usinged -command option in teamcity otherwise errors don't bubble teamcity. it seems has sqlcmd. found blog , tried tweaking sqlcmd encoding unicode no luck. has else seen behavior , if how fix? i had same problem today. the bug tw-17732 in youtrack it's bug in -command mode of runner , deprecating instead of solving it. the recommended mode -file mode might require change security policy on each agent typing in administrator powershell console: set-executionpolicy remotesigned

php - how to get Google Plus ID with a Google Authentication -

i saw website google plus profile id google openid authentification. how done? this: http://developers.google.com/+/api/oauth should help.

ruby on rails - Nested Objects with Inherited Resources -

first off, love inherited_resources consider following: class job < activerecord::base has_many :inputs, dependent: :destroy has_one :output end class jobscontroller < inheritedresources::base respond_to :json end when request jobs/1.json json of job object. want inputs , output included. achieve by: job.to_json(include: [:inputs,:output]) my question best way achieve ir? now, i'll overwrite show, wanted know if there more elegant way? thanks! @corroded put me on right track. answer overwrite as_json on model. specifically did following: public def as_json(options={}) super(include: [:inputs,:output]) end

perl - How do I get access to filehandle and format respectively by typeglob? -

Image
it seems filehandle , format doesn't have prefix,so can't reference them tricks %{*spud} . is there i'm missing? update how access format ? why $fd=*stdout , $fd=\*stdout both work? update2 code: package foo; our $spud = 'a scalar'; our @spud = 'an array'; our %spud = (a => 'hash'); sub spud {} format spud = . open 'spud', $0; $stash = \%foo::; $name = 'spud'; $glob = $$stash{$name}; $type (qw(scalar array hash code io format)) { #this works #print *$glob{$type}, $/; #this doesn't work,only output 1 row of scalar print *{$foo::{spud}}{$type}, $/; } output: [root@perl]# perl tb scalar(0xa4dcf30) [root@perl]# {package foo; our $spud = 'a scalar'; our @spud = 'an array'; our %spud = (a => 'hash'); sub spud {} format spud = . open 'spud', $0; } $stash = \%foo::; $name = '

winforms - C# equivalent of Form.Activate event? -

what c# winforms equivalent of vb6 form.activate event? there form.activated event appears have same behavior: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.activated.aspx

html - Create a list item dynamically using two file paths JQuery -

ok explain best can what is create jquery function create list 2 different folders give me 30 images <div id="box"> <ul> <li><a href="images/test1.jpg"><img src="imagesthumbs/test1.jpg" alt="" /></a></li> <li><a href="images/test2.jpg"><img src="imagesthumbs/test2.jpg" alt="" /></a></li> <li><a href="images/test3.jpg"><img src="imagesthumbs/test3.jpg" alt="" /></a></li> </ul> </div> it possible whats simplest way of writing this? thanks sho lets have 2 arrays 2 different folders. can try this var images = ["test1.jpg", "test2.jpg"]; var imagesthumbs = ["test1.jpg", "test2.jpg"]; var ul = $("<ul/>"); $.each(images, function(i, val){ $("<li/>") .ap

php - ActionScript join/split -

hi guys have port few functions php, ran small problem. there's array, lets called arr1. there switch, pushes argument array, after switch ends, i'm stuck @ join("").split(""); var arr1 = []; switch (mystring) { case "apple": { arr1.push("apple"); break; } } } arr1 = arr1.join("").split(""); i know simple, never had experience arrays in flash before, realized join("") used convert array string, isn't split reversing this? what code doing first joining array values string, , splitting them array of separate characters. php equivalent ( tested ): $arr1 = array("apple"); //arr1 after switch $arr1 = str_split(implode('',$arr1));

optimization - Switching between in-memory and WCF service? -

imagine have following, standard wcf, code : [servicecontract] interface icustomerservice { [operationcontract] customer getcustomer(); } public icustomerservice { public customer getcustomer() { return mystore.whatisneeded(); } } this working , allows me distribute service , consuming code. is possible (and idea) bypass wcf engine if working in single box ? in fact, want app able run on farm servers, or on small single box servers. to reduce wcf messaging cost, i'd have : icustomerservice service = null; if(singlebox) { service = new customerservice(); // direct instanciation of service class. no wcf here ... } else { service = new customerserviceclient(); // wcf client } var cust = service.getcustomer(); if wrapped properly, can technique reduce server charge ? this surely reduce overhead of wcf runtime. i'd create factory class check if(singlebox) , new right implementation of icustomerservice.

What does MySQL converting varchar to char? -

when add new table, made mistake : field varchar(255), have write join queries. alter table make char(6). my question : mysql in case ? trims right ? rather worry mysql or doesn't why not convert data before change. e.g. update yourtable set yourfield = left(yourfield,6); alter table yourtable modify column yourfield char(6) you should note if column data long won't let alter assuming enable strict sql mode see shef's complete answer

How to get by Content-Id the attachements of a multipart response with PHP CURL -

i can't figure out how specific part of multipart http response. i'm trying pdf report jasper reports server sending soap on phpcurl , didn't find in curl documentation how handle multipart response. 'report' part of raw response below. help. ilyas ------=_part_6_9317140.1311257231623 content-type: text/xml; charset=utf-8 content-transfer-encoding: binary content-id: <b33d7700bfcf12cc2a64a7f6fb84ceae sutffs here ------=_part_6_9317140.1311257231623 content-type: application/pdf content-transfer-encoding: binary content-id: <**report**> binary pdf content here try this: <?php $str = '------=_part_6_9317140.1311257231623 content-type: text/xml; charset=utf-8 content-transfer-encoding: binary content-id: <b33d7700bfcf12cc2a64a7f6fb84ceae sutffs here ------=_part_6_9317140.1311257231623 content-type: application/pdf content-transfer-encoding: binary content-id: <**report**> binary pdf content here'; $pattern = '%c

excel - Copying and pasting data using VBA code -

i have button on spreadsheet that, when pressed, should allow user open file, copy columns a-g of spreadsheet "data", paste data columns on current sheet. i have logic error in code; runs, pastes selection in wrong place. i having trouble referencing 2 workbooks. here code: sub button1_click() dim excel excel.application dim wb excel.workbook dim sht excel.worksheet dim f object set f = application.filedialog(3) f.allowmultiselect = false f.show set excel = createobject("excel.application") set wb = excel.workbooks.open(f.selecteditems(1)) set sht = wb.worksheets("data") sht.activate sht.columns("a:g").select selection.copy range("a1").select activesheet.paste wb.close end sub use pastespecial method: sht.columns("a:g").copy range("a1").pastespecial paste:=xlpastevalues but big problem you're changing activesheet "

javascript - Filtering out 0-9 & dashes only? -

i create regexp targets characters in string isn't 0-9 (numeric) or - (dash). wrong below regexp? regex: regex = '/^[0-9-]/g'; js implementation: $(this).val($(this).val().replace(regex, '')); i think meant ^ inside character class. also, regexes not strings : regex = /[^0-9-]/g; $(this).val($(this).val().replace(regex, ''));

mapping - Alt key shortcuts not working on gnome terminal with Vim -

i'm running vim on gnome terminal. alt key mappings not working. for example (this example): :imap <a-i> <esc> it works fine in gvim. when run same command vim in gnome terminal doesn't work. so think problem terminal, right? how can fix it? thanks edit: have windows 7 installed on same machine, , windows terminal works fine too. the problem there 2 ways terminal emulator send alt key (usually called meta key actual terminals didn't have alt). can either send 8 bit characters , set high bit when alt used, or can use escape sequences, sending alt-a <esc>a . vim expects see 8 bit encoding rather escape sequence. some terminal emulators such xterm can set use either mode, gnome terminal doesn't offer such setting. honest in these days of unicode editing, 8-bit encoding not such idea anyway. escape sequences not problem free either; offer no way of distinguishing between <esc>j meaning alt-j vs pressing esc follow

ios4 - IOS: Tabbar Item -> Navigation Controller View -> Table View Item -> Detail View -

could me, i'm looking for next question: wanna change navigation controller's current view table row item's detail view; navigation contoller located tabbar's item, table , other buttons located objects in navigation controller current view. thanks in advance!

java - how to put folders inside a jar file into the classpath? -

i mantaining old java application has dcm4che library. dcm4che library not jar file. folder contains jar files , other folders properties files , classes in different folders. using windowsxp , java 1.6. when run our application, need put folders, jar files classpath doing these: set classpath=.;%proj_home%\classes;^ %thirdparty_home%\dcm4che;^ %thirdparty_home%\dcm4che\classes;^ %thirdparty_home%\dcm4che\resources;^ now try put of them 1 jar file simplify sources control. create manifest.txt file following content: class-path: classes;resources;lib\dcm4che.jar;getopt.jar then create dcm4che.jar running jar: jar -cfm dcm4che.jar manifest.txt * a dcm4che.jar created. verify result extracting contents , check manifest file , classpath there: manifest-version: 1.0 class-path: classes;resources;lib\dcm4che.jar;getopt.jar created-by: 1.6.0_25 (sun microsystems inc.) then modify application classpath point new generated dcm4che.jar , delete older entries. when run it,

sql - TSQL Remove duplicated rows on some column only -

possible duplicate: sql - how can remove duplicate rows? example table: sitekey, name, city the sitekey auto increament, name different , times 2 sitekey have same city. example: 1, , citya 2, b, cityb 3, c, citya 4, d, cityf so need remove rows 3, , keep rows 1,2,4 only. its on sql 2005 , up. thanks help. here 2 ways can it. delete t <table> t exists (select 1 <table> t.sitekey > sitekey , t.city = city) delete t <table> t inner join <table> t2 on t.city = t2.city , t.sitekey > sitekey

silverlight - XAML to HTML converter -

i have requirement save emails written in richtextbox database. obviously, persist formatting db , send out html emails. however, requires converting xaml html stored , converting if reloaded db. i have tried out xamltohtml converter. problem getting converter works partially. sets formatting correctly in html text part missing. have followed post:: xaml html conversion - wpf richtextbox , had same error adding tags didnt solve problem. has got experience xaml html conversions? thanks consider using free html editor silverlight instead. html richtextarea control (silverlight 4 only) . you load , save html , not bother xaml @ all. careful fontsizes, last time looked px sizes worked, pt sizes not supported. may want fiddle samples font drop down actual value 1.33 displayed size.

iphone - background image confusion using UINavController -

i having trouble explaining myself here best attempt. i have rootviewcontroller has unique background imageview (placed in ib). when user advances screen navigationcontroller loaded in standard background color , can advance through next screens. possible have 1 image stay background, know can use: self.tableview.backgroundcolor = [uicolor clearcolor]; to allow background show through, reason when see first background image(the unique one), not 1 have added navigation controller. this code use add bg nav controller: uiimage *img = [uiimage imagenamed:@"v3_default_bg.png"]; uiimageview *bgview = [[uiimageview alloc] initwithframe:self.view.frame]; bgview.image = img; [appdelegate.navigationcontroller.view sendsubviewtoback:bgview]; my question this, possible apply non-unique background navigationcontroller. i tried addsubview: instead of sendsubviewtoback: blocks out content. lend me thoughts? thanks. [appdelegate.navigationcontroller.view sendsu

php - Updating session array with jquery -

i have dynamicaly created table products: detail qty price total detail1 3 23 69 detail2 1 3 3 qty in text input field. every qty text field name unique detail code. need every time change qty field, updates session array unigue detail code. how can on jquery without submitting form? sorry bad english, omerimuni this code has been taken (and modified slightly) another answer - should solve problem. try - $('input:text[id*="qty"]').bind('keyup',function() { $.post("my_other_script.php", { qty: this.id} ); }); 'my_other_script.php' - <?php $_session['qty'] = $_post['qty']; ?>

ASP.NET and HTML/XML in control text -

i have number of webforms must able accept xml input (containing, of course, < , > characters, believe causing problems). however, presently whenever click submit button , 1 of form fields contains kind of input sys.webforms.pagerequestmanagerservererrorexception exception code 500 thrown. if input has no < , > goes smooth. how can work around this? i cautious turning off page validation. @ html encoding text instead.

javascript - Can only access jQuery.ajax not $.ajax -

i have strange problem. have loaded jquery-min javascript in file. can access jquery.ajax not $.ajax. $.ajax said undefined. why that? you can fix using closure well. (function( $ ){ // jquery code here. })( jquery );

django - website not working in chrome but working in IE , firefox -

i m facing peculiar problem, have django powered site , works fine on local host in firefox,ie , google chrome.when put on server works fine on firefox,ie not on chrome problem each time login in chrome , , try visit other pages, redirects me login page, means session variables arent stored or may other problem such thing doesnt happen in mozilla firefox , ie it grateful if 1 guide me cause m stuck , site needs ready in week if m not specific please ask specifications thanks in advance this .htaccess files suphp_configpath /home/shaastra authuserfile /home/shaastra/public_html/2011/erp/.htpasswd authtype basic authname "this area closed now." require valid-user addhandler fastcgi-script .fcgi rewriteengine on rewritecond %{request_uri} /2011/erp$ rewriterule .* %{request_uri}/ [r,l] rewriterule ^(media/.*)$ - [qsa,l] rewritecond %{request_uri} !(django.fcgi) rewriterule ^(.*)$ ./django.fcgi/erp/$1 [qsa,l] i have no idea source of problem, gc, or maybe se

Java eclipse referencing files in project using relative paths -

i trying upload web using 1 of apache's client libraries. having trouble locating resource file upload. project setup looks this: root/src/a/b/c/d/program.java root/resource/resourcefile.txt i wondering string path referencing resource file program.java? file f = new file("what path go here?"); thanks in advance. eclipse (by default) not include file in built project. the project path information eclipse environment not available in built project if run in eclipse, display base path of application. find out with file f = new file("."); system.out.println(f.getabsolutepath()); tips : read documentation of java api for questions write minmal test programs

Cant hide application icon from the Android Menu? -

i have landed in situation want start install of third party app (lets app y) app (x) , not want application y icon created on android main menu. i have tried code below still there icon of app y getting created in main menu after app y gets installed successfully. please remember can not change manifest of app y third party app. i have tried suggestions on following link have not resolved problem: how hide application icon android desktop? ++++++++++ file file = new file("/sdcard/myapps/app y.apk"); intent intent = new intent(); uri uri = uri.fromfile(file); intent.setaction(android.content.intent.action_view); intent.removecategory("android.intent.category.launcher"); intent.setdataandtype(uri.parse(uri.tostring()), "application/vnd.android.package-archive"); startactivity(intent); ++++++++++ please let me know suggestions/inputs on this. thanks the way remove intentfilter defined in package's androidmanifest.xml fil

How do I access my facebook page's reviews from the Graph API? -

i have been trying pull reviews left on facebook page. i tried following advice given question . however, when try this, reviews left application , not reviews left on page. i tried pulling reviews the, /136789689670650/tabs/reviews connection of page. pulled information on tab , not reviews tab contains. so know how can use graph obtain reviews of page? thank you. --christopher [edit] sorry, see you're asking when install reviews tab on regular page , not app page - not exposed via api [/edit]

Android open or create database -

i trying create database on sd card. whenever call sqlitedatabase.openorcreatedatabase error: 07-21 13:33:17.587: error/androidruntime(5541): caused by: android.database.sqlite.sqliteexception: unable open database file does know may causing this? here code have in open() method of database class: file sdcard = environment.getexternalstoragedirectory(); string dbfile = sdcard.getabsolutepath() + file.separator+ "external_sd" + file.separator + schema.database_name ; db = sqlitedatabase.openorcreatedatabase(dbfile, null); one possible fault on did not set appropriate permissions <uses-permission android:name="android.permission.write_external_storage" /> however storing data on sd card considered insecure. because every application has permissions store data on sd storage access database. edit: possible problem external storage may not available. need make sure external storage writeable. 1 method determine state via getexterna

Is there a chart of all the data strucutres and algorithms listed anywere? -

is there chart or table anywhere displays lot of(at least popular ones) data structures , algorithms running times , efficiency? what looking can glance at, , decide structure/algorithm best particular case. helpful when working on new project or study guide. i don't believe such list exists. sheer number of known algorithms , data structures staggering, , new ones being developed time. moreover, many of these algorithms , data structures specialized, meaning if had list in front of difficult know ones applicable particular problems trying solve. another concern such list how quantify efficiency. if rank algorithms in terms of asymptotic complexity (big-o), might end putting algorithms , data structures asymptotically optimal impractically slow on small inputs ahead of algorithms known fast practical cases might not theoretically perfect. example, consider looking median-of-medians algorithm linear time order statistics, has such huge constant factor other alg