Posts

Showing posts from September, 2013

php - Parsing A Table, Can't get more than 3 row Using DOMXpath -

for wierd reason can't understand right can't fetch more 3 row table in page this page. http://www.reedmfgco.com/en/products/cutters-and-cutter-wheels/cutter-wheels/cutter-wheels-for-tubing-cutters-plastic/ i want parse table @ bottom. since there 1 table in page made xpath simple. $xpath -> query('//tr') if following echo $xpath -> query('//tr')->lenght; i 3 why getting 3 there 9 row there, should 9 . edit code use $dom = new domdocument(); @$dom -> loadhtml($this->html); $xpath = new domxpath($dom); echo $xpath -> query('//tr')->lenght; and please note $this->html raw html previous link in post. html source on page not valid xml. if open source code of page , tag <tr> , has 3 elements. table row products not have opening tag <tr> for problem, can use regular expressions normalize contents of table. $html = file_get_contents('http://www.reedmfgco.com/en/products/cutters-a

ios - Strange spacing below my NavigationController? -

Image
as experienced android developer i'm coming in new ios please bare me, cannot find reason strange gap in layout! and it happens on none of other screens, one, leads me believe sort of rect size issue, i've not set anywhere? why start happening? i don't know why happening have had similar problem before. try moving item in interface builder. even if interface builder doesn't perfect, should correct when test in ios simulator. either that, or may need adjust height of object...

rsa - Read encrypted PKCS8 SpongyCastle Java -

i following code in: https://stackoverflow.com/a/18161536/1753951 getting exception in following line: fileinputstream fis = new fileinputstream(priv); datainputstream dis = new datainputstream(fis); byte[] keybytes = new byte[(int)priv.length()]; dis.readfully(keybytes); dis.close(); javax.crypto.encryptedprivatekeyinfo encryptpkinfo = new encryptedprivatekeyinfo(keybytes); //exception: org.apache.harmony.security.asn1.asn1exception: wrong content length i trying read .key/.pem pkcs8 file is: -----begin rsa private key----- proc-type: 4,encrypted dek info: aes-256-cbc,8aff348907c84f2f6370a216dc0d55d9 1vijjd3dz5/wynim0mtp8d22rc24ygcy9lxgehudbypjqa8pjupubfqkrpoodvqx dpfe1f3xey8ovg42zfr4287x4v16n++bqcediuvyrwaclmauqz6pflt4b/py89cm 761uzpawnh0phfjqb9chqc+pgagfrf5vj7utdnchcwbmo+7gvu5igyyxnrj/hpnu v+8qdzro4kfimoldzhaj3kn1ftbb9ldjdne/nshbrrafawjmzsy/zjf8mfqggkoz %%%%% skipped of %%%%%%%%%% bmil0y5xvgpwkapa30edgv4yazej+wqlnyizfcklqzvcfyjxhfvivw6d41wnm8bx wl28v4qjklnf

ruby on rails - "Incorrect MySQL client library version" -

i'm getting following error when running rake assets:precompile incorrect mysql client library version! gem compiled 5.6.10 client library 5.5.12. mysql installed using homebrew , version 5.6.10. can connect database on 127.0.0.1 locally. i've tried following no luck: archflags="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config it seems advice folks "client library" newer 1 gem compiled for. issue opposite. can't figure out 5.5.12 coming from. ideas? try: gem uninstall mysql gem uninstall mysql2 then bundle install

asp.net - HTML5 Local Storage data not reflected across active tabs/windows in IE 11 -

we have created functionality in provide users works forms in offline mode. using html 5 local storage store offline data. forms have own html files (for example:form-1.html,form-2.html.) we have parent html page makes use of iframe load requried html file based on form selected drop down list. after user have made modification in offline mode,the user can sync in changes logging asp.net website. the problem ,we facing copy of local storage in modified user in offline mode not in sync when user sync changes asp.net website. in short,when examine local storage in ie console of browser when login asp.net website,it not reflect changes made local storage during offline mode. both parent html page , asp.net website page serverd same domain . came across piece of article says on going issue , has not been fixed in ie 11. ie , local storage issues please see bullet# 3. has 1 had same kind of experience.? any work around? this known bug: https://connect.microsoft

java - issue with alert dialog box, due to it not recognizing the initiation of the alert box -

i trying create dialog box show when image clicked there seems few issues code. code shown below. have done import dialog box doesn't seem work there error when initiating new dialog box. imagebutton ib = (imagebutton)findviewbyid(r.id.imagebutton1); ib.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { alertdialog ad = new alertdialog.builder(this) .setmessage("blah blah blah.\n fine pring.\n accept our terms , conditions?") .seticon(r.drawable.ic_launcher) .settitle("terms of service") .setneutralbutton("back", this) .setcancelable(false) .create(); ad.show(); } }); the problem reference this on line alertdialog ad = new alertdialog.builder(this) is referring anonymous inner class view.onclicklistener not extend context. so, above your ib.setonclicklistener(new

c++ - Creating a namespace using a class defined in another namespace -

i trying out following code whether works or not. need whether done in other way. // foo.hpp namespace traits { class foo { public: typedef std::vector<int> vec_t; typedef std::map <int, int> map_t; }; }; namespace my_traits = traits::foo; //i know compile give error "foo" not namespace-name. // in bar.hpp using namespace my_traits; class bar { private: vec_t my_vector; // my_traits have foo's members (typedefs) map_t my_map; // my_traits have foo's members (typedefs) }; **don't** want following : using namespace traits; class bar { private: traits::foo::vec_t my_vector // avoid traits::foo::map_t my_map // avoid } but want put typedefs in class foo , use foo namespace. dont want put typdefs in namespace such. is possible in c++11 (or in general c++). thanks you cannot use class namespace , have use real namespace : name

assembly - Address Out of Range. Hex to Decimal Mips -

i trying convert hex binary. stuck. storing bite returns error "address out of range". here code: .data input: .word 0x12345678 buff: .space 40 la $a0, input la $a1, buff .text move $t2, $a0 li $t1, 0 loop: rol $t2, $t2, 1 , $t0, $t2, 1 add $t0, $t0, 48 move $a0, $t0 li $v0, 11 syscall sb $a1, 0($a0) # runtime exception @ 0x00400228: address out of range 0x000000030 subi $t1, $t1, 1 bne $t1, 32, loop jr $ra i found out during compilation mips turns hex decimal form, meaning 0x12345678 should change 305419896 , code should output binary of 00010010001101000101011001111000. instead, getting output of 00010000000000010000000000000000. if figuring out why address out of range , why hex doesn’t seem changing proper decimal during compile, appreciated. thank you. update: have changed move $t2, $a0 lw $t2, 0($a0) . m able correct binary representation. however, still receiving address out of range error on sb line.

asp.net - Sending data to controller by Ajax -

usually send data controller ajax following:: $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "/controller/myaction", data: "{'name':'" + id + "','class':'" + cls + "'}", datatype: "json", see have members send controller 2 different parameters. want send list. but want send list controller in 1 parameter. possible how can achieve that? json.stringify key here. here code: var mylist = { list: [{ name: "a", class: "b" }, { name: "c", class: "d" }] }; $.ajax({ type: 'post', url: '/{controller}/{action}', cache: false, data: json.stringify(mylist), datatype: 'json', contenttype: 'application/json; charset=utf-8

node.js - Node+ElasticSearch: Sending a body on a GET request? -

i using node.js , request module create backend, , we've chose elasticsearch our data storage. fine far, except seems node doesn't support request bodies on requests? necessary elasticsearch's _search api , expects requests part of semantic design. there solution force node send request body in cases of request, or mean use _search on elasticsearch http verb? function elasticget(url, data) { data = data || {}; return q.nfcall(request.get, { uri: url, body: json.stringify(data) //<-- noop }).then(function(response) { return json.parse(response[1]); }, function(err) { console.log(err); }); } the _search api accepts post verb.

How can I decode this encoded JavaScript file? -

i have deal strange javascript file. it's called standard <script src=xxxx.js type=text/javascript></script> but xxxx.js somehow packed/encrypted/whatever. first characters are: #@~^3wcaaa==@#@&0; mdkw and there not pattern in it. there isn't sign of known function eval or equivalent. how can manage read it's content? character set trick? the creator might have used kind of javascript obfuscator tool. try using deobfuscator tool-plugin firefox: [https://addons.mozilla.org/en-us/firefox/addon/javascript-deobfuscator/][1]

Modifying previously written Azure page blobs -

i've come across i've taken granted because "it works". i have 512 byte page blob that's been written azure. want modify 1 of bytes in it, leave rest of information in tact. what's strategy doing this? when thinking problem realized hard drives of me; i've been taking granted. data stored in sector, yet able modify parts of sector while leaving rest of data as-is. i'm not sure kind of data access called. i'm assuming need load entire blob memory, modify bits want , write 512 byte blob back, seems naive approach. thanks information looking @ put page rest api documentation , don't think have no other option download entire blob (which same page since blob size 512 bytes) in memory, update 1 byte , upload page.

c - gcc compiler is not allocating memory contigously -

i writing simple program, after declaring variables checking addresses of variables memory not allocated contiguously there gaps in between. here program. why leaving gaps not understanding #include < stdio.h > #include < stdint.h > int main() { char char_one,char_two; int = 5,b = 7,*ptr,*ptr_one; static int *sum_ptr; printf("address of %u\n",&a); printf("address of variable b %u\n",&b); printf("address of ptr variable %u\n",&ptr); printf("address of ptr_one variable %u\n",&ptr_one); printf("address of char_one var %u\n",&char_one); printf("address of char_two var %u\n",&char_two); return 0; } output: address of 2636128020 address of variable b 2636128024 address of ptr variable 2636128000 address of ptr_one variable 2636128008

swing - Draw a portion of a rotated image in Java -

i trying draw portion of circular game board. board rotates, i'd keep constant viewport. plan create bufferedimage of full board, rotate it, draw centered portion graphics paint method. however, graphics not have rotate, , graphics2d not have way draw portion of image. any thoughts? "graphics2d not have way draw portion of image." that's not true. graphics2d inherits graphics this method. allows drawing portions of image. see example usage here public abstract boolean drawimage(image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, imageobserver observer) draws of specified area of specified image available, scaling on fly fit inside specified a

javascript - Get div id from select value -

good day. please me. have code: <form action="" method="post" id="dynamic_selects"> <table> <tr> <td> <select id="type" multiple> <option value="63">1963</option> <option value="64">1964</option> <option value="65">1965</option> <option value="66">1966</option> <option value="67">1967</option> <option value="68">1968</option> <option value="69">1969</option> <option value="70">1970</option> <option value="71">1971</option> <option value="72">1972</option>

c++ - Makefile: How to correctly include header file and its directory? -

i have following makefile: cc=g++ inc_dir = ../stdcutil cflags=-c -wall -i$(inc_dir) deps = split.h all: lock.o dbc.o trace.o %.o: %.cpp $(deps) $(cc) -o $@ $< $(cflags) clean: rm -rf *o this makefile , 3 source files lock.cpp , dbc.cpp , trace.cpp located in current directory called core . 1 of source file trace.cpp contains line includes header file outside current directory: //in trace.cpp #include "stdcutil/split.h" the header file split.h located @ 1 level above current directory , in subdirectory called stdcutil . that's why added inc_dir = ../stdcutil in makefile. overall directory structure looks following: root |___core | | | |____makefile | |____dbc.cpp | |____lock.cpp | |____trace.cpp | |___stdcutil |___split.h but when make it, gives me error: trace.cpp:8:28: fatal error: stdcutil/split.h: no such file or directory #include "stdcutil/split.h"

ios - Mask out specific pixels from a UIView based on where subviews are located -

say have main uiview has several subviews of type catview , dogview. want render uiview image, want exclude dogviews, final rendered image has transparent pixels in place of dogview. (note removing dogviews view wouldn't work - need transparent pixels dogviews were). dogviews can rotated don't take rectangular portions of view. any ideas on how can approach this? edit: first attempt - (uiimage *)createcutoutviewfromview:(uiview*)view { uigraphicsbeginimagecontextwithoptions(view.bounds.size, no, 0.0); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextmovetopoint(context, 200, 200); cgcontextaddlinetopoint(context, 250, 200); cgcontextaddlinetopoint(context, 250, 250); cgcontextaddlinetopoint(context, 200, 250); cgcontextclosepath(context); cgcontextclip(context); [view.layer renderincontext:context]; uiimage *result = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return resu

javascript - Hoisting/Reordering in C, C++ and Java: Must variable declarations always be on top in a context? -

i read little hoisting , reordering , seems java vm may choose hoist expressions. read hoisting of function declarations in javascript. first question: can confirm if hoisting exist in c, c++ , java? or compiler/optimization dependent? i read lot of example c codes put variable declarations on top, before assert or boundary condition . thought little faster asserts , boundary cases before variable declarations given function terminate. main question: must variable declarations on top in context? (is there hoisting @ work here?) or compiler automatically optimize code checking these independent asserts , boundary cases first (before irrelevant variable declaration)? here's related example: void mergesort(struct node** headref) { struct node* a; struct node* b; if ((*headref == null) || ((*headref)->next == null)) { return; } frontbacksplit(*headref, &a, &b); mergesort(&a); mergesort(&b); *headref = so

javascript - ACE Text Editor displays text characters in place of spaces -

Image
i've written following javascript: (function () { var computationmodule = (function foo1(stdlib, foreign, heap) { "use asm"; var sqrt = stdlib.math.sqrt, heaparray = new stdlib.int32array(heap), outr = 0.0, outi = 0.0; function computerow(canvaswidth, canvasheight, limit, max, rownumber, minr, maxr, mini, maxi) { canvaswidth = +canvaswidth; canvasheight = +canvasheight; limit = +limit; max = max | 0; rownumber = +rownumber; minr = +minr; maxr = +maxr; mini = +mini; maxi = +maxi; var columnnumber = 0.0, zreal = 0.0, zimaginary = 0.0, numbertoescape = 0; var columnnumberint = 0; // compute imaginary part of numbers correspond pixels in row. zimaginary = +(((maxi - mini) * +rownumber) / +canvasheight +

javascript - Multiple buttons to show/hide div depending on current display -

brand-spanking-new javascript , trying implement part of school assessment site. what i'm trying is, using multiple buttons, change display style of div. part i'm having trouble getting function either stay open (style.display = block) if different button pressed last, or close (style.display = none) if same button previous. the reasoning behind next step implement ajax call different content div based on same buttons. trying basics there first. (learning exercise) function toggle_visibility(caller) { var e = document.getelementbyid('hidden'); var current; if(caller == current){ e.style.display = 'none'; current = 'none'; }else{ e.style.display = 'block'; current = caller; } that's script is, buttons calling above script different 'caller': <button onclick="toggle_visibility('button1')">button1</button> <button onclick="toggle_v

c++ - what does the void(*f) mean in -> "methodName( void (*f)(const Datatype&));"? -

so, i'm looking @ 1 of codes professor gave me, don't know void(*f) means, clarify? template<class t> void binarytree<t>::inorder( void (*f)(const t&), btnode<t> *node ) const //<-- right here { if (!node) return; inorder(f, node->left); f(node->elem); inorder(f, node->right); } it pointer function returning void , , taking const t& parameter. name of pointer if f . void foo(const t&); // function declaration void (*f)(const t&); // function pointer f = &foo; // can assign &foo f, return type , signature match

ios - Move a SKSpriteNode with a single tap, but move continously when long tap - Sprite Kit -

i'm trying change skactions of existing sprite kit tutorial project, i'm running issues when comes movement. tutorial , github project here: https://www.codefellows.org/blogs/simple-sprite-kit-game-tutorial-part1 https://github.com/megharastogi/gametutorial as can see in code below, each tap moves node once. how change long tap move continuous move node? tried few things repeatactionforever, didn't work well. -(void)addship { //initalizing spaceship node ship = [skspritenode spritenodewithimagenamed:@"spaceship"]; [ship setscale:0.5]; ship.zrotation = - m_pi / 2; //adding spritekit physicsbody collision detection ship.physicsbody = [skphysicsbody bodywithrectangleofsize:ship.size]; ship.physicsbody.categorybitmask = shipcategory; ship.physicsbody.dynamic = yes; ship.physicsbody.contacttestbitmask = obstaclecategory; ship.physicsbody.collisionbitmask = 0; ship.physi

vb.net - How can i make a point in a chart equal the value of a textbox? -

Image
in project have created chart , want there same number of points in textboxes, how can that? code public class form1 dim object dim b object private sub button7_click(sender object, e eventargs) handles button7.click chart1.anchor = anchorstyles.bottom or anchorstyles.left or anchorstyles.right or anchorstyles.top chart1.chartareas(0).axisx.maximum = 20 chart1.chartareas(0).axisy.maximum = 30 chart1.chartareas(0).axisx.minimum = -20 chart1.chartareas(0).axisy.minimum = -30 chart1.chartareas(0).axisy.interval = 5 chart1.chartareas(0).axisx.interval = 5 chart1.chartareas(0).axisx.crossing = 0 chart1.chartareas(0).axisy.crossing = 0 chart1.chartareas(0).axisx.linewidth = 2 chart1.chartareas(0).axisy.linewidth = 2 chart1.chartareas(0).axisy.majorgrid.linecolor = color.black = new datapoint(0, 0) a.label = "#valx : #valy" a.markerstyle = markerstyle.circle a.markersize = 5 chart1.series(0).poi

r - Convert a dataframe to presence absence matrix -

i have table has unequal number of element in string format file1 b c file2 b d file3 e f i want convert format follows b c d e f file1 1 1 1 0 0 0 file2 1 1 0 1 0 0 file3 0 0 0 0 1 1 i tried using reshape2 not successful. sample data: mydata <- structure(list(v1 = c("file1", "file2", "file3"), v2 = c("a", "a", "e"), v3 = c("b", "b", "f"), v4 = c("c", "d", "")), .names = c("v1", "v2", "v3", "v4"), class = "data.frame", row.names = c(na, -3l)) one possibility: library(reshape2) df2 <- melt(df, id.var = "v1") with(df2, table(v1, value)) # value # v1 b c d e f # file1 1 1 1 0 0 0 # file2 1 1 0 1 0 0 # file3 0 0 0 0 1 1

how to convert f3d format to zf3d format with Flare3D? -

i have 10 .f3d models , need convert zf3d. idea if there simple solution ? many thanks. eugene f3d format no longer supported (a new , optimized f3d version in developing , ready future flare3d version). if want use old f3d models can convert them using flare3d ide. drag , drop old model ide, , saving zf3d instead original f3d.

resources - delphi write data with updateresources -

i try write string external exe file, when read string via other project other string. example: when write "test123" read "test123click". when write "test" read "test.". when write "name" read "name.". i use script write: procedure writesettings(serverfile: string; settings: string); var resourcehandle: thandle; pwserverfile: pwidechar; begin getmem(pwserverfile, (length(serverfile) + 1) * 2); try stringtowidechar(serverfile, pwserverfile, length(serverfile) * 2); resourcehandle := beginupdateresourcew(pwserverfile, false); updateresourcew(resourcehandle, makeintresourcew(10), 'settings', 0, @settings[1], bytelength(settings)); endupdateresourcew(resourcehandle, false); freemem(pwserverfile); end; end; this script read: function loadsettings: string; var resourcelocation: hrsrc; resourcesize: dword; resourcehandle: thandle;

java - Receiving " error: ' void ' type not allowed when checking JButton status in Tic Tac Toe game -

i have 9 scenarios making 9 conditional statement see if jbutton have been pressed , no winner found, giving me " error: ' void ' type not allowed here. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class tictactoe extends jframe { private final int height = 450; private final int width = 500; private static jbutton [] button = new jbutton[9]; private static action [] playerturn = new action[9]; private static jlabel [] label; private int player = 1; private font arial = new font("arial", font.bold, 20); private static int lockbuttons = 0; public tictactoe () { settitle( " tic tak tow "); setsize( height, width); setdefaultcloseoperation(jframe.exit_on_close); setlayout(new gridlayout(4,3)); int num = 0; for(int = 0; < 9; i++ ) { button[i] = new jbutton( "b" + + 1); playerturn[i] = new action(); add(button[i]); button[i].setfont(arial);

jquery - I want two Flexsliders on the same page to run at different speeds -

i'm new flexslider. have 2 on 1 page, , running fine, either change "initdelay" of 1 or make them have different slideshowspeeds, because looks goofy both change @ exact same time. there way that? <div id="rightside"> <div class="flexslider"> <ul class="slides"> <li> <img src="images/1.jpg" /> </li> <li> <img src="images/2.jpg" /> </li> <li> <img src="images/3.jpg" /> </li> </ul> </div> </div> <div id="rightsidebot"> <div class="flexslider"> <ul class="slides"> <li> <img src="images/4.jpg" /> </li> <li> <img src="images/5.jpg" /> </li> <li> <img src="images/6.jpg" /> </li&

ios - Is AVAudio autoreleased? -

i'm new playing sounds on ios. know play various sounds should have audio manager helper class keeping audios together. now, i'm wondering if ok without memory leak: avaudioplayer *newplayer = [[avaudioplayer alloc] initwithcontentsofurl:url error:&err]; [newplayer play]; will player released after finished playing? or need keep pointer it, call [newplayer stop] when finishes, set pointer nil ? actually opposite of leak. if not retain player, released , never play. see answer here more info: playing audio using avaudioplayer ios 7

php - Integrating Google OAuth API with existing user system? -

i have simple user system basic information: email , password. instead of using google api "sign in" feature: is there way can "link" user's youtube channel account? is there way can link multiple channels user's account? if so, how keep track of user data from? i have written few php classes take care of google's oauth flow, storing access token, expiration time, , refresh token in database (you may think "don't reinvent wheel", prefer learn writing these classes). as kept going through logic , how lay out, did not understand how link user's account previous account. eg: when login, how user's linked channels? here of code client.php public function authinticate($authorizationcode) { // need post request access token , refresh token $post = array("grant_type" => "authorization_code", "code" => $authorizationcode, "client_id" => $this->clientid, "client

php - PHPExcel +Codeigniter: Invalid character -

Image
i trying export excel file using phpexcel , codeigniter this . i can't download excel file output showing in console invalid character. screen shot of console output. 1. first solution i had same probleme. use class developped eliselab https://github.com/ellislab/codeigniter/wiki/export-to-excel-2013 for export need put on controller. $this->load->library('export'); $this->load->model('yourmodel'); $result = $this->yourmodel->yourqueryfunction(); $this->export->to_excel($result, 'nameforfile'); 2. second way if want use phpexcel try put same charset on pages, file charset & content charset. (utf-8) put on file header : header('content-type: text/html; charset=utf-8'); and change type of file in utf-8 without bom on nodepadd++ go : click on "format" select "encode in utf-8 without bom" i hope you.

tomcat - java - Can't deploy exploded artifact -

i can't deploy exploded artefact on tomcat 7, non-exploded artefact deploys fine. can doing wrong? severe: containerbase.addchild: start: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:901) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:877) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:633) @ org.apache.catalina.startup.hostconfig.manageapp(hostconfig.java:1544) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.tomcat.util.m

c - Search in File with Hashmap -

i working c project. have file containing item details can 5000 - 10000 or more in number. target retrieve item detail item reference. what create hash values item reference of each item details , store in file. the location of hash value location of item detail. whenever item reference, create hash value , search matching 1 in new file of hash values , location. location actual item detail. this slow process. can suggest more fast method?

visual studio 2013 - VSIX deploys ItemTemplate on a wrong folder [Resolved] -

i upgrade vsix project vs2010 vs2013, project contains itemtemplate, unfortunately upgraded vsix deploys itemtemplates vs2010 folder, mean in c:\users\xxx\documents\visual studio 2010\templates\itemtemplates\csharp\1033 instead of c:\users\xxx\documents\visual studio 2013\templates\itemtemplates\csharp\1033 anybody knows how can fix problem?

swing - Animating two images in java -

i'm quite new java. need animate 2 images on java game. it's meant spaceship game allowing 2 users control objects, using keyboard. i've partially implemented this, cannot understand how allow 2 keyboard controls, , 1 object moving via keyboard input flickering lot. public class mainframe extends jframe implements keylistener { mainpanel mpanel; mainpanel secondss; mainpanel thirdss; int speed = 5; //ss facing north int direction = 0; mainframe() { settitle("spaceship game"); mpanel = new mainpanel("c:/img"); secondss = new mainpanel("c:/img"); setsize(1024, 768); setdefaultcloseoperation(jframe.exit_on_close); add(mpanel); // add mainpanel jpanel jframe setvisible(true); // show class add(secondss); add(thirdss); seconds.currentss.setx(400); secondss.currentss

How to send data to the controller from the Kendo UI TreeView -

i have 2 treeviews, 1 has list of countries, , other empty, want drag , drop selected countries second tree-view. don't know how send data controller treeview , there text field on page in form. so, how can send both form data , treeview's data controller. here code second tree-view empty , want add selected nodes to: @(html.kendo().treeview() .name("treeview-right") .draganddrop(true) .events(events => events .drag("ondrag") .drop("ondrop") ) ) please try below code snippet. html/view <div style="border: 1px solid green;"> <div id="treeview-left"></div> </div> <div style="border: 1px solid red;"> <div id="treeview-right"></div> </div> <div id="mydiv" onclick="savedata()">click me save data</div> <script> $("#treeview-left").kendotreeview({

python - Removing charaters from a txt file -

how open txt file , remove som special characters form tweets txt file. my text looks somthing this @xirwinshemmo follow :) hii... if u want make new friend add me on facebook! :) xx https:\/\/t.co\/rcyfvrmddg @ycmap enjoy tmrro. saw them earlier wk here in tokyo :) i have rid of starts @ , every webpage (http) how do that? i have tried far. import re = [] open('englishtweets1.txt','r') inf: = inf.readlines() line in a: line = re.sub(r['@'], line) use this import re data = open('englishtweets1.txt').read() new_str = re.sub(r'^@', ' ', data) new_str = re.sub(r'^https?:\/\/.*[\r\n]*', '', new_str, flags=re.multiline) #open('removed.txt', 'w').write(new_str) (if needed) update working tested new_str = re.sub(r'https.(.*?) ', '', new_str, flags=re.multiline)

c - Memory leak during insert -

writing arraytable implementation , getting memory leak warning valgrind during insert function. void table_insert(table *table, key key, value value){ arraytable *tmptable = (arraytable*)table; arrayelement *tmpelement = malloc(sizeof(arrayelement)); tmpelement->key = key; tmpelement->value = value; //hitta nästa tomma index if(tmptable->noelements < max_size){ for(int = min_size; < max_size; i++){ if(!array_hasvalue(tmptable->values,i)){ array_setvalue(tmptable->values,tmpelement,i); //quit loop = max_size; tmptable->noelements++; } } } }//end table insert==20201== i have tried free memory in case wasn't passed through if-statements still no luck. got suggestions on i'm doing wrong? edit valgrind output: ==20201== ==20201== heap summary: ==20201== in use @ exit: 224 bytes in 56 blocks ==20201== total hea

c# - ArgumentException: The parameters dictionary contains an invalid entry for parameter -

there different action in controller. 2 links, 1 each action (as menu) clicking on each work without problem, switching between 2 actions clicking on links raises following error (sometimes) [argumentexception: parameters dictionary contains invalid entry parameter 'vm' method 'system.web.mvc.actionresult overview(poject.areas.area1.models.viewmodel2vm)' in 'poject.areas.area1.controllers.controllera'. dictionary contains value of type 'poject.areas.area1.models.viewmodel1vm', parameter requires value of type 'poject.areas.area1.models.viewmodel2vm'. parameter name: parameters] system.web.mvc.actiondescriptor.extractparameterfromdictionary(parameterinfo parameterinfo, idictionary`2 parameters, methodinfo methodinfo) +733 most of times works, error displayed. viewmodelclasses inherit same viewmodelbase class. reason? any welcome the error seems clear: need type poject.areas.area1.models.viewmodel2vm , in

Java Swing: Resizing component in JFrame without affecting other components -

Image
i have simple game i'm creating novice project. it's based on online card game called "castlewars". there 2 players, each tower affected cards , opponent play. @ moment have basic framework of collections , classes need make game operate @ simple level, i'm having problems displaying these effects user. have following code, should update, amongst other things, 2 jlabels on jframe gui (constructed in netbeans 7.4) represent player's towers: private void adjustscreen(){ system.out.println (integer.tostring(jlabel1.getsize().height)); jlabel1.setsize(100, (playerred.gettower().currentheight() * 2)); system.out.println(integer.tostring(playerred.gettower().currentheight() * 2)); system.out.println (integer.tostring(jlabel1.getsize().height)); jlabel2.setsize(100, (playerblue.gettower().currentheight() * 2)); jlabel5.settext(integer.tostring(playerblue.gettower().currentheight())); jlabel6.settext(integer.tostring(playerblue.getgol

javascript - Run each() function in order of number of parents -

i need run function once every element matches .myclass - needs run in order of how many parents each element has. $('.myclass').each(function(index){ //my code }); the thing can think of doing doing each() function before 1 appends data-sort attribute based on parents().length() surely there's better way that? map number of parents along element array of objects. sort , iterate result. var els = $('.myclass'); var data = els.map(function(index, el){ return {el: el, pars:$(el).parents().length}; }).toarray() .sort(function(a,b) { return a.pars - b.pars; }); $.each(data, function(i, obj) { var el = obj.el; // el });