Posts

Showing posts from September, 2010

vb.net - How to programatically open document in lecture mode in word 2013? -

Image
i'm trying open programatically via vb.net word document in readonly mode in order modify document has opened in page view. word 2010 automatically not word 2013 open in lecture mode. is there way avoid this? open in page view mode instead of lecture mode? when opened : have click have want: how word should open :

How to make the Camera of UDK (Unreal Developement Kit) Move alone side scrolling? -

i on project space side scrolling game , trying make camera of engine act old space shooter game(move alone , when player pawn stays idle move alone @ edge), tried find tutorials spaceship controller found camera options land units. my solution overwrite default unreal camera , program own. here quick guide on how accomplish this. it's quite easy, really. the first step create custom camera class. here: class mycustomcamera extends camera; //camera variables var vector mcameraposition; var rotator mcameraorientation; var float mcustomfov; /**init function of camera */ function initializefor(playercontroller pc) { super.initializefor(pc); mcameraposition = vect(0,0,0); //etc... } /**update function of camera */ function updateviewtarget(out tviewtarget outvt, float deltatime) { //this meat of code, here can set camera position @ each //frame, it's orientation , fov if need (or else really) outvt.pov.location = mcameraposition

java - Change from @Enumerated to @Enumerated(EnumType.STRING) on database -

i have annotation @enumerated on fields in application thats working. told change @enumerated(enumtype.string) prevent problems if enum values change. database populated, question is what way change values on database 1,2,3.. corresponding string values of enum class? if asking how can maintain values , change db think have in few steps(the basic algorithm switch values): add new column table numerical. copy values column new one. delete content of column alter table make string column copy values column original one. this detailed , not sure if asking...

c++ - Importing values from a *.dat file to an array -

i have file called numbers.dat consists of 20000 random numbers. need create array in *.cpp file elements numbers numbers.dat file. sure basic, however, nothing have found online has answered question. thank help. you need provide lot more information if expect useful answer, started, here's simple example of can do. i'm assuming file text file (doesn't matter extension is; text file 1 can open in notepad , read contents.) #include <fstream> #include <vector> int main () { std::vector<int> data; std::ifstream fin ("numbers.dat"); int temp = 0; while (fin >> temp) data.push_back (temp); // here have data in "data" vector. return 0; } the above code reads many integers in file named "numbers.dat". these integers must separated whitespace (space characters, tabs, new lines, etc.) not things commas , semicolons. if need read numbers binary file, write comment , i'

How can I control Excel Add-Ins from a C# Winforms application? -

i want control excel add-in c# windows forms application. this have far: var exceladdin = excelapp.addins.add("c:/.../nwpredict.xlam", type.missing); messagebox.show("predict: " + exceladdin.fullname); this code works, how start add-in , change settings? if want permanently change settings of add-in need open file, not attach add-in running instance of excel. (this isn't done programmatically though.) perhaps should clarify because, me, add-in supposed "complete". if settings need changed when add-in in use, add-in should make these settings available excel-instance, via exposed properties (or other technique). but, again, these settings wouldn't permanently saved (in add-in itself).

file - Is there a function in C++ to determine if a specific certain folder in a given directory exists or not? -

is there simple such function in c++? appreciated. you can use boost's filesystem library . example: #include <iostream> #include <boost/filesystem.hpp> int main(int argc, char* argv[]) { boost::filesystem::path p("/path/to/directory"); if (exists(p)) { std::cout << p << " exists!" << std::endl; } return 0; } note boost filesystem not header-only , requires library linking.

jquery - Tracking onhashchange events -

looking best practice following scenario: in traditional webapp, perform analytics on logs based on http gets. project in question leverages html5, jquery , mustache.js dynamically render templates jsonp calls. views respond onhashchange events create bookmark-able urls, parameters via jquery bbq. my issue hash isn't passed server, these changes in url aren't going show in regular access logs. best solution that's been offered far, track hash changes locally, , put / post them service when browser fires onbeforeunload . i'm interested in other solutions tracking local hash history changes on server, can't use google analytics this. call simple file ( track.html , track.php , track.asp ) depending on server architecture. file can empty. onhashchange , ajax call simple tracking file hash querystring ( track.html?hash=hashstringvalue ). should show in access logs.

html - Powrshell Loop within Loops -

i have powershell script runs disk usage report (from http://gallery.technet.microsoft.com/disk-space-html-email-f8b6bbfe ) i'm trying change display folder size well, have gotten stuck. wrote works fine: $volname = "d:\" $folders = (get-childitem $volname | ?{ $_.psiscontainer }) foreach ($folders in $folders) { $size = (get-childitem $folders.fullname -recurse | measure-object -property length -sum) write-host $folders.fullname ($size.sum / 1mb) } but doesn't come out right when try insert it. have far: # script generate disk space report exchange servers (daily, weekly, monthly) $erroractionpreference = "silentlycontinue"; $scriptpath = $myinvocation.mycommand.definition $dir = split-path $scriptpath #variables configure $percentwarning = 25; $percentcritcal = 15; $smtpserver = "blah@blah.com" $reportsender = "blah@blah.com" $users = "user1@mydomain.com", "user2@mydomain.com"; $mailsubject = &quo

android - Error when compiling LibCurl under Ubuntu: zlib.h : no such file or directory -

i trying compile curl source code (version 7.22.0)under ubuntu 13.04 import libcurl android platform. android source code (version android-2.2_r1) has been compiled , environment compiling curl has been set successfully. compiling environment: android source code version: 2.2_r1 ndk version:android-ndk-r8e curl souce code version:7.22.0 gcc version:4.4.7 jdk version:1.5.0_21 the following configure command setting compiling environment libcurl: android_home=/home/kevin/android-build/working-space && \ ndk_home=/home/kevin/software/android-ndk-r8e && \ path="$android_home/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$path" \ ./configure --host=arm-linux cc=arm-eabi-gcc --with-random=/dev/urandom \ cppflags="-i$ndk_home/platforms/android-14/arch-arm/usr/include \ -i $android_home/external/curl/include/ \ -i $android_home/external/curl \ -i $android_home/out/target/product/generic/obj/static_libraries/libcurl_intermediat

windows - 2D Cross-Platform Game Development Engines -

i've worked time corona sdk , love how fast , easy can create powerful apps using lua. can compile ios , android, feels little now. my main interest able compile desktop , mobile. @ least following: windows + mac desktop, standalone applications. ios + android mobile. i'd prefer lean more towards lua type scripting instead of actionscript, please feel free post have worked , love. i've found following engines far: marmalade quick - after further looking it, marmalade quick can build mobile! iwgame - works on top of marmalade , says can deploy desktop , mobile lua. info appreciated on this sio2 - says "sio2 opengles based cross-platform 2d , 3d game engine ios, android, macos , windows" , "the engine allows port game on mac store , on windows.", forum , web title "game engine mobile devices". can't find info on if can deploy desktop platforms, info appreciated again. loom engine - loom similar haxe + openfl (attempt

java - Simple metric for blur in images? -

i'm trying tell if given photo blurry. know impossible task, , metric return undesirable results sometimes. i'm wondering if there's simple metric @ least tries estimate blur can use though. specifically, task has high tolerance false positives . e.g. if got eliminated 90% of blurry photos , 50% of non-blurry photos happy. i'm trying implement in java. have array of pixels (as ints). please keep in mind have limited understanding of image processing techniques (fourier transforms, etc.), , love specific walkthrough of how code solution. as you've said you're not going find universal metric. also there different types of blur: uniform, anisotropic, motion blur... in general blurred images tend exhibit low frequencies. possible descriptor sum of magnitude of k highest frequencies. image low sum blurred overall. the magnitudes can obtained in n*log(n) time using fourier spectrum (high frequencies far origin) or laplace pyramid (high frequenc

environment variables - Jenkins Perforce Label Sharing across jobs -

is there way 1 can share variables across jenkins jobs ? job1 collects required source code , labels them using perl scripts. number of other jobs compiles code since there many versions. of have made other jobs depend on job1 same code collected head since labelled before in job1, not case during release since codes going in repository @ odd hours had no control, thought nice if find way sync code using perforce label created in job1. did not find way sync particular label got created in different job. thought if set environment variable , use same following jobs, codes can in perfect sync. seems environment variables cannot shared across jobs. i appreciate ideas , help. can use "use upstream project revision" option? allows sync changeset of project. if want stick label idea, think it's doable. haven't tried this, think first have first job create new label based on job name , build number; both available in create label post-build action. if la

sql - Select with subquery avoid running more than once? -

i have query this select col_a ,col_b ,col_c ,case when (select ...{a complicated query}...) not null 1 else 0 end case col_d mytable the subquery produces col_d returns integer when not null. i need show bit col_d is, need show int returns. normally, rewrite subquery , call col_e, given it's complexity, don't want run twice. ideally, have: select col_a ,col_b ,col_c ,(select ...{a complicated query}...) col_e ,case when col_e not null 1 else 0 end case col_d mytable do have options? (ms sql 2008) edit: sorry - should have mentioned complicated query includes clause based on columns i.e. select ...{a complicated query}... x = col_a , y = col_b so if results of query single value or null, use: select col_a ,col_b ,col_c ,case when t.whatevercol not null 1 else 0 end case col_d, t.whatevercol mytable, (select ...{a

javascript - Set CSS -moz-transition with JS -

i'm making webapp , i'm using css3 make div transform i'm big problem firefox. can make chrome, opera , ie working firefox not. set working browsers use: obj.style.webkittransform = "translatex(17%)"; obj.style.moztransform= "translatex(17%)"; //edited obj.style.mstransform = "translatex(17%)"; obj.style.transform= "translatex(17%)"; //edited i've tried jquery $("#content").css( "-moz-transform", "translatex(17%)" ); , lot of things found on internet , nothing. sugestion? edit: in context, original function: function mousewheelevt(obj) { if (window.addeventlistener) window.addeventlistener('dommousescroll', wheel, false); window.onmousewheel = document.onmousewheel = wheel; var slide=0; function wheel(event) { var delta = 0; if (!event) event = window.event; if (event.wheeldelta) { delta = event.wheeldelta;

Python - Combing data from different .csv files. into one -

i need python programmers solve issue i'm facing in processing data:- i have .csv files placed in directory structure this:- -maindirectory sub directory 1 sub directory 1a fil.csv sub directory 2 sub directory 2a file.csv sub directory 3 sub directory 3a file.csv instead of going each directory , accessing .csv files, want run script can combine data of sub directories. each file has same type of header. , need maintain 1 big .csv file 1 header , .csv file data can appended 1 after other. i have python script can combine files in single file when files placed in 1 folder. can provide script can handle above directory structure? try code, tested on laptop,it works well! import sys import os def mergecsv(srcdir,destcsv): open(destcsv,'w') destfile: header='' root,dirs,files in os.walk(srcdir): f in files: if f.endswith(".csv"): open(os.path.jo

python - how to add a button in custom openerp module -

hi having error while adding button of type action .i cannot view button . following vetclinic_view.xml <record id="vetclinic_breed_action" model="ir.actions.act_window"> <field name="name">breed</field> <field name="res_model">vetclinic.breed</field> <button name="add_field" string="add field" type="object" class="oe_highlight" /> <field name="view_type">form</field> <field name="view_mode">tree,form</field> <field name="help" type="html"> <p class="oe_view_nocontent_create">click create record.</p> </field> here vetclinic.py class vetclinic_breed(osv.model): _name="vetclinic.breed" _columns={ 'name':fields.char('name',size=32), } def add_f

jasperserver - Rebrand Jaspersoft server community edition -

is possible rebrand jasperreports server community edition ? i tried , can see can change titles, etc. defined in messages .properties files. but, couldnot locate logo image on header bar ( top left corner ). whereas, can locate logo image jasperreports-pro version. and, there document on rebranding pro version. does mean community edition cannot rebranded ? i found logo under themes folder. and, found way define new theme folder , add own logo , css under it. but, new question is there elegant , quick way add themes per organization @ runtime, if requirement there may many organizations added every week.

android - Plot Combined Stacked bar and Bar chart Achartengine -

Image
i using achartengine plot graph in android there difficulty combining stacked bar , bar. want type of graph. is possible plot that. if possible can give small footprint. thank you. you can building stacked bar chart only. don't need combine regular bar chart stacked bar chart. there new heap type of bar charts stacked bar chart, every piece being appended previous piece of bar rather stacking them 1 above other.

multithreading - Delphi - can't supress JavaScript error dialogs using IWebBrowser2 in a multi-threaded application -

this question has answer here: disable script debugging in iwebbrowser2 ole control? c++ 1 answer i have app in delphi xe2 (runs on win7 x64, msie 10.0.9200.16635 installed), creates multiple threads. each thread creates iwebbrowser2 interface, navigates web page, saves disk, deletes iwebbrowser2 interface , terminates thread. "silent" property of web browser set true. problem urls these errors after terminating working thread (e.g. web browser should not exist anymore: screenshot1 screenshot2 these javascript errors, first 1 says "function expected", url res://ieframe.dll/preview.js, , other 1 "the callee (server [not server application]) not available , disappeared; connecitons invalid. call did not execute". url same, res://ieframe.dll/preview.js. need supress these error dialogs, can't. iwebbrowser2 not have "scripterrors

c - "error: subscripted value is neither array nor pointer nor vector", but why? -

i writing tic-tac-toe program , writing function player's turn. passing in tic-tac-toe board (a 3x3 array) in form of pointer, b . problem on last line error in title. subscripted value neither array nor pointer nor vector: b[playercoordsx][playercoordsy] = "x"; just testing i've tried multiple different = values. both characters , numerical values not fix issue. here abbreviated code (what hope) relevant bits: void playerturn(int *b); ... int main(void) { int board[2][2]; int (*b)[2][2]; b = &board; ... void playerturn(int *b); ... return 0; } void playerturn(int *b) { int playercoordsx, playercoordsy; while ((playercoordsx != 1 || playercoordsx != 2 || playercoordsx != 3) && (playercoordsy != 1 || playercoordsy != 2 || playercoordsy != 3)) { printf("enter x coordinate use:"); scanf("%i", &playercoordsx); playercoordsx = playercoordsx - 1; pri

WPF C# button click event in code behind -

i have create button in code behind , how write click event? mousedown? ? want detect if button being pressed populate textbox text. button btn1 = new button(); btn1.content = qhm.option1; sp1.children.add(btn1); if (btn1.mousedown = true) { tbox.text = qhm.option1; } like that: button btn1 = new button(); btn1.content = qhm.option1; btn1.click += btn_click; sp1.children.add(btn1); //separate method private void btn_click(object sender, routedeventargs e) { tbox.text = qhm.option1; } using lambda: btn1.click += (source, e) => { tbox.text = qhm.option1; }; you can access local variables.

iOS Override Auto Layout for certain components/objects in a view -

i have view series of buttons underneath each other, when 1 of buttons gets selected need programatically add onother button @ top of other buttons , change height of buttons no space lost bottom of screen. the problem need auto layout turned on view, because of can't resize, or change position of buttons. my question how can 'overide' autolayout of objects in view (buttons) change layout when button selected. thanks autolayout capable of use case you're describing. height of views can compress make room 1 more button. use - (void)setcontentcompressionresistancepriority:(uilayoutpriority)priority foraxis:(uilayoutconstraintaxis)axis on each of buttons , set priority low number (i.e. <250). since have vertical row, axis uilayoutconstraintaxisvertical . you have call -setneedsupdateconstraints on superview of buttons in order new constraints show up.

Validate kannel configuration (aside from running kannel) -

is there way make sure kannel configuration consistent? probably write script checks parameter groups have 1 'group = ' all mandatory groups present, included files present , valid themselves, etc. however, maybe there's standard way already? in kannel configuration file, there many groups different purposes. admin details. group = core for modems define usb modem configurations. group = modems if looking complete configuration file. can get complete configuration file here.

c++ - OpenGL Red Book 8th - First Example gives black box (Ubuntu) -

after getting first example program compiled 8th edition opengl programming guide after many alterations suggested many sites, proud owner of black box - vast improvement hours before, it's embarrassing admit i've watch of debugger , unless basic wrong program, have no clue look. other opengl examples have run, i'm trying first example in new book run. my box: john@zerofluid:~/downloads$ glxinfo | grep opengl opengl vendor string: nvidia corporation opengl renderer string: geforce gt 610/pcie/sse2 opengl version string: 4.3.0 nvidia 313.30 opengl shading language version string: 4.30 nvidia via cg compiler opengl extensions: linux zerofluid 3.8.0-26-generic #38-ubuntu smp mon jun 17 21:43:33 utc 2013 x86_64 x86_64 x86_64 gnu/linux (latest 13.04 ubuntu) i have problem - it's way code post here, first example of book - small gets , have no idea of problem is. cool if wants - i'd feed author of book. yes, loadshader found elsewhere , might problem, suppose

Read float values from file, c# -

i have binary file created using android. using c# application read file. want read floating point values written in file. rest of other values int, char etc succesfully read it. i used readint64() , not returning correct value... please use readsingle(). read floating point values binary file.

How to make Solr query returning results grouped by field -

i channel solr search results @ query time. example have 3 channels: products , faq , other_docs . within same solr core same fields filled. acceive have solr group results "channel" me. sample database (csv): id,channel,name,desc 1,product,some product,this cool product! 2,product,other product,this other product! 3,faq,how stuff,this time: it! 4,other_docs,legal notice,all base belong us! wanted query result (xml): <?xml version="1.0" encoding="utf-8"?> <response> <lst name="grouped"> <lst name="channel"> <int name="matches">3</int> <arr name="groups"> <lst> <str name="groupvalue">product</str> <result name="doclist" numfound="2" start="0"> <doc> <str name="name">some product</str> <str name="des

Android different size image issue -

i had 4 background images: (240*320, 320*480, 480*720, 640*960) now problem had samsung galaxy tab 2 takes image hdpi meaning image size 480*720 , tab size 640*1024. image stretches. confused in image setting in device please of have idea please me. create drawable-sw600dp-hdpi folder in res , put file folder example deprecated drawable-hdpi drawable-mdpi drawable-nodpi drawable-xhdpi new technique configuration examples drawable-sw320dp -> 320dp: typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc). drawable-sw480dp -> 480dp: tweener tablet streak (480x800 mdpi). drawable-sw600dp -> 600dp: 7” tablet (600x1024 mdpi). drawable-sw720dp -> 720dp: 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc). provide different layouts different screen sizes the configuration qualifiers can use provide size-specific resources small , normal , large , , xlarge . example, layouts large screen should go in layout-xlarge/. beginning a

java - Add attachment in existing Jira Issue -

please me attach file in existing issue using jira java rest client. my java code fileinputstream filestreampath=new fileinputstream("c:\\users\\eswaranr\\downloads\\complete program.doc"); final issue issue = restclient.getissueclient().getissue("cps-150", pm); restclient.getissueclient().addattachment(pm, issue.getattachmentsuri(), filestreampath, "complete program.doc"); my pom.xml <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupid>org.apache.commons</groupid> <artifactid>commons-codec</artifactid> <version>1.7</version> </dependency> <dependency> <groupid>com.google.common</groupid> <artifactid>guav

Regex to match double quoted strings without variables inside php tags -

basically need regex expression match double quoted strings inside php tags without variable inside. here's have far: "([^\$\n\r]*?)"(?![\w ]*') and replace with: '$1' however, match things outside php tags well, e.g html attributes. example case: <a href="somelink" attribute="value">here's "dog's website"</a> <?php $somevar = "someval"; $somevar2 = "someval's got quote inside"; ?> <?php $somevar3 = "someval $var inside"; $somevar4 = "someval " . $var . 'with concatenated' . $variables . "inside"; $somevar5 = "this php tag doesn't close, it's end of file..."; it should match , replace places " should replaced ' , means html attributes should ideally left alone. example output after replace: <a href="somelink" attribute="value">here's "d

php - SMF Error: SMF could not connect to the database -

i have website built in cakephp , using smf forum. have kept forum folder in webroot. forum fetching user session cakephp , autologins user forum. forum tables kept in same database. whenever user registers, entry made smf members table. i getting emails containing error message: "there has been problem database! this notice email let know smf not connect database, contact host if continues. " the database connection correct. have 2 users in members table out of 1 forum administrator. i have searched on internet none of solution works me. have been stuck issue around 2 weeks. i changed whole database innodb when hosting server sent ticket containing forum queries in 'waiting table lock' state giving same error again. the ticket showed around 20 database connections open @ time. please advise.

excel - Use Destination Theme & Embed Workbook (h) -

i trying copy chartobject created in workbook sheet , paste powerpoint 2010 slide, such becomes standalone excel chart data (embedded). when manually i.e : copy chartobject present in worksheet goto powerpoint slide click pastespecial & select "use destination theme & embed workbook (h)". right-click chartobject in powerpoint & click "edit data". then new standalone workbook title "chart in microsoft excel", shows chart data. have not been able replicate scenario new standalone workbook title "chart in microsoft excel" using excel vba. can help? assuming there simple column chart on sheet, here code: option explicit sub doit() dim temp workbook dim rng range dim chtobj chartobject thisworkbook.sheets(1) set chtobj = .chartobjects(1) chtobj .copy end dim ppapp object dim pppres object dim ppslide object on error resume next set ppapp = getobject(, "powerpoint.applicatio

Unity3D: NullReferenceException: Object reference not set to an instance of an object -

i want access hero.class variable "aspect" lasercontroller.class, receive error message : nullreferenceexception: object reference not set instance of object . hero.class using unityengine; using system.collections; public class hero : monobehaviour { public float aspect = 0.1f; void update () { } } lasercontroller.class using unityengine; using system.collections; public class lasercontroller : monobehaviour { public float health = 0f; //public float aspect = 0.1f; void oncollisionenter(collision collision) { if(collision.gameobject.tag == "enemy"){ destroy(gameobject); destroy(collision.gameobject); } } void update () { hero direction = gameobject.getcomponent<hero>(); //laserhealth health += time.deltatime; if(health > 7f){ destroy(gameobject); } //problem in here transform.translate(vector3.up * -direction.aspect); } } i guess hero component isn&

Issues with some users in Win Authentication in ASP.NET -

i in strange issues, have asp.net 2.0 application vb.net code behind, set application enable win authentication in iis disabled except windows auth, in web.config have following under system.web: the web.config contains following : authentication mode="windows" authorization> deny users="?"/> /authorization> identity impersonate="false"/> now users when enter asp application prompted user name , password , logged in successfully, users application fails on page.user.identity.name , return object reference error, im using vs2010 , asp.net 2.0 frameword 2.0 , iis 7 under win 2k8 r2 latest sp's installed. all users domain users. thank you, can access username httpcontext.current.user.identity.name? can check if authentication successful, , method of auth used. windows authentication uses kerberos default in iis believe, may not work lot of reasons (i think there problems in firefox example ),

Nested php includes get commented out -

i've written simple function switch languages on site. domainname.com/minis/ regular blog domainname.com/minis-eng/ english version here's switcher, works alright: <?php echo '<a href="'; if (strpos(basename(getcwd()),'eng') !== false) { $subject = basename(getcwd()); $search = '-eng'; $trimmed = str_replace($search, '', $subject); echo '/', $trimmed, '/' , basename($_server['php_self']), '">polski</a>'; } else {echo '/', basename(getcwd()), '-eng/', basename($_server['php_self']), '">english</a>';} ?> now when place in external php , include in main index.php- works alright too. however, i'm using couple of external .php files place repeated elements. index.php looks more or less this: include head.php include body.php (this contains navigation menu) main content include foo

mapreduce - hadoop compression program got stuck while executing -

i facing problem in execution of compression program in hadoop. code trying following: public class streamcompressor { public static void main(string[] args) throws exception { string codecclassname = args[0]; class<?> codecclass = class.forname(codecclassname); configuration conf = new configuration(); compressioncodec codec = (compressioncodec); reflectionutils.newinstance(codecclass, conf); compressionoutputstream out = codec.createoutputstream(system.out); ioutils.copybytes(system.in, out, 4096, false); out.finish(); } } while executing code, not run; showing blinking cursor. here screen shot . it got stuck after giving running command.

python - What file format to use for Django configuration which can be frequently updated using Django forms -

i have django application need configuration file. i want key value pairs in there, values can updated using django form fields. which 1 best file format, read , write easy (user can update values using django form). i have value below: <key_max_range>=**<value_max_range>** the easiest thing serialize json or yaml. however, if want more human-readable format more strictly set of key-value pairs, might use configparser module. reads , writes ini-style configuration files, this: [section] key = value here example of writing out configuration file based on form's cleaned_data : in [39]: configparser import safeconfigparser in [40]: cleaned_data = {'foo': 'bar', 'bob': 'ann'} in [41]: config = safeconfigparser() in [42]: config.add_section('my_form') in [43]: field, value in cleaned_data.iteritems(): ....: config.set('my_form', field, value) ....: in [44]: open('example.cfg',

EXCEL VBA - Error when copying from another instance of Excel to active workbook -

what like: i need able copy columns instance (application) of excel open, depending on header. what have far: sub import_data() dim wb workbook dim c range dim headrng range dim lasthead range dim headrng1 range dim lasthead1 range dim logdate range dim lastrow range dim bottomcell range dim monthrng range dim lastrng range dim prihead range dim loghead range dim typehead range dim callhead range dim deshead range dim ipkhead range dim copyrng range dim monthhead range dim yearhead range activeworkbook application.screenupdating = false end 'on error goto errorhandle set wb = getobject("book1") 'if book1 found if not wb nothing 'copy cells wb.worksheets("sheet1") set lasthead1 = .range("1:1").find(what:="*", lookat:=xlpart, matchcase:=false, searchorder:=xlbycolumns, searchdirection:=xlprevious) set headrng1 = .range("a1", lasthead1) each c in headrng1 if left(c,

Angularjs routing not working after upgrade from v1.0.8 --> v1.2.14 -

i've upgraded application v1.0.8 --> v1.2.14 , i'm not able view routes. i'm not sure how debug controller not invoked either. i'm not getting errors @ either? any appreciated. again .config(function($routeprovider) { $routeprovider .when('/:a', { template: '<div data-ng-include="templateurl">loading...</div>', controller: 'dynamiccontroller' }) .otherwise({ redirectto: '/:a' }); }); i not appending /#/a url. application working fine.

visual studio 2008 - VisualAssistX is messing up my C++ VS2008 colour scheme -

Image
i have visualassistx installed on vs2008 ide, , have set colouring options find (vs fonts & colours visualassistx options colours) defaults however, when turn on vax, go regular scheme to this i have tried resetting vs2008 settings through import/export menu no effect what missing? these colours coming from? visual assist has own colors items detects. calls enhanced syntax coloring. can change in interface visual assist. click on icon looks tomato gear in front of it. advanced. fonts , colors. uncheck "enable enhanced syntax coloring"

where I can find the iphone simulator for launching xamarin IOS Application -

i pulling hair on issue . developing first time ios application of xamarin. creating application on mac. hello world application has been created. have take referenced xamarin hello world tutorial . have not getting ios simulator option in devices drop down. have 2 option ,ios device , default.for simulator ,is there need installation or else.please me , appreciated. does find xcode in right location? check clicking xamarin studio>preferences>sdk locations>apple. if apple sdk not found, can manually specify xcode location path.

this - What's the difference between these two constructors in java ? (Memory) -

here in code public class base { int length, breadth, height; base(int l, int b, int h) { length = l; breadth = b; height = h; } } and base(int l, int b, int h) { this.length = l; this.breadth = b; this.height = h; } here what's difference between 2 constructors intialization? method highly preferred? how varies in terms of memory allocation? there's no difference. in first constructor omit this while in second explicitly specify it. generated bytecode same (you can check it). it's matter of style if want put or not, unless field has same name parameter, in case this mandatory avoid ambiguity, example: base(int length,int breadth,int height) { this.length = length; this.breadth = breadth; this.height = height; } (please use spaces wisely, makes code more readable).

linux - How to print difference between two files -

i have 1 file data gets added every 10 min, want updated data can stored in new file(inc1.txt) through script. my path file /home/asda/desktop/inc.txt how can achive? use tac cat file backwards, , quit when marker: tac /home/asda/desktop/inc.txt | sed /marker/q | tac then add new marker @ end remember last finished echo "marker" >> /home/asda/desktop/inc.txt this has disadvantage alters file, can grep out markers when use file this: grep -v marker /home/asda/desktop/inc.txt of course, should make marker doesn't naturally occur in file.

c# - Cannot deserialize the JSON array (e.g. [1,2,3]) into type ' ' because type requires JSON object (e.g. {"name":"value"}) to deserialize correctly -

i have json below: [ { "attributes": [ { "key": "name", "value": { "value": "acc 1", "values": [ "acc 1" ] } }, { "key": "id", "value": { "value": "1", "values": [ "1" ] } } ], "name": "account", "id": "1" }, { "attributes": [ { "key": "name", "value": { "value": "acc 2", "values": [

android - How can I write different texts after each interval? -

i want write different texts after intervals. wrote codes not working @override public void render() { gdx.gl.glclearcolor(1,1,1,1); gdx.gl.glclear(gl10.gl_color_buffer_bit); float delay = 5; // seconds timer.schedule(new task(){ @override public void run() { batch.begin(); font.draw(batch, texts[flag],200, 200); batch.end(); } }, delay,5); } it great if me figuring out doing wrong explanation. you not using things correctly. render() called every gameloop (about 60 times per second, depending on fps). schedule new timertask 60 times per second... draw() inside timertask , if timer event fired. see white screen, because telling screen overdraw himself white color every render loop: gdx.gl.glclearcolor(1,1,1,1); gdx.gl.glclear(gl10.gl_color_buffer_bit); note, color(1, 1, 1, 1) white full opacity. what should instead is: in show() , if screen class or in create , if app

javascript - need help regarding global variables on multiple pages with 1 js file -

on home page have 2 input fields ( fromzip , tozip ). besides them <a> tag calls function window.open . these 2 inputs should share 1 pop page. pop page allow user choose state , city , resulting zipcode posted on home page. here codes: front page (html): <script type="text/javascript" src="/zipcodehelper/groupfunctions.js"></script> <input type="text" name="rfromzip" id="rfromzip" placeholder="from zip code" ></input> <a class="zipbutton" id="rfromzip" name="rfromzip" onclick="openpage()">?</a> <input type="text" name="rtozip" id="rtozip" placeholder="to zip code" ></input> <a class="zipbutton" id="rtozip" name="rtozip" onclick="openpage2()">?</a> js file:

php - Regular Expression Doesn't Work Correctly in Javascript? -

in earlier thread inserting brackets around "comments" in chess pgn-like string, got excellent finishing regex matches move lists , comments separately. here current regex: ((?:\s?[\(\)]?\s?[\(\)]?\s?[0-9]{1,3}\.{1,3}\s[nbrqk]?[a-h1-8]?x?[a-ho][1-8-][o-]{0,3}[!?+#=]{0,2}[nbrq]?[!?+#]{0,2}(?:\s[nbrqk]?[a-h1-8]?x?[a-ho][1-8-][o-]{0,3}[!?+#=]{0,2}[nbrq]?[!?+#]{0,2})?\s?[()]?\s?[()]?\s?)+)|((?:(?!\s?[\(\)]?\s?[\(\)]?\s?[0-9]{1,3}\.{1,3}\s[nbrqk]?[a-h1-8]?x?[a-ho][1-8-][o-]{0,3}[!?+#=]{0,2}[nbrq]?[!?+#]{0,2}).)+) the 3 capture groups are: " e4 e5 2. f4 exf4 3.nf3 " etc -- i.e. lists of moves " blah blah blah " -- i.e. "comments" comment " ) ( " comment -- i.e. close , begin parens, when chess variation comment @ end "completes", , chess variation comment @ beginning "starts" in action here: http://regex101.com/r/dq9ly5 everything works correctly "your regular expression in" pcre(php) : match