Posts

Showing posts from June, 2013

C - Creation of an array of strings, help request -

C - Creation of an array of strings, help request - i'm having big problems while creating simple programme in c. i have next function: void createstrings (char *dictionary[], int *n) { int i; char word[20]; printf ("insert how many words use: "); scanf ("%d", &(*n)); // initialization (i = 0; < *n; i++) { dictionary[i] = '\0'; } // populating array words (i = 0; < *n; i++) { printf ("insert word in position %d: ", i); scanf("%s", word); dictionary[i] = word; } } in main read array of words populated using printf ("following words have been inserted:\n"); (i = 0; < n; i++) { printf ("dictionary[%d] = %s\n", i, dictionary[i]); } i'm pretty sure lastly cycle has been implemented well. when run programme , seek insert, example, 3 different words "one" "two" , "zero" next output: insert how many words use: 3 inse...

workflow foundation 4 - Where is ListenActivity activity? -

workflow foundation 4 - Where is ListenActivity activity? - i want workflow able respond activity generated host. can utilize receive activity wait external events, receive works (as far understand) in context of workflow web service. in workflow 1.0 (aka 3.5) there hear activity hear events host. i understand can woodoo bookmarks, there replacement old hear activity? or use old activity (form system.workflow) namespace? it's called pick activity. http://msdn.microsoft.com/en-us/library/dd807389.aspx. might improve source http://blogs.msdn.com/b/flow/archive/2009/12/31/event-driven-execution-in-net-4-0-with-the-pick-activity.aspx workflow-foundation-4

c# - Binding height, width, etc to a variable -

c# - Binding height, width, etc to a variable - i don't know if i'm not understanding i've found far, or if complex apply such simple thought seems. i'm trying bind button's height , width variables stored in user settings. can't seem work, or rather don't how to, in commands use. issue lies in not knowing set in binding field of xaml. if point guide involves this, explain appreciative. edit: i've solved problem of binding variable, saves user setting file when should. i'm having issue value stored in user setting beig overwritten every time programme loads default value. running through vs debug menu selection, suppose issue lie there, i've tried publishing , running , still getting same results. ideas? assuming 'user settings' mean built-in settings not custom implementation: see http://blogs.windowsclient.net/bragi/archive/2008/07/03/using-settings-in-wpf-or-how-to-store-retrieve-window-pos-and-loc.aspx illus...

Maven bundles multiple versions of same libraries in WAR -

Maven bundles multiple versions of same libraries in WAR - i got nosuchmethoderror exceptions when running test maven build. realized maven bundles multiple versions of same libraries in war (some transitive dependencies has different versions). default behaviour? fail see how want it. also, found exclusion tag can't have version (or range) can't exclude conflicting version. there way prevent maven adding multiple versions of same library war? give thanks you. edit: yeah, can exclude , depend on in pom. it's far elegant solution (can cause problems changes in upstream). you can configure assembly-plugin exclude dependencies. same excluding duplicates different versions in dependencies section. highly recommend exclude duplicates in dependencies section. project might lack proper dependency management. if utilize correctly, have exclusions in same pom. maven

Retrieve images name from the resources - c# -

Retrieve images name from the resources - c# - i'd name of images resources , store them in listbox. should loop through , declare array? use assembly.getmanifestresourcenames c#

api - Getting information about multiple URLs in one request from Facebook, Twitter, Google+, and LinkedIn -

api - Getting information about multiple URLs in one request from Facebook, Twitter, Google+, and LinkedIn - with facebook, can this: http://api.facebook.com/method/fql.query?format=json&query=select total_count link_stat url="http://stackoverflow.com or url="http://stackexchange.com" or url="http://example.com" however, twitter, google, , linkedin, can figure out how info 1 url @ time. here urls (took me while find): http://urls.api.twitter.com/1/urls/count.json?url=http://example.com https://clients6.google.com/rpc (google uses post request) http://www.linkedin.com/cws/share-count?url=http://example.com how can info multiple urls in 1 request twitter, google+, , linkedin one http request directed @ 1 url. how else http request routed right place if couldn't figure out ip address of send request? you have solution. write web service on server such http://www.example.com/ajax/getallatonce.asmx . in server-side code, cr...

c++ - why typeid returns that int and const int are same types -

c++ - why typeid returns that int and const int are same types - if(typeid(int) == typeid(const int)) cout << "same types"<< endl; program output: same types am missing something? these not same types lol. they aren't same type, typeid operator strips const , volatile . from section 5.2.8 [expr.typeid] : the top-level cv-qualifiers of glvalue look or type-id operand of typeid ignored. c++ typeid

c++ - Qt How to find out from where the closeEvent(QCloseEvent *event) fired -

c++ - Qt How to find out from where the closeEvent(QCloseEvent *event) fired - i have in main window 2 triggers 1. menu closed totaly app 2. window x button ignored , hide window. i'm using signal/slots how can know beingness triggered?. in closeevent : connect(ui->actionquit, signal(triggered()),this, slot(closewin())); void mainwindow::closewin() { close(); } // triggered ui->actionquit amd x button void mainwindow::closeevent(qcloseevent *event) { // how can know bean triggered? hide(); event->ignore(); } two solutions possible: connect menu item ( qaction ) signal separate slot , phone call qapp->quit() there use sender() method within slot determine object sent signal i prefer first one. c++ qt

Request to Amazon API with delphi : Got HTTP/1.1 403 Forbidden -

Request to Amazon API with delphi : Got HTTP/1.1 403 Forbidden - i not know code right or wrong. when seek run programme error occurs 403.. unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs,ssbase64, stdctrls,secutils,omnixmlutils,omnixml, xmldom, xmlintf, msxmldom, xmldoc, idbasecomponent, idcomponent, idtcpconnection, idtcpclient, idhttp,iduri; type tform1 = class(tform) button1: tbutton; memo1: tmemo; xmldocument1: txmldocument; idhttp1: tidhttp; memo2: tmemo; memo3: tmemo; procedure button1click(sender: tobject); private { private declarations } public { public declarations } end; var form1: tform1; implementation {$r *.dfm} function myencodeurl(source:string):string; var i:integer; begin result := ''; := 1 length(source) if not (source[i] in ['a'..'z','a'..'z','0','1'..'9','-...

php - Combining array elements into a single one, up to a certain point -

php - Combining array elements into a single one, up to a certain point - i'm building lifestream-esque sort of blog in php. fetches blog posts mysql database, tweets , last.fm scrobbles. so far good, i'd combine multiple subsequent scrobbles one. needs remain chronological, though, if blog post or tweet breaks chain of scrobbles, sec part of chain must not combined first part. array ( [0] => array ( [contents] => disturbed [type] => scrobble [published] => 1327695674 ) [1] => array ( [contents] => amon amarth [type] => scrobble [published] => 1327695461 ) [2] => array ( [contents] => apocalyptica [type] => scrobble [published] => 1327693094 ) [3] => array ( [contents] => tweet. really. [type] => tweet [publ...

sql - MySQL special INSERT/SELECT statement required for updating while copying rows in a table -

sql - MySQL special INSERT/SELECT statement required for updating while copying rows in a table - table a: column type, column type_id, column_owner, column_data1, column_data2, , on ----------- -------------- ------------ ------------ ------------ 'type a' 43 'owner sally' 'dfawerfd' 'yiyiyitit' 'type b' 51 'owner sally' 'hufvgdfd' 'weysdgjed' 'type c' 77 'owner sally' '3fdfsetr' '4tgfgert4' table b: column type, column type_id, column_owner ----------- -------------- ------------ 'type a' 43 'owner sally' 'type b' 51 'owner sally' 'type c' 77 'owner sally' 'type a' 100 'owner harry' ...

objective c - Iphone sdk, memory leak -

objective c - Iphone sdk, memory leak - im new objective-c. have problem memory leaking when developing iphone app. leaking utility in xcode shows leaking problem 'combarr'->'results' object. there function parsing json url , returns nsarray: - (nsarray *)getlisting2:(nsstring *)item from:(int)country { //sending post request params nsstring *post = [@"product=" stringbyappendingstring:item]; nsstring *countrystr = [nsstring stringwithformat:@"&country=%d", country]; post = [post stringbyappendingstring:countrystr]; nsdata *postdata = [post datausingencoding:nsutf8stringencoding allowlossyconversion:yes]; nsstring *postlength = [nsstring stringwithformat:@"%d", [postdata length]]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; nsstring *url = [prefs objectforkey:@"urltoapi...

How to use a DLL written in C# in other asp.net project? -

How to use a DLL written in C# in other asp.net project? - i have file named common.cs contains commonly used functions this public int getcolumnindexbynametemplatefield(gridviewrow row, string searchcolumnname) { int columnindex = 0; foreach (datacontrolfieldcell cell in row.cells) { if (cell.containingfield templatefield) { if (((templatefield)cell.containingfield).headertext.equals(searchcolumnname)) { break; } } columnindex++; } homecoming columnindex; } now want create common.cs file alter common.dll, created class library project in copied code common.cs file, added necessary references , built generate dll file, pasted dll file project debug directory bin directory of asp.net project using common.cs whenever seek import dll using. [dllimport("common.dll")] public static extern string newstring(string x); where newstring function, error. una...

python - Assign a variable value in an if or while statement -

python - Assign a variable value in an if or while statement - possible duplicate: is there way variable assignments straight within while(<here>) loop in python? sorry such basic question. i'm trying larn python, haven't found reply this. in python, can assign value variable in while or if statement? if so, how? for example. had this: line_list = [] while true: line = raw_input(">>> ") if not line: break line_list.append(line) print line_list but i'd this: line_list = [] while line = raw_input(">>> "): line_list.append(line) print line_list the tutorials i'm looking @ don't mention 1 way or another, mutual build in other languages. as frédéric's reply indicates, impossible assign variable while or if , can accomplish same thing using iter() function/sentinel phone call format: for line in iter(lambda: raw_input(">>>"), "...

c# - Get value from selected checkboxes (Checkbox array) -

c# - Get value from selected checkboxes (Checkbox array) - i have array of checkboxes, 33 in total. because checkboxes on page, needs in array (right?). the code-behind looks this: checkbox[] variablename = new checkbox[33]; variablename[0] = idcheckbox1; variablename[1] = idcheckbox1; variablename[2] = idcheckbox1; variablename[3] = idcheckbox1; and on... asp.net: <asp:checkbox id="idcheckbox1" runat="server" value="1" /> <asp:checkbox id="idcheckbox2" runat="server" value="2" /> ... the checkboxes totally optional. how value of checked boxes in variable? it not need array. how checked checkboxes in form codebehind: var names = formcollection.allkeys.where(c => c.startswith("idcheckbox") && formcollection.getvalue(c) != null && formcollection.getvalue(c).attempt...

c# - Changing Main Viewing Area -

c# - Changing Main Viewing Area - i'm wondering how go creating different views in main window when button pressed. i'm not sure of right terminology, has hampered google fu. i'm thinking main viewing area content control, alter when event happens. made little drawing help illustrate thought / thought. any input appreciated. thanks! it easy implement senario using mvvm approach.... make viewmodel mainview. define properties of viewmodels of usercontrols for illustration have 2 usercontrol firstview , secondview create properties in viewmodels viewtoloadproperty of type viewmodel (usually called viewmodelbase) set bindings <!-- panel hosting usercontrols --> <border grid.column="2"> <contentcontrol name="usercontrolcontentcontrol" content="{binding path=viewtoloadproperty, }"> ...

Android Facebook get email address of logged in through access token -

Android Facebook get email address of logged in through access token - in app, have allowed users signup through facebook. when user logged in, access token. want email address of user. how that? first of add together permission public static final string[] permissions = new string[] {"email"}; string response=authenticatedfacebook.request("me"); jsonobject obj = util.parsejson(response); useremail=obj.getstring("email"); where authenticatedfacebook facebook object. util available along facebook sdk. ensure gave email permission. android facebook email access-token

compiling error while building android source -

compiling error while building android source - iam trying build android source code next guide on android dev website. when "make" part, follow output. can help me resolve error? thx, frans frans@frans-laptop:~/android-platform$ sudo create ============================================ platform_version_codename=aosp platform_version=4.0.3.0.2.0.1.0 target_product=full target_build_variant=eng target_build_type=release target_build_apps= target_arch=arm target_arch_variant=armv7-a host_arch=x86 host_os=linux host_build_type=release build_id=openmaster out_dir=out ============================================ cts/bionic/libc/android.mk:570: warning: overriding commands target `out/target /product/generic/obj/lib/crtbegin_so.o' bionic/libc/android.mk:570: warning: ignoring old commands target `out/target/product/generic/obj/lib/crtbegin_so.o' cts/bionic/libc/android.mk:576: warning: overriding commands target `out/target/product/generic/obj/lib/crtend_s...

php - Best Way To Dynamically Achieve Offset and Limit Without Multiple Queries To The Database? -

php - Best Way To Dynamically Achieve Offset and Limit Without Multiple Queries To The Database? - i had lightbox 1 time opened fetched brands database in list. problem list can quite long split brands out lists of 10 , floated them left filled lightbox horizontally rather vertically since there around 40 brands. the initial problem code won't cover if suddenly, 10 brands added database since code doesn't business relationship them. the other problems sense disgusted myself having used multiple queries wondering if offer pointers how accomplish below bit more elegance , efficiency: $sql2 = "select page_id, name, url " . dbtable_sitemap ." parent_id=$frames , isactive=1 , isdeleted=0 order position asc limit 10"; $result2 = mysql_query($sql2, $db_conn); if (mysql_num_rows($result2) > 0) { echo '<ol class="subnav-glasses">'; while...

Rails: no such file to load -- action_dispatch -

Rails: no such file to load -- action_dispatch - i cannot start server, doesn't create sense. traced paths, found gems, install, uninstalled, re-installed, , nil seems work. installed on os x via rvm. here's stats: $ ruby /users/ross/.rvm/rubies/ruby-1.9.2-p180/bin/ruby $ rails /users/ross/.rvm/gems/ruby-1.9.2-p180/bin/rails $ gem /users/ross/.rvm/rubies/ruby-1.9.2-p180/bin/gem $ gem list *** local gems *** actionmailer (3.1.3) actionpack (3.1.3) activemodel (3.1.3) activerecord (3.1.3) activeresource (3.1.3) activesupport (3.1.3) arel (2.2.1) builder (3.0.0) bundler (1.0.21) erubis (2.7.0) hike (1.2.1) i18n (0.6.0) json (1.6.4) mail service (2.3.0) mime-types (1.17.2) multi_json (1.0.4) polyglot (0.3.3) rack (1.3.6) rack-cache (1.1) rack-mount (0.8.3) rack-ssl (1.3.2) rack-test (0.6.1) rails (3.1.3) railties (3.1.3) rake (0.9.2.2 ruby, 0.8.7) rdoc (3.12) rubygems-update (1.8.15) sprockets (2.0.3) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) tzinfo (0.3....

security - With HTTPS, are the URL and the request headers protected as the request body is? -

security - With HTTPS, are the URL and the request headers protected as the request body is? - just want verify, when making ssl connection (http post) say: https://www.example.com/some/path?customer_key=123123123 if don't want know customer_key, approach not work if making https connection correct? all info want secured has in request body right? quoting https rfc: when tls handshake has finished. client may initiate first http request. http info must sent tls "application data". essentially, secure ssl/tls channel established first. http protocol used. protect http traffic ssl, including http headers (which contain url , cookies). what may visible in handshake host name itself, since it's contained in server certificate visible in clear in handshake (and it's easy guess host name looking @ destination ip address anyway). when using server name indication, requested host name should visible in server_name extension in cli...

Rails 3.1.3 on Heroku: (No route matches [GET] "/assets/rails.png") -

Rails 3.1.3 on Heroku: (No route matches [GET] "/assets/rails.png") - i've installed few basic apps on heroku without problem, , 1 (rails 3.1.3) seemed fine in showed rails welcome page public/index.html.erb but when removed page , set root :to => 'users#index' i got problem. in heroku logs said there's routing error actioncontroller::routingerror (no route matches [get] "/assets/rails.png"): does know about? 2012-01-14t21:48:29+00:00 heroku[web.1]: process exited 2012-01-14t21:48:33+00:00 app[web.1]: >> lean web server (v1.2.6 codename crazy delicious) 2012-01-14t21:48:33+00:00 app[web.1]: >> maximum connections set 1024 2012-01-14t21:48:33+00:00 app[web.1]: >> listening on 0.0.0.0:32570, ctrl+c stop 2012-01-14t21:48:34+00:00 heroku[web.1]: state changed starting 2012-01-14t21:48:35+00:00 app[web.1]: cache: [get /] miss 2012-01-14t21:48:36+00:00 app[web.1]: 2012-01-14t21:48:36+00:00 app[web.1]: 201...

vb6 - How to get preivous month total count -

vb6 - How to get preivous month total count - i want previous month total day count code dim period string period = '01/2011' totdays = datediff("d", txtperiod, dateadd("m", 1, txtperiod)) 'this give totaldays of month... but want total days of previous month user type current month only, code should validate previous month expected output if period = '02/2011' means should display 31 days 'january if period = '03/2011' means should display 28 days 'february how this... any help this worked fine me. also, why have variable period , utilize txtperiod in calculations? dim dt date dim daysinmonth integer dt = cdate(txtperiod.text) dt = dateadd("m", -1, dt) daysinmonth = datediff("d", dt, dateadd("m", 1, dt)) vb6

html - Cutting an Image into pieces through Javascript -

html - Cutting an Image into pieces through Javascript - i creating simple jigsaw puzzle. in order this, need cutting image using 20 pieces. there way in javascript cutting image 20 equal pieces , save them 20 different objects within webpage? or have go photoshop , cutting each image out myself , phone call in? you can setting image background on div, setting background-position. same using css sprites. (assume pieces 100 x 100px) <div class="puzzle piece1"></div> <div class="puzzle piece2"></div> css: .puzzle { background-image:url(/images/puzzle.jpg); width:100px; height:100px; } .piece1 { background-position:0 0 } .piece2 { background-position:-100px -100px } javascript html html5

c# - Nunit SetupUpFixture syntax -

c# - Nunit SetupUpFixture syntax - what proper syntax utilize when trying implement setupfixture ability in nunit. have maintain getting error: namespace testing { [setupfixture, requiressta] public class setupclass { public ie cassite = new ie("awebsite"); [setup] public void setup() { } [teardown] public void teardown() { cassite.dispose(); } } [testfixture, requiressta] public class tests : setupclass { [test] public void dosomething() { } } } the error maintain receiving : failure: testfixturesetup failed in setupclass do have more 1 setupfixture defined namespace testing ? per docs, only 1 setupfixture should created in given namespace. your tests class derives setupfixture class. don't need that. setupfixture class' setup , teardown run automatically classes in namespace....

c++ - boost::bind or boost::lambda on std::lower_bound -

c++ - boost::bind or boost::lambda on std::lower_bound - suppose want utilize std::lower_bound on std::vector of pointers this: struct x { int x; double y; }; // overloads normal comparisons bool operator< (int left, const x& right) { homecoming left < right.x; } bool operator< (const x& left, int right) { homecoming left.x < right; } std::vector<x*> v; int searchvalue = 5; std::vector<x*>::iterator = std::lower_bound(v.begin(), v.end(), searchvalue, ? // heck set here? ); would utilize boost::bind or boost::lambda here, , if so, how? i think this: std::lower_bound(v.begin(), v.end(), searchvalue, searchvalue < *_1); however illegal indirection error on this. try following struct mylessthan { bool operator()( const x* xval, int ival ) { homecoming xval->x < ival; } }; std::vector<x*> v; int searchvalue = 5; std::vector<x*>::iterator = std::lower_bound(v.begin(), v.end...

multiprocessing - python Pool with worker Processes -

multiprocessing - python Pool with worker Processes - i trying utilize worker pool in python using process objects. each worker (a process) initialization (takes non-trivial amount of time), gets passed series of jobs (ideally using map() ), , returns something. no communication necessary beyond that. however, can't seem figure out how utilize map() utilize worker's compute() function. from multiprocessing import pool, process class worker(process): def __init__(self): print 'worker started' # initialization here super(worker, self).__init__() def compute(self, data): print 'computing things!' homecoming info * info if __name__ == '__main__': # works fine worker = worker() print worker.compute(3) # workers initialized fine pool = pool(processes = 4, initializer = worker) info = range(10) # how utilize worker pool? result = pool.map(c...

wcf - File Backup/Sync between two servers -

wcf - File Backup/Sync between two servers - we're using windows 2008 r2 servers , need backup file other server whenever file gets uploaded. unfortunately, client requires there no file/directory sharing between servers via lan trying via wcf calling wcf. we're having problem calling other wcf since they're hosted on ssl-secured website. calling wcf via silverlight works. questions: 1) might causing ssl/tls error when wcf calls other works fine silverlight calling wcf? code: public fileupload(fileuploadclass file) { // store locally ... // phone call other wcf if (!fileisexisting) { servicerefclient svcclient = new servicerefclient(); svcclient.fileuploadclass(file) } } 2) other way backup file other server securely apart using wcf , database (i'm trying database there prettier way this)? file/directory/drive sharing via local network prohibited. can give more details on exact error? meanwhile may wan...

php - Session variable is not working in MySQL statement -

php - Session variable is not working in MySQL statement - i trying utilize session variable( $_session['asc_id'] , holds value "as0027001") in sql statement, not working. when hardcode value, is providing results. can please right me. mysql query not working $asc_id = $_session['asc_id']; $rs = mysql_query('select asc_lastname, asc_firstname, asc_middlename, lname_fname_dob issio_asc_workers asc_user_type = 31 , asc_id = "$asc_id" , lname_fname_dob "' . mysql_real_escape_string($_request['term']) . '%" order lname_fname_dob asc limit 0,10', $dblink); mysql query working $rs = mysql_query('select asc_lastname, asc_firstname, asc_middlename, lname_fname_dob issio_asc_workers asc_user_type = 31 , asc_id = "as0027001" , lname_fname_...

terminal - Perl - using rsync from perl script -

terminal - Perl - using rsync from perl script - i'm having problem writing simple perl script can sync 2 folders. code is: my $string= "rsync -va ~/dropbox/music\ \(1\)/ ~/music/music/"; `$string`; i tried using line `rsync -va /dropbox/music\ \(1\)/ ~/music/music/;` next tried: my @args=("bash", "-c","rsync -va ~/dropbox/music\ \(1\)/ ~/music/music/"); system(@args);` i same error: sh: -c: line 0: syntax error near unexpected token `(' each time (yeah, spaces , parens in originating folder pain, don't yell @ me, didn't create it....) the problem actual shell command you're running is rsync -va ~/dropbox/music (1)/ ~/music/music/ because backslashes swallowed perl (since it, bash, uses backslash quoting/escape character). avoid this, need either utilize single-quotes: system 'rsync -va ~/dropbox/music\ \(1\)/ ~/music/music/'; or else re-escape backslashes: system ...

Building a SQL Query Builder Interface in C# -

Building a SQL Query Builder Interface in C# - i working on building sql interface deed interface able build sql queries many databases, including sqlite , mysql. as query string syntax differs between these 2 database types, think interface best workaround here. i want create sure each method (insert, createtable, readcolumn) has necessary arguments build working query works, , gives maximum functionality. currently have... public interface idatabase { bool createtable(sqltable table); bool altertable(sqltable from, sqltable to); bool updatevalue(string table, list<sqlvalue> values, list<sqlvalue> wheres); bool insertvalues(string table, list<sqlvalue> values); bool readcolumn(string table, list<sqlvalue> wheres); bool deleterow(string table, list<sqlvalue> wheres); } can suggest additions/edits should create interface create more functional? thanks twitchy what order , ...

ruby on rails - Rais - How to prevent deleting all children records of a parent -

ruby on rails - Rais - How to prevent deleting all children records of a parent - listing < ar has_many :images accepts_nested_attributes_for :images, :allow_destroy => true validate :validate_image_count def validate_image_count errors.add_to_base("too few") if images.length < 1 end end image < ar belongs_to :listing end in listing#edit form utilize fields_for provide fields images along checkboxes delete images. working fine. want enforce check such listing valid if had @ to the lowest degree 1 image , @ 6. in current setup can go edit , delete images, , update listing. i have tried using validation shown above thats not beingness called. way nested_attributes work in rails. whats best way enforce check? as images won't deleted when phone call validation method homecoming true on image length. can utilize marked_for_destruction? def validate_image_count errors.add_to_base("too few") self.images.any...

winforms - ticker and dataset datagrid view c# -

winforms - ticker and dataset datagrid view c# - i modified code, m still in trouble, it's fine. except when modify info xml file, application crash. should refresh datagridview when modify info xml file. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.xml.linq; using system.io; using system.threading; using system.reflection; namespace xml { public partial class form1 : form { dataset formbindingsource = null; public form1() { initializecomponent(); // formbindingsource = new dataset(); using (filestream stream1 = new filestream("c:\\sites.xml", filemode.open)) { formbindingsource.readxml(stream1); } this.updatedatagrid(); datagridview1.datasource = formbindingsource....

multithreading - All threads when running a java project -

multithreading - All threads when running a java project - i using visualvm monitor java program, started within eclipse. using quartz scheduler , have 2 worker threads, there 3 threads quartz. have thread running listening socket. have thread pool 50 threads. but shows there total 164 live threads 110 deamon threads. saw there datastreamer. java have thread handler info stream? i saw there many pesponseprocessor block blk_... threads response for, , witch kind of block point to? please note visualvm launch 5 threads of own rmi communication , serialization of thread dumps. can ignore those. java multithreading jvm visualvm

compilation - Is there a command to generate .cmo .cmx .cmi .mli together? -

compilation - Is there a command to generate .cmo .cmx .cmi .mli together? - i have .ml file, generate .cmo , .cmx , .cmi , .mli to the lowest degree commands possible, help? i don't think there's way generate these files @ once. .mli : ocamlc -i x.ml > x.mli .cmi : ocamlc x.mli .cmo : ocamlc -c x.ml .cmx : ocamlopt -c x.ml if can without .mli file, can generate .cmi , .cmo files ocamlc -c . otherwise think you'll have generate files 1 @ time. note there .o file every .cmx file; work pair. compilation ocaml

javascript - jquery, save entire DOM for reloading -

javascript - jquery, save entire DOM for reloading - <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(function(){ var xml = '<?xml version="1.0"?><foo><bar>bar</bar></foo>'; document.open("text/xml", "replace"); document.write(xml); document.execcommand('saveas',true,'file.xml'); }); </script> </head> <body> </body> </html> this html-file generates xml file (in ie) , creates "save as" dialog. however, reset document previous state (before "replace") after have saved file. possible using pure javascript or jquery? thanks...

python - ManyToManyField with through on an abstract model -

python - ManyToManyField with through on an abstract model - got interesting 1 here.. i've shortened models create easier comprehend.. class participant(person): passport_number = models.integerfield(verbose_name=_('passport number'), db_column=u'passportnumber') class meta: db_table = u'participant' class journey(basemodel): participants = models.manytomanyfield(participant, related_name='%(app_label)s_%(class)s_participants', through=u'participantjourney') class meta: abstract = true class planejourney(journey): flight_number = models.charfield(max_length=16, verbose_name=_('flight number'), db_column=u'flightnumber') class meta: db_table = u'planejourney' class participantjourney(basemodel): participant = models.foreignkey(participant, verbose_name=_('participant'), db_column=u'participantid') journey_content_type = models.foreig...

java me - How can I Dispose Dialog box From LWUIT Component -

java me - How can I Dispose Dialog box From LWUIT Component - i developing 1 project using lwuit, midlet mobile application. when press number keys dialog box open. when press keys #,0,* dialog should close. using dialog.dispose() method close dialog. not working. below code. can tell me problem in code? public class javaform extends component implements actionlistener { dialog d=new dialog(); public void keypressed(int key){ system.out.println("key pressed :"+key); switch(key) { case 48: d.show(130,20,30,30,true); break; case 49: d.show(130,20,30,30,true); break; case 50: d.show(130,20,30,30,true); break; case 51: d.show(130,20,30,30,true); break; case 52: d.show(130,20,30,30,true); br...

javascript - jsp formatting with a left over comma -

javascript - jsp formatting with a left over comma - good afternoon, trying display list of items in table column separated "," the current formatting have comma displayed after credit card, there comma left on after lastly card, if there no eft payment. i've attached screenshot of problem.. here code: <%if (creditcards.size() > 0) {%> <% (creditcardpaymentvo card : creditcards) {%> <%= card.gettype()%> , <%}%> <%}%> <% if (eft != null) {%> <%= "eft"%> <%} %> any thought how can create comma not appear after lastly credit card? time , effort! scriptlets aren't cool anymore. seek jstl: <c:foreach var="creditcard" items="${creditcards}" varstatus="status"> <c:out value="${creditcard.type}"/> <c:if test="${!status.last || eft}">, </c:if> </c:foreach> <c:if test="${eft}">ef...

c# - Unloading a UserControl -

c# - Unloading a UserControl - there must simple way of unloading usercontrol display without using visibilty, in theory it's not unloaded. what solutions there? you can utilize usercontrol.dispose() documented here: http://msdn.microsoft.com/en-us/library/3cc9y48w.aspx c# wpf

HTTP iframe on HTTPS page -

HTTP iframe on HTTPS page - i have simple question, can't find reply i'm looking for. is http iframe that's loaded on secure https page secured? it not automatically, should verify if src of iframe connecting via https or not: <iframe src="http://www.example.com"></iframe> your iframe doesn't extend https access principal page. http iframe https

javascript - Manipulating the slider - the circle disappears -

javascript - Manipulating the slider - the circle disappears - manipulating slider until end, circle represents star disappears or different motion. see: jsfiddle.net/nxnxj/13 unlike this: astro.unl.edu/naap/hr/animations/hrexplorer.html can help me?? thanks when supply big luminosity, you're rendering circle millions of pixels tall. broswer might not render because it's big. however, interested in little piece of big circle - namely, bit fits in tiny window. @ point, doesn't create sense increment size of circle, since can't observe alter in curvature of circle - looks straight vertical line. this apparent verticality occurs around when x^2 + y^2 = r^2, r radius of star, y half height of window, , x r-1. solve r in terms of y, , get function maximumnecessaryradius(windowheight){ y = windowheight / 2; maxradius = (y*y - 1)/2; homecoming math.round(maxradius); } when resizing star, check create sure radius doesn't exceed maxim...

wpf - Add struct to Combobox and display struct member as selected item -

wpf - Add struct to Combobox and display struct member as selected item - i got simple struct private struct _config { public string name; public int id; } i want add together combobox show name displayed name in combobox. know how this? i highly suggest reading links hb posted, here's code you're looking work towards: change combobox items have get/set accessor methods: private struct config { public string name { get; set; } public int id { get; set; } } then combobox xaml should this <combobox x:name="mycombobox" displaymemberpath="name" /> wpf combobox struct

servlets - java.io.FileNotFoundException at org.apache.naming.resources.DirContextURLConnection.getInputStream -

servlets - java.io.FileNotFoundException at org.apache.naming.resources.DirContextURLConnection.getInputStream - i working jsf 2.0, tomcat 7.0, eclipse 3.0. until couple days ago, web application doing fine. when started , tried login, servlet throws error: severe: servlet.service() servlet [faces servlet] in context path [/app] threw exception java.io.filenotfoundexception @ org.apache.naming.resources.dircontexturlconnection.getinputstream(dircontexturlconnection.java:381) @ com.sun.faces.facelets.impl.defaultfaceletcache._getlastmodified(defaultfaceletcache.java:161) @ com.sun.faces.facelets.impl.defaultfaceletcache.access$000(defaultfaceletcache.java:62) @ com.sun.faces.facelets.impl.defaultfaceletcache$1.newinstance(defaultfaceletcache.java:82) @ com.sun.faces.facelets.impl.defaultfaceletcache$1.newinstance(defaultfaceletcache.java:79) @ com.sun.faces.util.expiringconcurrentcache$1.call(expiringconcurrentcache.java:99) @ java.util.concurrent.fut...

android - Run application in emulator? -

android - Run application in emulator? - when i'm going run application new emulator starts, despite have emulator opened! since time load , launch emulator long, isn't there way run application in emulator opened? thanks! you can set property of ur app manual rather automatic run application.. just right click on app, run->runconfiguration->target->manual so doing this, whenever run ur application,it first inquire @ emulator,you want ur application run.. thanks.. android

How do i disable the pasting of tables in tinyMCE -

How do i disable the pasting of tables in tinyMCE - i'm using on tinymce on site, , don't want users able utilize tables. disabled table plugin, can still paste tables. how disable them completely? use valid_elements configuration section, , remove table, tablehead, td etc. elements default valid elements string. table tinymce paste

mouse coordinates in javascript? -

mouse coordinates in javascript? - i created little function mouse coordinates in div somehow not working. checked function thoroughly didn't find bug. <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> <script type="text/javascript"> function setvalues() { var s = "x:" + window.event.clientx + " y:" + window.event.clienty ; document.getelementbyid('divcoord').innerhtml = s; } </script> </head> <body onmousemove=setvalues()> <div id="divcoord"></div> </body> </html> the window.event property nowadays in net explorer, , in versions think. in fact, entire operation trying requires advanced cross-browser coding. i suggest consider using javascript framework normalizes events, such jquery. using jquery, , work in ...

java - On Void return type -

java - On Void return type - if 1 needs homecoming void type, javadoc describes a class uninstantiable placeholder class hold reference class object representing java keyword void. why next still require null returned? public void blah() { homecoming null; // seems want null } void class other, function returning void has homecoming reference (such null ). in fact, void final , uninstantiable, means null thing function returning void return. of course of study public void blah() {...} (with lowercase v ) doesn't have homecoming anything. if you're wondering possible uses void , see uses java void reference type? java void

html - How to get value of multiple-file input on change with jQuery? -

html - How to get value of multiple-file input on change with jQuery? - to value of <input type="file" name="upload"> jquery, utilize $('input').val() . however, using same method value of <input type="file" name="upload[]" multiple> (multiple-file input) returns 1 file, not of them. is there different way this? i used code post... $('input[type=file]').val() ..and added id of each specific file input field. code below gets path input, pulls filename , shows value in different field 2 different file upload fields. if had ton of them, create loop based on code: $('#file1').change(function(){ // when leave file1 form field var filename1 = $('input[type=file][id=file1]').val().split('\\').pop(); // filename $('#dl_filename1').val(filename1); // , place in dl_filename1 box }); // end alter $('#file2').change(function(){ // when leave file2 form fie...

php - how to add dynamic image to td background image? -

php - how to add dynamic image to td background image? - in code want add together $image variable td background dont know if add together between quotes without problems..or delete quotes..and how youtube video..thanks helping <table width="130" height="97"> <tbody><tr> <td valign="center" width="130" align="center" background="showvideo.php_files/2_003.jpg" height="97"> <a href="http://www.mysite.com/video/watch.php?vdcid=42608"> <img src="showvideo.php_files/play_arrow.gif" alt=" theme song " border="0"> </a> </td> </tr> </tbody></table> there go: <td valign="center" width="130" align="center" background="<?php echo $image; ?>" height="97"></td> php

authorization - ASP.NET: Own implementation of IsInRole -

authorization - ASP.NET: Own implementation of IsInRole - sorry english. is possible override logic isinrole in asp.net? utilize own tables of roles in database , know how utilize own logic. something inheriting principialbase. maybe know ways? i utilize roleprovider if using other aspects of asp.net authentication , authorization management. however, if have own database storing role info , have ui managing user roles, can away creating genericprincipal roles , replacing httpcontext.current.user during postauthenticaterequest (for asp.net). mvc different, depending on how managing authorization. here related question. application role management in asp.net mvc (how)? it improve load roles user 1 time per request check roles against database multiple times during request. asp.net authorization roles

ruby on rails - How do I assign styling to a Javascript variable? -

ruby on rails - How do I assign styling to a Javascript variable? - i have simple, dynamic email form field. after user submits email, receive message 'got it!'. need string "got it!" have same styling <p> tag in css.. don't know how assign properties in javascript, , other part of code in ruby , don't know either. it's simple fix, can't find answer! here javascript: var finaltext = 'got it!'; // create new div contain our give thanks stuff var thankyoudiv = document.createelement("div"); thankyoudiv.id = "home_thankyou"; thankyoudiv.innerhtml = finaltext; // store reference formm var form = document.getelementsbytagname("form")[0]; // add together new thankyoudiv before form form.parentnode.insertbefore( thankyoudiv, form ); // remove form tag alltogether form.parentnode.removechild(form); and here html/ruby code: <%= form_for :home, :remote=>true, :update=>"ema...

Importing products via csv file in Android Market -

Importing products via csv file in Android Market - i trying import csv file: "45098","published","managed_by_android","false","ru_ru; Гениальность и помешательство; Вы собираетесь приобрести эту аудиокнигу. Приятного прослушивания!","false","ru; 1000000" "45105","published","managed_by_android","false","ru_ru; Старое житье; Вы собираетесь приобрести эту аудиокнигу. Приятного прослушивания!","false","ru; 1100000" "52608","published","managed_by_android","false","ru_ru; Этруски: тайные страницы европейской истории; Вы собираетесь приобрести эту аудиокнигу. Приятного прослушивания!","false","ru; 1200000" "52911","published","managed_by_android","false","ru_ru; Иван Грозный; Вы собираетесь приобрести эту аудиокнигу. Приятного прос...

I want to add satalite map to java swing application using JXMapKit -

I want to add satalite map to java swing application using JXMapKit - peace upon all i want create java application contain map , controlling map i mad of have problem i used jxmapkit.class i showing map on application , controlling want the problem me want alter map server i not want utilize openstreet map that , want utilize map satellite map or map more clear i not know how create :( i trying link : http://today.java.net/pub/a/today/2007/11/13/mapping-mashups-with-jxmapviewer.html but tired spend lot of time making , did not achieved want any 1 know bout ? java map swingx

Search Music files by tag in Android -

Search Music files by tag in Android - i'm looking build android app(for learning) searches music files in android system, based on id3 tags embedded within file. please give me pointers? please sense free correct/seek clarification if question incomplete/unclear/not specific enough. thanks, debojit check out jaudiotagger: http://www.jthink.net/jaudiotagger/ i guess have stumbled upon mediastore part of android api: http://developer.android.com/reference/android/provider/mediastore.html android

.net - 2 Problems with Enabling Editable DataGridViewComboBox (not data bound) in c# -

.net - 2 Problems with Enabling Editable DataGridViewComboBox (not data bound) in c# - i new c#, , stuck. seek concise. i have combobox (in same column) in datagridview, , want users able type in combobox. got semi-work... *problem 1: when type in it, though typed added list of selections in drop down, combobox goes blank , have re-select value entered. how can create value type stays selection , not go blank. *problem 2: there way can create combobox not editable in same column? code seems create of combobox user editable. how can create combobox exceptions? thanks in advance, much, if help! here codes: private void dm_dgview_add_editingcontrolshowing(object sender, datagridvieweditingcontrolshowingeventargs e) { if (e.control.gettype() == typeof(datagridviewcomboboxeditingcontrol)) { datagridviewcomboboxeditingcontrol combo = e.control datagridviewcomboboxeditingcontrol; combo.dropdownstyle = co...

java - "org.apache.cxf.interceptor.Fault: null while invoking" exception resolution please? I cannot find a reason for this. (logs attached) -

java - "org.apache.cxf.interceptor.Fault: null while invoking" exception resolution please? I cannot find a reason for this. (logs attached) - while consuming soap service, getting error. dun reason. works fine invoking services methods no arguments. not getting why parameters not passed when seek invoke method parameters. message soap 1.1 my soap message is: <?xml version="1.0" encoding="utf-8"?> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/xmlschema-instance" <s:header/> <s:body> <ns2:addperson xmlns:ns2="http://service.accounting.cassit.com/"> <fname xsi:type="xsd:string">vbn</fname> <lname xsi:type="xsd:string">yyyy</lname> <gender xsi:type="xsd:string">879</gender> <age xsi:type=...