Posts

Showing posts from August, 2014

Stuck in a nested loop while using JMeter. Nested loop controller and CSV data set config. -

on site have 2 merchant actions: search , browse. search triggers 3 browses. i have jmeter test uses csv file of merchants , merchant id numbers, when running test @ scale want merchants on site used. i have mapped in jmeter so: loop controller http sampler (search /search/${merchant_name}) csv data set config (merchant name) loop controller http sampler (browse /merchant/${merchant_id}) csv data set config (merchant id) i set loop count = 2 in outer loop , loop count = 3 in inner loop. i expect 2 searches trigger 6 browse actions. search, followed 3 browses, continually until abort test. have misunderstood loop construct? expected behaviour? how can achieve goal of running search, followed 3 browses, twice? i think you're misusing csv data set configuration. i've got scenario working follows: given following csv files: merchants.csv containing: merchant1name merchant2name and 2 other csv files: merchant1name.csv , merc...

.net - Silverlight System.Security.VerifictionException after Branching in VS -

i verificationexception after branching solution. folderstructure ordered this: - dev - -- main - releases - -- v1.x.x - -- ... if build & start solution in dev/main branch works fine. after branching solution in release/v.1.x.x , starting here get: system.security.verificatonexception: operation destabilize runtime. i have read kinds of posts dealing exception nothing helped. some background information: .net 4.0, visualstudio2012, silverlight 5, infragistics library i found problem. nevertheless thank research. in main application there 2 silverlight applications refers assembly system.windows.interactivity in 2 different paths 2 different versions. :(

c# - Error when building on server: Retrieving the COM class factory for component with CLSID -

i'm using visual studio 2013. in program create excel document. works fine, when try build solution on build server , server throws exception: result:system.runtime.interopservices.comexception (0x80040154): retrieving com class factory component clsid {00024500-0000-0000-c000-000000000046} failed due following error: 80040154 class not registered (exception hresult: 0x80040154 (regdb_e_classnotreg)). @ system.runtimetypehandle.createinstance(runtimetype type, boolean publiconly, boolean nocheck, boolean& canbecached, runtimemethodhandleinternal& ctor, boolean& bneedsecuritycheck) @ system.runtimetype.createinstanceslow(boolean publiconly, boolean skipcheckthis, boolean fillcache, stackcrawlmark& stackmark) @ system.runtimetype.createinstancedefaultctor(boolean publiconly, boolean skipcheckthis, boolean fillcache, stackcrawlmark& stackmark) @ system.activator.createinstance(type type, boolean nonpublic) @ system.activator.createinstance(type type) @ auto...

html - Arranging text and image in the same line -

this question has been answered many times, none of solutions work problem. have text , image aligned linearly (in single line) i have http://grab.by/vlz2 , http://grab.by/vlz8 could please help? you need make sure image height same font-size. .title{ position:absolute; height: 15%; width:100%; } #wrapper{ position:absolute; width:80%; height:50%; border: solid 1px black; } #title4{ font-size:20px; } <!-- html part --> <div class="title" id="title4"> title <img src="https://www.google.com/images/srpr/logo11w.png" style="height:20px;vertical-align:top;"/> </div> check jsfiddle

php - How can I convert these two queries in a loop into a single JOINed query? -

i trying data table (mostkills weapon in table on 300 kills). did normal query $q = $mysql->query("select * `kills`") or die($mysql->error); but when tried $query2 = $mysql->query("select `killerid`, count(`killerid`) tot_kills `kills` `killtext` '%$gun%' group `killerid` order `tot_kills` desc;") or die($mysql->error); $kdata = $query2->fetch_assoc(); $query3 = $mysql->query("select `username` `players` `id` = '" . $kdata['killerid'] . "'") or die($mysql->error); $udata = $query3->fetch_assoc(); $array[$gun]['kills']++; $array[$gun]['gun'] = $gun; $array[$gun]['bestkiller'] = $udata['username']; $array[$gun]['killamount'] = $kdata['tot_kills']; function sortbykills($a, $b) { return $b['kills'] - $a['kill...

javascript - ui select 2 selected value doesnt change - angularjs -

Image
i m using ui.select2 dropdowns scenario have ajax call return drop down values document.dropdowndocstatuses = [ { key: 0, value: 'all active (' + response.totaldocuments + ')' }, { key: 1, value: 'draft (' + response.draft + ')' } ]; in html have <select ui-select2 class="form-control font-12px input-style3 " ng-model="document.dropdowndocstatus" ng-change="document.filterdocuments()"> <option ng-repeat="documents in document.dropdowndocstatuses" value="{{documents.key}}">({{documents.value}})</option> </select> user have selected value issue when update value of dropdown using _document.dropdowndocstatuses[_document.dropdowndocstatus].value++; _document.dropdowndocstatuses[1].value++; valuge gets updated doesnt change selected value text whereas if click on dropdown changed value in dr...

Scala Spray Can: how to use a custom server pipeline? -

i starting spray-can web server " io(http) ! http.bind(self) "; appears spray server hardcoded use default pipeline, hidden away inside io(http) . i'm using spray 1.3.0 there page in spray related documentation describes server pipeline , , has section "creating pipeline stages" (although looks like). however, if create custom pipeline stage, how can spray can server use it? as far can see code, server hardcoded use default pipeline -- in spray.can.server.httplistener private pipelinestage val set static call httpserverconnection.pipelinestage , allows no customisation of standard pipeline setup. my specific use-case turn on "requestchunkaggregation" urls not others. i can override pipeline "monkey patching" approach of defining classes same qualified names spray internal classes in codebase , rely on linker load them first, there less hacky way of customising spray can pipeline? creating pipeline stages http clients...

collision - C++ DirectX11 2d Game: Stopping enemy sprites moving over each other? -

i using intersectswith(this->boundingbox)) method detect collisions between sprites , player. want somehow able use method in detecting enemy sprites collide each other, , when make sure don't move on 1 another. all of enemy sprites follow player. maingame.cpp loops on each enemy in vector , update loop: for (auto &enemymobsobj : this->enemymobs) { enemymobsobj->update(ticktotal, tickdelta, timetotal, timedelta, windowbounds, this->ship, this->firstboss, this->enemymobs, this->bullets, this->missiles, null, "null", "null"); } here tried before stop each sprite moving on each other: enemymobone::update: int nextenemy; (int = 0; < enemymobone.size(); i++) { nextenemy = + 1; if (nextenemy < enemymobone.size()) { //deal mobs collision if (enemymobone[i].boundingbox.intersectswith(enemymobone[nextenemy].boundingbox...

Javascript: Regex to escape parentheses and spaces -

looking backslash escape parentheses , spaces in javascript string. i have string: (some string) , , need \(some\ string\) right now, i'm doing this: x = '(some string)' x.replace('(','\\(') x.replace(')','\\)') x.replace(' ','\\ ') that works, it's ugly. there cleaner way go it? you can this: x.replace(/(?=[() ])/g, '\\'); (?=...) lookahead assertion , means 'followed by' [() ] character class.

php - function similar to move_uploaded_file() in Javascript -

hello had written code upload file. wanted write similar condition move_uploaded_file() in javasript/jquery code or otherwise tell me how pass value javascript/jquery can insert image file in those <li> via insertimage() . upload.php <?php $name = $_files['file']['name']; $tmp_name = $_files['file']['tmp_name']; if(isset($name)) { if(!empty($name)) { $location ='images/'; if(move_uploaded_file($tmp_name, $location.$name)) {`echo '<table width="50%" border="0" cellpadding="4" cellspacing="0">';` echo '<tr>'; echo '</tr><tr>'; echo '<td align="center"><img src="images/'.$name.'" alt="resized image"></td>'; echo '</tr>'; echo '</table>'; echo "uploaded!!"; } else { echo "please choose file"; } } jquery code ...

php - Outputting contents of database mysqli -

hi know little general cant seem work out reading online. im trying connnect database using php / mysqli using wamp server , database local host on php admin. no matter try keep getting error warning: mysqli_fetch_array() expects parameter 1 mysqli_result , boolean given when try output contents of database. the code im using is: if (isset($_post["submit"])) { $con = mysqli_connect("localhost"); if ($con == true) { echo "database connection established"; } else { die("unable connect database"); } $result = mysqli_query($con,"select *"); while($row = mysqli_fetch_array($result)) { echo $row['login']; } } the best way go , check these links out. http://php.net/manual/en/index.php

javascript - Is there a performance difference between SVG attributes and styles? -

i'm working large svg particle animation involve lots of little elements. 1000. browsers seem struggle when animate many elements, i'm looking ways optimize code better, smoother performance (especially firefix). my main question whether there difference between, example, setting element's stroke property attribute, or as style: <circle r="0.15" cx="84" cy="782" stroke-width="6" stroke="transparent" style="fill: #ffffff;"></circle> vs <circle r="0.15" cx="84" cy="782" stroke-width="6" stroke="transparent" style="stroke:transparent; stroke-width:6; fill: #ffffff;"></circle> i'm using d3.js add bunch of these , make them move around... , 1000 appears limit before things clunky in chrome. firefox worse. if have other performance suggestions they're welcome. update request: here how create nodes: var make...

c# - how can I draw a triangle of asterisks using the while statement? -

Image
here (not working code) , should print shape below not : static void main(string[] args) { int = 1; int k = 5; int h = 1; while (i <= 5) { console.writeline(""); while (k > i) { console.write(" "); k--; } while (h <= i) { console.write("**"); h++; } i++; } console.readline(); } but when try same using while statement shape gets totally messed up. any ? you have declare k , h within loop: static void main(string[] args) { int = 1; while (i <= 5) { int k = 5; int h = 1; console.writeline(""); while (k > i) { console.write(" "); k--; } while (h <= i) { console.write("**"); h++; } i++; } console.readlin...

python - SQLAlchemy - how to get all records that are within 1 minute and the same minute of the latest record? -

my table has datetime column records when row updated; call col_datetime. need row latest datetime in col_datetime , other records within minute of record , have same minute. example: pk | first | col_datetime 1 dave 2014-03-23 8:23:57 2 dan 2014-03-23 8:22:59 3 teresa 2014-03-23 8:23:01 4 marge 2013-03-23 8:23:08 in case, i'd need query return rows 1 , 3 (even though row 2 within 1 minute of record #1, not same minute. likewise, row #4 has same minute year earlier). my attempt in mysql returns row #1 (though need solution sqlalchemy): select * (select * `mytable` order col_datetime desc limit 1) sub col_datetime >= sub.col_datetime - interval 1 minute , extract(minute col_datetime) = extract(minute sub.col_datetime) i appreciate help! this sql query return correct data: select * foo; +----+--------+---------------------+ | id | name | col_date | +----+--------+---------------------+...

How do I find all permutations from a matrix with one value per column in Matlab? -

i'm new matlab (and programming in general) , can't figure out how this. perhaps quite simple, use help. i've got matrix: 25 53 52 25 37 26 54 0 26 38 27 55 0 27 0 28 56 0 28 0 0 59 0 0 0 0 60 0 0 0 i compute different combinations, in terms of rows 1 value each column, like, 25,53,52,25,37 , 25,54,52,26,38 , 25,54,52,27,0 etc. besides, want discard combinations containing 0 (like 25,53,0,25,37). take @ function , allcombo([25:28],[53:56 59:60],52,[25:28],[37:38]) should looking for.

model - rails application undefined method for class -

i rewrote create function in scaffold review after making associated concert model. when try submit form create review though error saying undefined method `reviews' #class:0xab9972c> def create @review = concert.reviews.create(review_params) end my concert model looks class concert < activerecord::base validates_presence_of :artist validates_presence_of :venue validates_presence_of :date has_many :reviews end and review model looks this class review < activerecord::base validates_presence_of :artist validates_presence_of :venue validates_presence_of :date belongs_to :user belongs_to :concert end i added relations within migration files still error. can explain me causing , how go creating review belongs concert? the association has_many :reviews instance method. suspect in create method want this: def create @concert = concert.new @concert.save @review = @concert.reviews.create(review_params) end ...

bioinformatics - What is the typical size of the sequence files while conducting pairwise sequence alignments? -

what typical size of sequence files while conducting pairwise sequence alignments? can align whole genome of organisms? there 2 types of pairwise sequence alignments, local , global. local pairwise alignment trying locate parts of 2 sequences similar. there not typical sequence size since there huge variation. humans 10-15kb (10000-15000 base pairs), according this: http://bionumbers.hms.harvard.edu/bionumber.aspx?&id=104316&ver=1 . in case of global alignment, attempt align residues of 2 sequences. using global alignment methods, can align whole genome of organisms has use in case of closely related organisms, genome has not diverged lot. example of how can done, see this: http://genomewiki.ucsc.edu/index.php/whole_genome_alignment_howto also, describes multiple whole genome alignments can more useful: http://www.ncbi.nlm.nih.gov/pmc/articles/pmc3157923/

linux - Should I see email on port 25 with netcat? -

assuming have domain forwarded box (i.e., can see webpage on box outside world) if use netcat listen on ports ssh session: nc -l 587 nc -l 25 and send mail server user@mydomain.com i should see beginning of handshake in send attempts? know isp not block port 25 because can see browser header netcat if go http://mydomain.com:25 tons of things going wrong: 1) smtp requires server talk first, email sender waiting server something. 2) if you're not running valid mail server, email senders may mark host unresponsive , backoff several hours before retrying. 3) if changed dns, may take hours/days propagate. (not respects ttl, low ones.) 4) servers configured drop mail if source or destination spf isn't set properly. (to encourage use spf.) try adding spf record. (and make sure mx record correct.)

python - Shortened URLs need randomising -

i have following code working correctly. 3 urls shortened put content of 3 different tweets submitted twitter. each time url shortened shortened url same. because of tweets keep being caught twitter spam filter. is there way randomise appearance of shortened urls stop happening, either using import tinyurl or other method entirely? import simplejson import httplib2 import twitter import tinyurl print("python attempt submit tweets twitter...") try: api = twitter.api(consumer_key='', consumer_secret='', access_token_key='', access_token_secret='') u in tinyurl.create('http://audiotechracy.blogspot.co.uk/2014/03/reviewing-synapse-antidote-rack.html', 'http://audiotechracy.blogspot.co.uk/2014/03/free-guitar-patches-for-propellerhead.html', 'http://audiotechracy.blogspot.co.uk/2014/02/get-free-prop...

php - preg_replace() only replace spaces, symbols with a hyphen -

how replace letters , numbers hyphen? slug url person type in string url. problem i’m having people inputting symbols , many spaces make url invalid. also, resource test don’t have ask again? thanks. the code $input_url = "this example: it?"; $slug_url = preg_replace("/[^a-za-z0-9]/", "-", $input_url); print($slug_url); will output this-is-only-an-example--do-you-like-it- demo

java - Why replaceAll("*.<td>","<tr><td>Myval"); got error? -

i got string s="<tr><td>myval"; i want replace strings before "<td>" & include "<td>" "" ; s=replaceall("*.<td>",s); so result should s="myval" got runtime error. 12:39:31.035 [error] uncaught exception escaped java.util.regex.patternsyntaxexception: dangling meta character '*' near index 0 *.<td> how fix? in regular expressions, * quantifies expression coming before it. here, you've put * @ beginning of pattern, meaningless. maybe wanted ".*<td>" .

javascript - Loading jQuery with Dojo AMD loader Issue -

i trying load jquery using dojo amd. working fine when use jquery cdn path below code. <script type="text/javascript" src="widgetdownloadtest/lib/dojo/dojo/dojo.js" data-dojo-config="async: true, packages: [ { name: 'jquery', location: 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1', main: 'jquery' } ]"> </script> however if change jquery path local machine (absolute path) . jquery libaries(jquery-1.10.2.js,jquery-ui-1.10.4.custom.js,jquery-ui-1.10.4.custom.min.js) placed in folders 'jquery/1.7.1' <script type="text/javascript" src="widgetdownloadtest/lib/dojo/dojo/dojo.js" data-dojo-config="async: true, packages: [ { name: 'jquery', location: 'jquery/1.7.1', main: 'jquery' } ]"> </script> please me on this. in advance. pradeep scripts mentioned in 'location' should relative 'dojo.js' folder (in case: widg...

linux - wormhole attack in ns2 using aodv protocol -

i trying implement wormhole attack in ns2 using aodv....i started project , not able build tunnel using packet encapsulation.. know 1 has implemented using packet encapsulation.... have looked around internet source code on this, have found none. know find source code wormhole sensor attacks (for simulation purposes) or wormhole detection? on issue appreciated. looking forward help, shreyas

Security- decrypting in java "BadPaddingException" -

i'm encrypting strings , writing them text file. in order decrypt content, i'm reading file , print decrypted data. when tested code 1 string value, encrypted , decrypted fine; however, when added more strings encrypt, encryption worked fine decryption gave me exception "javax.crypto.badpaddingexception: given final block not padded " this code. please help! // these initialized in main secretkey key = keygenerator.getinstance("des").generatekey(); algorithmparameterspec paramspec = new ivparameterspec(iv); ecipher = cipher.getinstance("des/cbc/pkcs5padding"); dcipher = cipher.getinstance("des/cbc/pkcs5padding"); ecipher.init(cipher.encrypt_mode, key, paramspec); dcipher.init(cipher.decrypt_mode, key, paramspec); // catches .. // take string , file have encrypted strings private static void encrypt(string s, outputstream os) throws illegalblocksizeexception, badpaddingex...

android - How to set images id dynamically in integer array -

here code, have 100 images , want create dynamic using loop it's not working. int[] imgids = {r.drawable.img1, r.drawable.img2, r.drawable.img3}; try using getresources().getidentifier create array of drawable id's if drawables name img1,img2,img3,.. int[] imgids = new int [100]; int imagecount=1; for(int i=0;i<100;i++){ imgids[i]=getresources().getidentifier("img"+imagecount, "drawable", getpackagename()); imagecount++; }

python - how to show the plot in pyplot -

i receiving following error code, how can solve it: from numpy import * import matplotlib mpl mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt mpl.rcparams['legend.fontsize'] = 15 fig = plt.figure () ax = fig.gca(projection='3d') t = linspace (-2, 2, 100) x = (1 + t**2) * sin(2 * pi * t) y = (1 + t**2) * cos(2 * pi * t) z = t ax.plot(x, y, z, label='parametric 3d curve') ax.legend() show() error: traceback (most recent call last): file "/home/me/workspace/mysecondpythontest/my1pythontest", line 19, in show() nameerror: name 'show' not defined show() not exist. you need call plt.show()

c - purpose of comparing pointer with (unsigned) -4000L -

in open source component, cjson , #define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000l) above statement used check validity of pointer shown below json_object* reply = json_object_new_object(); if (!reply || is_error(reply)) { . . . //error handling } how comparing pointer (unsigned long)-4000l validates pointer? the reason looks they're using pointer value contain "either pointer or error value". look here : struct json_object* json_tokener_parse(const char *str) { struct json_tokener* tok; struct json_object* obj; tok = json_tokener_new(); obj = json_tokener_parse_ex(tok, str, -1); if(tok->err != json_tokener_success) obj = error_ptr(-tok->err); // <<<<<--- json_tokener_free(tok); return obj; } the function returning special value pointer. err_ptr macro returns negative of error code, presumably because author assumes never valid pointer address. here test demonstrates expected usa...

Rails, uploading a file using only file_field -

i need upload file in rails without gems, decided use <%= file_field 'upload', 'datafile' %></p> without form , etc. file_field , in controller tried catch name = params[:upload][:datafile].original_filename it shows me error: undefined method `original_filename' "me.jpg":string my params: "upload"=>{"datafile"=>"me.jpg"} it seems cannot use file_field alone without form, can i? or should alway include form? if yes, possible without using form? please verify have added multipart: true option in form_tag or not. syntax:- <%= form_tag '/upload', multipart: true %> <label for="file">file upload</label> <%= file_field_tag "file" %> <%= submit_tag %> <% end %>

How to connect with pervasive database via php -

i need know how can connect pervasive database via php. as know, have use odbc . configured on windows 7 system , created table in pervasive server. this code, not work: $connect_string = "driver={pervasive odbc client interface}; servername=localhost; serverdsn=demodata;"; $conn = odbc_connect($connect_string, 'root', 'root'); use connection string: $connect=odbc_connect("driver={pervasive odbc engine interface};servername=localhost;serverdsn=dsnname;", "username", "password", sql_cur_use_odbc);

java - Linking Sources of two Identical Projects -

hello making game both computer , android devices , wondering if there way link 2 projects type code once , have saved both projects because copying , pasting such hastle... p.s. code both completly identical. the simplest method import source code each project. so, let's have source code @ c:/dev/c/game you have several import options. do file->import->c/c++ , select existing code makefile project. browse source folder. repeat similar steps android, java, etc projects. link source files in project existing files. so, create project normal, file->new->source folder. browse existing source. or can right click project, new->file (or folder), give name (specific current project), click advanced , check link file system (then browse actual file or folder) all of these should enable cross platform sharing of source code edits in 1 reflected in other project. if use version control, it's easier. can checkout same source file different p...

python - How to place all 3rd party libraries at one folder? -

i've downloaded google apis client library python , comes 4 subfolders: apiclient, httplib2, oauth2client, uritemplate. placed in root folder like: apiclient httplib2 oauth2client uritemplate app.yaml ... and used below: import httplib2 apiclient.discovery import build but move them 1 folder like: lib apiclient httplib2 oauth2client uritemplate app.yaml ... how import should in case? this has been asked heaps , heaps of times. client library no different other 3rd party library. modify sys.path include lib, or site.add_sitedir do path manipulation in appengine_config.py - see docs - file, loaded before of code. https://developers.google.com/appengine/docs/python/tools/appengineconfig then import statement same.

sql - How do I accumulate arrays into maps? -

i have table t columns: cookie string keywords array<string> fqdn string pixel bigint i want write like select cookie, ???? t group cookie; to table columns cookie string keywords map<string,int> fqdn map<string,int> pixel array<bigint> where cookie unique (guaranteed by cookie ) keywords counts how many times keyword appeared in arrays in original table t fqdn counts how many times domain appeared in rows given cookie pixel counts how many times pixel appeared in rows given cookie you can use "vector" udf's in brickhouse ( http://github.com/klout/brickhouse ). in brickhouse, either array or map can considered "vector". array, array index considered dimension, , numeric value considered magnitude in dimension. map, consider string key "dimension" of vector in large dimensional space, , map value magnitude. ( text-analysis type problems, sim...

python - PyLab contourf with experimental data -

i'm trying understand , adapt following code: import numpy np def f(x,y): return (1 - x / 2 + x**5 + y**3) * np.exp(-x**2 -y**2) n = 256 x = np.linspace(-3, 3, n) y = np.linspace(-3, 3, n) x,y = np.meshgrid(x, y) pl.axes([0.025, 0.025, 0.95, 0.95]) pl.contourf(x, y, f(x, y), 8, alpha=.75, cmap=pl.cm.hot) c = pl.contour(x, y, f(x, y), 8, colors='black', linewidth=.5) pl.clabel(c, inline=1, fontsize=10) pl.xticks(()) pl.yticks(()) pl.show() here have set of points (x,y) , value each point, computed f(x,y) now, have set of computational results in form of x;y;output in txt output file read csv module example. point i'm not understanding data types here, meshgrid. let's each point key key in dictionary fh_dict fh_dict[key] play role of f(x,y) in code above. don't know how implement it, output value each point not easy express mathematical function. thanks time.

Exception in thread "main" java.lang.NumberFormatException: radix 482 greater than Character.MAX_RADIX -

lately have been having issue game, this: @override public tile getplace(list args) { return new craftingtabletile(integer.valueof((string)args.get(0), integer.valueof((string)args.get(1)).intvalue()).intvalue(), this.healthrep); } as as: s.map[selectedx][selectedy] = s.mp.inven.i[s.mp.invsel].getplace(args); gives error: exception in thread "main" java.lang.numberformatexception: radix 482 greater character.max_radix @ java.lang.integer.parseint(unknown source) @ java.lang.integer.valueof(unknown source) @ net.spideynn.miner2d.craftingtableitem.getplace(craftingtableitem.java:21) @ net.spideynn.miner2d.maingame.mousepressed(maingame.java:851) @ org.newdawn.slick.input.poll(input.java:1217) @ org.newdawn.slick.gamecontainer.updateandrender(gamecontainer.java:641) @ org.newdawn.slick.appgamecontainer.gameloop(appgamecontainer.java:411) @ org.newdawn.slick.appgamecontainer.start(appgamecontainer.java:321) @ net.spideynn...

namespaces - How to use this class in my c# code -

how able use iaxaptawrapper class ? namespace axapta { internal class axapta : iaxaptawrapper and namespace axapta { public class axthreadedwrapper: iaxaptawrapper { my attempt ref dll library , then use like using (iaxaptawrapper ax = new axthreadedwrapper()) { the type or namespace name 'axthreadedwrapper' not found (are missing using directive or assembly reference?) you need using directive not using statement. different. a using directive allows omit namespace qualifiers in code. you'll need using directive iaxaptawrapper axthreadedwrapper. in same namespace. a using statement wraps try-finally .dispose around block of code. use if object implements idisposable. now have added internal class. means can't use in assembly (in normal way). default access modifier non-nested class internal you'll need replace public because want access assembly.

javascript - Update jQuery UI Slide function -

i want code below function want able run slide function (slide: function(e,ui) { ) onclick of div when unitstandard , unitmetric changed. there way call function? $('#weight').slider({ max: 450, min: 50, value: 115, animate: true, slide: function(e,ui) { if(unitstandard == true) { weight = math.floor(ui.value); $('#weightval').html(weight + " lbs"); } else if(unitmetric == true) { weight = math.floor(ui.value); weight = weight*0.453592; weight = math.floor(weight); $('#weightval').html(weight + " kg"); } } }); you can update calling value(v) method documented in api . for example: $("#some-div").on("click", function() { $("#weight").slider("value", 200); }); here live example . if don't give second argument $("#weight").slider("va...

c++ - Does DirectX9 define something to differentiate versions at preprocessor? -

as visual studio defined _msc_ver , 1700 stands vs2012 while 1800 stands vs2013. does directx9 define differentiate between (december 2004) , (june 2010) ? not sure, guess d3d_sdk_version , d3dx_sdk_version defines looking for. @ least in example it's used check runtime vs. build versions : hresult cd3dxmyapplication::initialize(hinstance hinstance, lpcstr szwindowname, lpcstr szclassname, uint uwidth, uint uheight) { hresult hr; if (!d3dxcheckversion(d3d_sdk_version, d3dx_sdk_version)) return e_fail; //... }

css - Triangle with one rounded corner -

Image
i want make one rounded corner triangle i'm unable make it. here code : .arrow-left { width: 0; height: 0; border-top: 80px solid transparent; border-bottom: 80px solid transparent; border-right: 80px solid blue; } <div class="arrow-left"></div> i need corner pointing left rounded shown in image : i know little hacky, don't think there easy way single class. all i've done rotated box 45 degrees border-radius:10px , contained in div width set desired width of arrow , overflow:hidden spills on invisible. http://jsfiddle.net/9d3zn/5/ .arrow-left { position:absolute; width:100px; height:100px; left:50px; background:black; -webkit-transform:rotate(45deg); transform:rotate(45deg); border-radius:10px; } .cover { position:absolute; height:100px; width:40px; overflow:hidden; }

bash - copy files from one path to another path in linux -

i new linux. trying copy files 1 path path. have text file has names of files in following pattern: file-1.txt file-2.pdf file-3.ppt .... i created .sh file following code: #!/bin/bash file=`cat filenames.txt`; frompath='/root/backup/upload/'; topath='/root/desktop/custom/upload/'; in $file; filepath=$frompath$i #echo $filepath if [ -e $filepath ]; echo $filepath yes | cp -rf $filepath $topath else echo 'no files' fi done the above code copying last file name text instead of destination path. please help. the proper way loop on set of input lines is while read i; : "$i" done <filenames.txt note use of double quotes around "$i" , variable interpolation string contains filename component. unquoted values appropriate when require shell word splitting , wildcard resolution.

actionscript 3 - Flex text item renderer multiple row -

i'm building item renderer in order have list of these. in these item renderer there first part text component should have 2 rows of text , truncate it, second part label. i'm trying find how put text component on 2 rows. can me? thanks use vgroup. inside place 2 textarea components. place inside hgroup alongside label <s:hgroup left="10" right="10" top="10" bottom="10"> <s:vgroup left="10" right="10" top="10" bottom="10" gap="0"> <s:textarea id="row1_text" width="400" height="100"/> <s:textarea id="row2_text" width="400" height="100"/> </s:vgroup> <s:label id="mylabel"/> </s:hgroup>

CharacterPointer in C++ -

i have piece of code follows: char* foo(char* str1) { str1 = "some other text"; cout << "string inside function::" << str1 << endl; return str1; } int main() { char* str = "this string"; cout << "string before function call::" << str << endl; foo(str); cout<<"string after function call::"<<str<<endl; return exit_success; } but cout after function call gives me "this string" though have changed in foo function. i'm confused here although know has got me not passing correct address. // adding & (aka pass reference) after char* can modify pointer passed foo function // must understand place in memory!!! void foo(char*& str1) { // string saved in global section , here // changed not text in str1 pointer str1 = "some other text"; cout << "string inside function::" ...

c# - How to differentiate between not set and set to null during XML Serialization? -

i have wcf service allows external application update database. have update operation contract accepts data contract external application should set. problem cannot distinguish set null , not set because when data contract serialized value null. consider following data contract: [datacontract, xmlroot("person")] public class person: baseentity { [datamember, xmlelement] public string prefix { get; set; } [datamember, xmlelement] public string firstname { get; set; } [datamember, xmlelement] public string middlename { get; set; } [datamember, xmlelement] public string lastname { get; set; } [datamember, xmlelement] public string maidenname { get; set; } [datamember, xmlelement] } one external application can set firstname , lastname , ignore rest of properties. when wcf service receive request, other properties set null. update statememt in wcf service think properties set null. wish find way determine properties not set upda...

javascript - AngularJs: nested condition in ngif -

i displaying data using ng-if inside tag. have nested condition run determine content show. if use simple condition below works: <tr ng-repeat="tag in tagdetails"> <td ng-if ("tag.arrayval[1].state && tag.arrayval[1].state == 'kar'")tag.arrayval[1].state</td> </tr> but below code not work when add () , put || condition inside (): <td ng-if="(tag.arrayval[1].state && tag.arrayval[1].state == 'tam') || (tag.arrayval[0].state && tag.arrayval[0].state == 'tam')"></td> how handle case in angular when not sure order of elements in array columns fixed show specific values array. data structure of tagdetails: "arrayval": [ { "state": "kar", "country": "india", "region": "asia", "availability": "available...

c# - ASP.Net 4.5 Web Forms routing works for a while then breaks. Why? -

i'm using below code in global.asax: protected void application_start(object sender, eventargs e) { registerroutes(routetable.routes); } protected void registerroutes(routecollection routes) { routes.mappageroute("apiroute", "{appid}/{key}/{method}/", "~/handler.aspx"); } at first when deploy it, , couple of minutes after that, code works following sample request: http://localhost/app1/4/em9tcrqt+bzmdiv0yia5of6i2jb9zlpwb6wwtvzy3zu=/testfn/?param=46 at first request works , returns results, few minutes later starts throwing 404 not found error. i tried adding following module through web.config didn't help <system.webserver> <modules> <add name="urlroutingmodule" type="system.web.routing.urlroutingmodule, system.web, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"/> </modules> </system.webserver> i'm running asp.net 4.5 on windows 2008 r2 server ide...

BigQuery: Error querying from a view -

i'm receiving error when querying view: a view query references old version of table might incompatible. please delete , re-create [mydataset.mytestview]. i created view yesterday, , i'm table structure has not changed, ie no new columns, no columns deleted , on. however, table dropped , re-created nightly. cause of problem? how should/can overcome this? bigquery saves internal name of table in view. when delete table , recreate it, internal name changes, if external name same. note deliberate, don't refer wrong table, or table has different schema. if delete table referenced in view, need update view point @ table. empty patch operation should suffice, however.

installation - Visual Studio 2012 Install Fails: Program Compatibility Mode is on -

Image
i'm trying install visual studio 2012 express windows desktop , every time run installer error: "windows program compatibility mode on. turn off , try setup again." i checked file properties , compatibility mode off. googling found changing name " vs_premium.exe " or " vs_ultimate.exe " or changing registry keys might help, name changes had no effect, , there no registry keys delete. have restarted machine several times no avail. changing visual studio 2013 not option me, work computer has visual studio 2012 on not update 2013, , need work on project on both computers. the computer using has windows 8.1 hp pavilion g6. have installed visual studio 2013 windows desktop, web, , windows, 30-day trial professional (which has expired). have installed visual studio 2012 windows phone have not used yet. previous posts correct in compatibility mode appears based entirely on file names. there simple method determining precisely name ...

database design - storing rows order in mysql -

i need give ability change order of displaying rows script admin page. there default order newly added rows (the go end of list) , admin should able change position of specific row. i'm going act rows doubly linked list able re-position rows. is ok use linked list method saving display position of mysql rows? is there better method? should use separate table store orders or ok add 2 next & prev columns original table? is possibe use mysql order statement method? edit : thought of using spaced order codes (e.g. 0, 100, 200, ...) has limit may reached i think you'll better off storing ordering position in dedicated field, instead of trying implement linked list. the issue linked list is requires sort of list traversal "reconstruct" order before can display user. normally, you'd employ recursive query that, unfortunately mysql doesn't support recursive queries, you'll either need fiddle stored procedures, or end-up making da...

jQuery: how to do an after click event in jquery -

i have tic tac toe game, board <table> , <td> s cells. every time click on td, appends x img or o img. this jquery code - note: check var, if there 5 or more clicks on board, start check if wins game. var player = 1; var check = 0; $("td").bind("click", function(){ if(player==1){ $('<img src="x.png" alt="x" name="x"/>').appendto(this); player=player+1; check+=1; } else { $('<img src="o.jpg" alt="o" name="o"/>').appendto(this); player=player-1; check+=1; } }); my html table this: <table> <tr> <td id="one"></td> <td id="two"></td> <td id="three"></td> </tr> <tr> <td id="f...

jquery - Bootstrap 3 - Collapsible right-side panel like Google Drive Details/Activity panel -

Image
working on new web layout our existing product. we'd integrated team chat , activity feed displays consistently displayed on right side of each page. we're using bootstrap 3 , i've got mock looks pretty good. i'm using vanilla bootstrap 12-column sizing styles this: now want allow users collapse right-side panel (horizontally), views horizontal real estate important (grid views, etc.). is there bootstrap way this? i'm fine vertical splitter widget, or toggle button in top nav, or whatever other presentation makes sense. it's more grid sizing need advice on. i had needed similar approach 1 of our projects , fullscreen view here . i modified script , layout bit trying achieve. here code , fullscreen here . used jquery cookie retain view state after page refresh. clicking on cog icon toggle sidebar. script is: $(function () { var $menu = $('#sidebar-wrapper'); var $content = $('#main-wrapper'); ...

php - Autocomplete box will not populate from the database -

so tried setting autocomplete box through codeignighter framework , cannot seem textbox populate results database. this model <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class nextcreatecampaign_model extends ci_model { public function __construct() { parent::__construct(); // own constructor code } function getuser($term) { $sql = $this->db->query('select campaign_name, remote_service_id ad_report_new.service remote_service_id "'. mysql_real_escape_string($term) .'%" order remote_service_id'); return $sql ->result(); } } ?> this controller campaign.php <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class campaign extends ci_controller { /** * index page controller. * * maps following url * http://example.com/index.php/campaign * - or - * http://example.com/index.php/campaign/index * - or...

clang - Xcode 5.1 enable C++14 -

xcode 5.1 using clang 3.4. , clang 3.4 supports c++14. however, i've been surfing though of xcode options , don't see way enable c++14. i'm trying enable relaxed constexpr feature of c++14 to work, first set "c++ language dialect" "compiler default". in "other c++ flags" add "-std=c++1y". this allow clang++ compile c++14 within xcode. tested xcode 5.1.1 using new user defined literal basic_string: std::string word = "hello"s; update: of xcode 6, c++14 available first-class language dialect.

c++ - How to write a constant function reference -

at moment have class defined similar this: class dummy{ public: dummy(void(&func)(int)) : member{func}{} void(&member)(int); }; but want have member defined const function reference. i'm not sure how write or if possible. p.s. please don't recommend me std::function i'm not oblivious it's existence , have no objection it, want know whether doable. the syntax: syntactically, can achieve through type alias (or typedef ): using function_t = void(int); // or typedef void (function_t)(int); class dummy { public: const function_t& member; dummy(const function_t& func) : member{func}{} }; the semantics: however, "correct syntax" doesn't buy anything: dummy same as class dummy { public: function_t& member; dummy(function_t& func) : member{func}{} }; (which, in turn same op's definition) because const qualifiers ignored per c++11 8.3...

html - Misaligned options in date select dropdown (Firefox) -

Image
in firefox date select dropdown has misalgined options. see following image: any tips on can make options line up? css here: .dob-selects-container { display: block; -moz-box-sizing: border-box; float: left; min-height: 30px; margin-left: 2.12766%; :nth-child(1) { width: 120px; display: inline-block } :nth-child(2) { width: 60px; display: inline-block } :nth-child(3) { width: 80px; display: inline-block } } if specify style rules using :nth-child() it'll apply matching elements. you've specified display:inline-block first 3 childs using child selectors, hence sit next each other text. march pulled down since doesn't have space available in same line.. if trying apply <select> elements, try select:nth-child(1) { width: 120px; display: inline-block }

php - PAYPAL is giving error "DPRP is disabled" -

i implementing paypal using php. working fine in sanbox mode. but, when implementing live giving error "dprp disabled". is paypal direct payment api component class file (api51.0) requires paypal business pro 2.0 or 3.0 ? so how fix please suggest. in advance. the dprp error revolves around recurring payments enabled on account. if integrating classic apis recurring payments(user,pw,sig), you'll have sign it, you'll have call paypal , request it. if have pro 2.0 account, you'll want sign recurring billing ($10 mos), resolve issue

javascript - Mandatory fields and selecting drop down list values -

basically, have 2 fields, 1 selection (drop down) list , other input textbox, both different question's. my question is, if choose only one value in selection list (first question), textbox (second question) must 6 characters or numbers in length. otherwise, other values chosen in selection list can 10 characters long in textbox. how can write in javascript form without use of regex , within ? i have written parts of script see how others can write it. sole problem rest of other values 10 characters long. i'd add first question not need selection list. made way html more presentable , organised. this script (so far): function imposemaxlength(object, limit) { var num = document.getelementbyid("number").value; if (num == "3") { document.getelementbyid("type").value { return (object.value.length <= limit); } } } html: <label for="number">number:</label> <select size="1...

ios - GPS sign doesn't go away when I kill all apps -

Image
i have app uses gps location. got feedback closing app doesn't stop gps. user complained ios 7.1 saying before ios update app not doing that. since didn't change code, wonder if have in order satisfy ios7.1 needs. here do: cllocationmanager *_lm; - (void)mode:(locatormode)mode { nslog(@"location mode: %d", mode); switch (mode) { case lmbackground: [_lm stopupdatinglocation]; [_lm startmonitoringsignificantlocationchanges]; break; default: [_lm stopmonitoringsignificantlocationchanges]; [_lm startupdatinglocation]; break; } } - (void)applicationdidbecomeactive:(uiapplication *)application { [[locator defaultlocator] mode:lmprecise]; } - (void)applicationwillresignactive:(uiapplication *)application { [[locator defaultlocator] mode:lmbackground]; } here screenshot i've made. notice there no single app running , yet gps sign lit (a little arrow i...

android - How to implement 2 different types of seperators( i.e headers) in a ListView Adapter class -

i calling adapter set of codes madapter = new mycustomadapter(getactivity()); madapter.addseparatoritem(new contentwrapper(q.get(0).geta_name(),null)); madapter.additem(new contentwrapper(q.get(0).getas_name(), q.get(0).getdesc_art())); consider code: private class mycustomadapter extends baseadapter { private static final int type_item = 0; private static final int type_separator = 1; private static final int type_max_count = type_separator + 1; private arraylist<contentwrapper> mdata = new arraylist<contentwrapper>(); private layoutinflater minflater; private treeset<integer> mseparatorsset = new treeset<integer>(); public mycustomadapter(context context) { minflater = layoutinflater.from(context); } public void additem(contentwrapper value) { mdata.add(value); notifydatasetchanged(); } public void addseparatoritem(contentwrapper value) { mdata.add(value); // save separator position mseparatorsset.add(mdata....