Posts

Showing posts from April, 2014

VBA excel combobox.dropdown method only woks with every other box -

i have form 3 comboboxes. when run wish able cycle through them using tab key , when each box has focus list drop down automatically (so don't have press down arrow). in form code have following private sub combobox1_enter() combobox1.dropdown end sub with same combobox 2 & 3 however work every other box. on initial run, combobox1 has focus - no drop down appears. press tab & combobox2 gets focus , dropdown appears. press again cpmbobox3 gets focus - no dropdown. press again combobox1 takes focus again , dropdown list apears , on, if click on box, list dropdown. if put object such text box in between each combobox dropdown method work each combobox. any 1 ideas why dropdown method won't work consecutive comboboxes when using tab? yes happens because tabing interferes normal functioning. try (tried , tested ) logic : capture tab key (keycode: 9) , set 0 , move next combo using code. code : option explicit dim long '~~> adding s...

python - send report in specific json format -

views.py def json(request): defaultnumber = [] phoneinfo = phoneinfo.objects.filter(user = user_id) phone in phoneinfo: phone_no = {'id':some.id, 'name1':phone.name1, 'number1':phone.number1, 'name2':phone.name2, 'number2':phone.number2, } } defaultnumber.append(phone_no) result = { 'phone':defaultnumber} return httpresponse(json.dumps(result), mimetype="application/json") i need send data json format. use model_to_dict instead: from django.forms.models import model_to_dict def json_view(request): phoneinfo = phoneinfo.objects.filter(user = user_id) phones = [model_to_dict(phone) phone in phoneinfo] result = {'phoneinfo': phones} return httpresponse(json.dumps(result), mimetype="application/json") and, d...

jquery - Output HTML in JSON string generated by PHP -

i have php outputs json. <?php $html = utf8_encode($gegevens['tekst']); $html = htmlentities($html); //$html = htmlspecialchars($gegevens['tekst'], ent_quotes, 'utf-8'); echo json_encode(array( 'titel' => $gegevens['titel'], 'html' => $html )); ?> the output like: {"titel":"here comes title","html":"<strong>here html<\/strong>\n<br \/>\n<br \/>\n , more."} and jquery/ajax be: $.ajax({ type: "get", url: "content/popup.php?id=" + id2, datatype: 'json', crossdomain: true, success: function(json) { var titel = json['titel']; var html = json['html']; function contenttonen() { // div...

javascript - Ember.TextField : Access to jquery object -

my first post on stackoverflow. (and english not native tongue). i trying learn how use emberjs. it's not easy because of lack of tutorials. so decided code chat, use nodejs , socket.io server-side. html <script type="text/x-handlebars"> <div class="page"> <div class="users"> </div> <div class="messagebox"> {{#view app.textfield valuebinding="currentmsg" placeholder="your message"}}{{/view}} <button {{action "sendmsg"}}>send</button> </div> <div id="chatbox"> {{#collection contentbinding="app.msgscontroller" tagname="ul"}} <b>{{value}}</b> {{/collection}} </div> </div> </script> javascript var id; var socketio = io.connect("127.0.0.1:8888"); socketio.on('id', function (data) { id = data; }); socketio.on(...

Transforming XML to HTML on the fly, and adding JavaScript events? -

i'm running django site xml text stored in textfield properties. it's stored xml rather plain text because it's heavily annotated information underlying manuscript, such abbreviations , symbols. here's example: class entry(models.model): # name , description. chapter = models.foreignkey(chapter) latin_text = models.textfield() here's example of content of latin_text : <initial type="2">i</initial>n <place type="0"><span>ricmond</span></place> ten<abbr type="1">et</abbr> aeccl<abbr type="0">esi</abbr>a de cietriz .ii. hid<abbr type="0">as</abbr>. i'd start displaying xml text on html pages. i know can display raw xml dropping textarea : issue i'd display in more beautiful way, with: styling (all abbr elements in italics, place element in bold) javascript events let user explore abbreviations (when user mouses ...

partitioning - How to see which MySQL partitions are chosen? -

i'm running query against partitions table performance terrible. have feeling doing full table scan instead of scan of 2 or 3 partitions. partition key in clause. is there way can check partitions looked @ answer query? there explain tell me partitions use? any tips using partitions in joins? i'm using mysql 5.6.11 thanks try use explain partitions select * tbl1 inner join tbl2 on tbl1.id=tbl2.id

perl - Print Armstrong numbers between 1 to 10 million -

how write logic using for loop or while loop printing armstrong numbers ? someone kindly explain how print armstrong numbers between 1 1,00,00,000. this algorithm followed step 1 : initializing variable min,max,n,sum,r,t step 2 : $n = <>; step 3 : find base of $n step 4 : using loop ( (n = min; n < max ; n++ ) step 5 : logic n=t,sum =0,r=t%10,t=n/10, step 6 : sum = sum + (n ^ base ); step 6 : if ( sum == num ) print armstrong numbers else not. i tried code code this #!/usr/bin/perl use strict; use warnings; use diagnostics; $n; chomp($n); $min = 1; $max = 10000000 $r; $sum; $t; $base = length($n); print "base $base\n"; ($n = $min; $n <= $max; $n++) { $t = $n; $sum = 0; while ($t != 0) { $r = $t % 10; $t = $t / 10; { $sum = $sum + ($base * $r); } if ($sum == $n) { print "$n\n"; } } } several things: it's bad practice declare my until need i...

javascript - Make scrolling jump to the next image in a list (not be continuos) -

how can make similar effect below. when scroll scrolling isnt continuos, instead jump next image down. http://www.yesstudio.co.uk/ i image pretty complicated js im open other solutions achieve similar affect. i think you'll need use js. use jquery. shouldn't complicated. if @ page source, you'll see images loaded in order. have put 1 <div style='width:100%;height:100%;position:fixed;z-index:2'> <img id='pic' src=''> </div> into html, , update src atribute depending on $(window).scrolltop() . think jquery has function tells elements visible. not sure though. up. give thought.

jcifs - Login on smb with java -

i'm trying list of files of smb-share secured user , password. working perfectly. if try open file on smb-share, windows requires me login again in prompt. have required username , password. can login in code before opening file? accessing files jcifs: ntlmpasswordauthentication auth = new ntlmpasswordauthentication( rootfolderpath, user, passwort); smbfile smbserver; try { smbserver = new smbfile("smb://" + rootfolderpath, auth); } catch (malformedurlexception e) { e.printstacktrace(); continue; } catch (smbexception e) { e.printstacktrace(); } a solution usage of "net use"

c++ - What does new uint8_t(64) do? Do POD types have constructors? -

i made mistake in code. wrote like: uint8_t * var = new uint8_t(64); instead of: uint8_t * var = new uint8_t[64]; the compiler (gcc) did not complain, @ execution, segfault message: ... free(): invalid next size (fast): ... running valgrind (memchecker): following diagnostic: invalid write of size 8 i tried gcc 4.7.2, producing 64-bit executable, running on linux. tried gcc 4.5.2, producing 32-bit executable , same kind of issue , diagnostic. it looks memory gets allocated, not amount indicated between parenthesis. what did do? uint8_t * var = new uint8_t(64); // dynamically allocated 1 uint8_t object, , // initialize 64 uint8_t * var = new uint8_t[64]; // dynamically allocate space // 64 uint8_t objects (no initialization)

jQuery show div on radio select with auto check radio option -

i'm using jquery show/hide div on radio select. works fine, wan't extend it, specific radio selected default on page load. here's html <input type="radio" id="payment1">payment1 <input type="radio" id="payment2">payment2 <div id="paymentcontainer1" style="display:none;">payment 1 container</div> <div id="paymentcontainer2" style="display:none;">payment 2 container</div> jquery $(document).change(function () { if ($('#payment1').prop('checked')) { $('#paymentcontainer1').show(); } else { $('#paymentcontainer1').hide(); } if ($('#payment2').prop('checked')) { $('#paymentcontainer2').show(); } else { $('#paymentcontainer2').hide(); } }); here's fiddle http://jsfiddle.net/teva/yaucs/1/ i tried adding $("#payment1...

java - OpenGL + Slick Loaded Textures Are Rotating -

Image
i using opengl create 3d game engine in java . , using slick library implement textures. using method create rectangle/square prisms (6 squares/rectangles). in same method, implement textures. the problem 5 sides of prism render 90 degrees rotated textures. doesn't matter when maing floor since using on brick wall texture isn't looking right. since wall care 4 sides of it. the wall texture being rendered 90 degrees rotated on 3 sides of prism. , rendered without rotation on 1 side. i couldn't work problem out. need change how texture implemented? here method creating prism. public static void quadprizm(float x, float y, float z, float sx, float sy, float sz, texture tex){ glpushmatrix(); { gltranslatef(x, y, z); tex.bind(); glbegin(gl_quads); { //rotated (wrong) gltexcoord2f(0, 0); glvertex3f(-sx/2, -sy/2, sz/2); gltexcoord2f(0, 4); glvertex3f(sx/2, -sy/2, sz/2); gltex...

sql - Oracle: Check constraint for both alphabetical and numerical characters in varchar2 -

so want check varchar2 in format of 4 alphabetical characters 3 numerical characters e.g. aabb123 or lmno987 so far i've tried: constraint code_check check (regexp_like(code,'[^a-z][^a-z][^a-z][^a-z][0-9][0-9][0-9]')) constraint check_code check (code '[^a-z][^a-z][^a-z][^a-z][0-9][0-9][0-9]' constraint check_code check (code '[a-z][a-z][a-z][a-z][0-9][0-9][0-9]') constraint check_code check (code regexp_like '[a-z][a-z][a-z][a-z][0-9][0-9][0-9]') constraint check_code check (code '[^a-z]{4}[0-9]{3}') but error: insert table1 (code) values ('help555') error report: sql error: ora-02290: check constraint (bob.table1_check_code) violated 02290. 00000 - "check constraint (%s.%s) violated" *cause: values being inserted not satisfy named check *action: not insert values violate constraint. the regular expressions not right, , way you've used pretty cumbersome. instead, can opt use posix character cl...

Python: best way to find out from which set the results of `symmetric_difference` are from? -

what best practice finding out set results of symmetric_difference from? intersect = s1.symmetric_difference(s2) the result should {'34':'s1', '66':'s2'} where '34','66' unique items. to cleanly, following should work: intersect = s1.symmetric_difference(s2) result = dict([(i, ("s1" if in s1 else "s2")) in intersect])

Graphite not showing labels when rendered using wildcards -

in order generate graphs in graphite, using url render api. url of form- <ip>/render?&target=stats.beta.*.ip-10-0-0-179.counter.ant.*.*.succeeded&title=notification&linemode=connected the graph have title, individual 5 lines not have alias. alias function doesn't work wildcards. aliasbynode(serieslist, *nodes) works wildcards. function name quite confusing, splits key dots , takes i-th value specified second argument. indexed 0. &target=aliasbynode(ganglia.*.cpu*.load5, 1) ^ \ name series part you can specify multiple parts use lengend: aliasbynode(localhost.*.cpu-{system,user,wait}),0,2) ^ ^ \-----------\-should take these 2 -> 'localhost-cpu-system'

vim - Replace ANSI color code from string in vimscript -

i have string variable in vimscript contains ansi escape characters used highlighting purposes. string looks like, ^[[32m mystringbody ^[[0m i've put escape code literally vim displays it, escape sequence - ctrl-v-[. i want replace occurences of such escape characters substitute command. substitute(my_variable, pattern, '', 'g') can me regex pattern remove these escape characters. thanks. the special atom \e matches <esc> = ^[ : substitute(my_variable, '\e\[[0-9;]\+[mk]', '', 'g') you use \%d27 ( <esc> decimal 27) or \%x1b (hexadecimal). pattern should match (most) ansi escape sequences.

android - Run project problems using Eclipse -

Image
i have cloned repository bitbucket.org (it repo). can't run project. i made next: import -> project git follow importing guide maybe selected wrong. can see files in project tree have cloned can't run it. what's problem? when select run in menu don't see option (only run configuration), want see run android project. i try add project using run configuration don't see ea project in project selection list. i don't think eclipse seeing android project. when clone git, @ last step of importing wizard, try , selecting create new project , select android project.

Grails development enviornment page loads very slow -

so i'm getting page load times in range of 30-45 seconds. some history: this not case project. project in production haven't touched code in while. noticed started happening last time updating code. don't recall specific changed should have problem. have other projects running same grails versions no problem. i think started happening in 2.2.3. running 2.2.4. i using x64 jdk 1.7.0_25, windows 7 x64. i'm not sure else put here relevant. assistance appreciated! edit : running -noreloading has no effect. edit2 : i've tried deleting .grails folder entirely, running clean , , deleting target folder , stacktrace log. edit3 : seem amount of time takes dependent on amount of data displayed/read. small pages take 3-4 seconds. medium pages 10-12 seconds... edit4 : i'm running via intellij idea 12.1.4 x64 (idea64.exe). i've tried outside of intellij same results. edit5 : database oracle enterprise supports entire company. managed full time admi...

objective c - Can't see the button -

- (void)viewdidload{ int leftborder = 80; int topborder = 160; int width = 150; int height = 50; uiview *myview = [[uiview alloc] initwithframe:cgrectmake(leftborder, topborder, width, height)]; myview.layer.cornerradius = 5; myview.backgroundcolor = [uicolor redcolor]; [self.view addsubview:myview]; uibutton *testbutton = [uibutton buttonwithtype:uibuttontyperoundedrect]; testbutton.frame = cgrectmake(0, 0, 50, 50); [testbutton settitle:@"testbutton" forstate:uicontrolstatenormal]; [testbutton addtarget:self action:@selector(buttonclicked:) forcontrolevents:uicontroleventtouchupinside]; [self.myview addsubview:self.testbutton]; self.myview.hidden = yes; [super viewdidload]; } hi, sorry stupid question! i'm newby in xcode. why didn't see button? , how can hide button after click? need button inside frame. simple remove self.myview.hidden = yes; to add click listener, 2 solution: by cod...

html - What is taking up space in web page? -

i have 5 links next each other, , although set @ 20% width, last 1 goes onto next line. however, when set 19.5%, it's fine. made sure set padding , margin body, links, , containing elements 0. although it's not major problem, information on appreciated. here html: <div id="top"> <img src="someimage" /> <nav id="nav"> <a href="link1.html">link1</a> <a href="link2.html">link2</a> <a href="link3.html">link3</a> <a href="link4.html">link4</a> <a href="link5.html">link5</a> </nav> </div> and css: body { background-color: white; margin: 0; padding: 0; } #top { background-color: #aaaaaa; height: 50px; } #nav > { display:inline-block; height: 25px; width: 19.5%; background-color: #aaaaaa; margin: 0; padding: 0...

design - Where is a good place to ask questions about Database-Models? -

i'm developing browsergame on own , have problems database-model. where place solve problems? i don't think here best place this, can't find place, can discuss such problems. in places can ask specific questions "how normalize table a" if ask questions "how put contest uefa-championsleague database(teams, players, qualification, groups, finals)" answer "please more specific". i'm searching community people willingly discuss such problems. can hint me in right direction? https://gamedev.stackexchange.com/ - or https://gamedev.stackexchange.com/questions/19727/browser-game-database-structure try there ... it's dedicated gamedev

java - Why Lint give an advice to make my constructor protected for abstract class? -

i'm wondering behind lint's advice of making constructor of abstract class protected? non-child classes can't call constructor of abstract class (it's not possible). classes can call constructor children of abstract class. setting constructor protected allows child classes see constructor. edit: more information, see question . also, joop correct anonymous implementations (i didn't know in java). however, have never seen that.

css - Forms: centering vertically -

at current project i've 1 problem in forms. possible, font-size of label in form higher default. if raise up, input on right side must centering vertically. i took @ bootstrap , foundation, both hadn't solution problem. <form action="" class="m-form"> <ol> <li> <label for="sample">a sample label</label> <input type="text" id="sample" class="m-form__textfield" value="a sample input"> </li> </ol> .m-form { ol { list-style: none; margin: 0; padding: 0; } label:first-child { box-sizing: border-box; display: block; float: left; padding: .25em 2em .25em 0; width: 50%; font-weight: bold; line-height: 1.5; text-align: right; } .m-form__textfield { box-sizing: border-box; float: left; padding: .5em; width: 50%; border: 1px solid #ccc; border-radius: 3px; } } ...

c# - How can I implement IEnumerator<T>? -

this code not compiling, , it's throwing following error: the type 'testesinterfaces.mycollection' contains definition 'current' but when delete ambiguous method, keeps giving other errors. can help? public class mycollection<t> : ienumerator<t> { private t[] vector = new t[1000]; private int actualindex; public void add(t elemento) { this.vector[vector.length] = elemento; } public bool movenext() { actualindex++; return (vector.length > actualindex); } public void reset() { actualindex = -1; } void idisposable.dispose() { } public object current { { return current; } } public t current { { try { t element = vector[actualindex]; return element; } catch (indexoutofrangeexception e) { ...

sql - Get all rows with a matching field in a different row in the same table -

let's have table this: |id|userid|email |website | -------------------------------------- |1 |user1 |user1@test.com|website.com| |2 |user2 |user2@test.com|website.com| |3 |user3 |user3@test.com|website.com| |4 |user1 |user1@test.com|foo.com | |5 |user2 |user2@test.com|foo.com | and want of rows website='website.com' , have corresponding row matching userid website='foo.com' so, in instance return rows 1 , 2. any ideas? to user can do select userid your_table website in ('website.com', 'foo.com') group userid having count(distinct website) = 2 but if need complete row do select * your_table userid in ( select userid your_table website in ('website.com', 'foo.com') group userid having count(distinct website) = 2 )

wcf - The security protocol cannot secure the outgoing message -

i trying return custom fault exception using unity following error during rst\issue action: [service trace viewer exceptions][1] image: [1]: http://i.stack.imgur.com/oaxgt.png no signature message parts specified messages ' http://tempuri.org/iwcfservicelayer/getfirstorder ' action. the security protocol cannot secure outgoing message requestcontext aborted i using custmbinding resembles wshttpbinding. here manually throw exception in wcf method, in order test behaviour. when comment out throw new exception statement, service works fine , returns expected results. service cannot handle exceptions currently. so why can't service secure outgoing message when exception occurs? edit (bindingconfig): <custombinding> <binding name="myservicebinding" closetimeout="00:05:00" opentimeout="00:05:00" receivetimeout="00:05:00" sendtimeout="00:05:00"> <transactionflow /> ...

c# - Programmatically Assigning Roles to User in MVC 4 via Checkboxes -

i using mvc 4 razor engine , c# code behind logic. customised version of simplemembership database has been built meet requirements of website. the website can create , edit roles , users intended, having problem assigning role user. search results provide code assign particular role user on account creation. our requirements not have this, instead need manually assign them using ui via website. there plenty of tutorials asp.net (example below), finding difficult locate relevant tutorial mvc 4. http://www.asp.net/web-forms/tutorials/security/roles/assigning-roles-to-users-cs after reading above, asking following questions. question one: there mvc tutorial assigning user roles via ui? if so, can provide link tutorial. question two: if not have link tutorial, provide advice on following: when administrator loads user management ui table load list of users, when click edit button particular user following take effect , pass data view called 'edit.cshtml'. pu...

Unable to play video in android -

i want play video in video player unable so. when start application shows list of videos details thumbnail, video url, time, total no of views etc. want play video clicking on thumbnail, when click on thumbnail different event, , video_url must lost in event. how can capture ?

PDF Parsing tables in java with Pdfbox -

i've been looking quite long time answer, haven't found anything. problem in parsing pdf, have page made kind of tables. i've written code via can extract iformation specified rectangle, declaring values in code , not dynamic should. want find information cells , information able string need. in pdfbox api haven't found useful. graceful tips.

sql - One synonym in SSMS isn't showing up in the intellisense. But every other synonym is. -

Image
in following image, can see small section of our synonym list. in intellisense, can't see dbo.syn_mc_asset , see other synonyms. ideas on why occurring?

How do i go from one function (main) to another without finishing main?(in C) -

Image
i beginner in c , there 1 problem can't seem solve. want go main() example, function line or 2 of code. have searched internet , nothing has answered specific question, or seems amateur eyes. example, want this: int main(void){ /*here need line of code make program run functiontocall*/ } int functiontocall(void){ printf ("you went function! congratulations!\n"); } i hope helps sorry unclear question! i think in understanding how method call works so when call method x method y control x passes y , return x when return statement/last statement of called method encountered

php - Dropdown values are not inserting in mysql -

in code dropdown values not inserting mysql database.the exam_name inserting course_code col.and course_code value not inserting in mysql.so please me.the exam_name populate examcourse when selected course_code corresponding exam_name wil display exam_course. upload2_view.php <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".hai").change(function() { var id=$(this).val(); // please find course_code, course_code not found var datastring = 'course_code='+ id; $.ajax ({ type: "post", url: "upload_view2.php", data: datastring, cache: false, success: function(html) { $(".hai2").html(html); } }); ...

symfony - How to get child object in embedded Admin class in Sonata Admin? -

i'm trying , manipulate actual object related imageadmin class in sonataadmin (using symfony 2.3). works fine when imageadmin class 1 being used. when imageadmin embedded in admin goes horribly wrong. here's works when don't have embedded admins: class imageadmin extends admin { protected $baseroutepattern = 'image'; protected function configureformfields(formmapper $formmapper) { $subject = $this->getsubject(); } } but when embed imageadmin in parentadmin using this: class pageadmin extends admin { protected function configureformfields(formmapper $formmapper) { $formmapper->add('image1', 'sonata_type_admin'); } } then when you're editing parent item id 10 , call getsubject() in imageadmin image id 10! in other words getsubject() extracts id url calls $this->getmodelmanager()->find($this->getclass(), $id); , cross-references parent id , image id. oops! so... want able hold ...

Python text file searching for values and compiling results found -

i have large text file of lots of experimental results search through specific pieces of data, need compile. text file has results many different experiments, , need keep data each experiment together. e.g. (not actual data) object 1 colour of object blue. size of object 0.5 m^3 mass of object 0.8 g object 2 colour of object pink. size of object 0.3m^3 etc. i know values want be, can search text specific phrase know present on line data on. one way thought of doing search through file each specific line (i'm looking 2 different variables), , add value needed list. create dictionary each object, assuming @ same number in each list data same object. e.g. variable_one = [] variable_two = [] def get_data(file): open("filename.txt", "r") file: line in file: if "the colour" in line: variable_one.append(line.split()[6]) if "the mass" in line: variable_two.append...

java - String.replaceAll() with [\d]* appends replacement String inbetween characters, why? -

i have been trying hours regex statement match unknown quantity of consecutive numbers. believe [0-9]* or [\d]* should want yet when use java's string.replaceall adds replacement string in places shouldn't matching regex. for example: have input string of "this my99string problem" if replacement string "~" when run this mystring.replaceall("[\\d]*", "~" ) or mystring.replaceall("[0-9]*", "~" ) my return string "~t~h~i~s~ ~i~s~ ~m~y~~s~t~r~i~n~g~ ~p~r~o~b~l~e~m~" as can see numbers have been replaced why appending replacement string in between characters. i want "this my~string problem" what doing wrong , why java matching this. \\d* matches 0 or more digits, , matches empty string. , have empty string before every character in string. so, each of them, replaces ~ , hence result. try using \\d+ instead. , don't need include \\d in character class.

fault tolerance - Reconnection to Redis after reboot -

i've bunch long running processes connect redis server (using jedis). works fine long don't reboot machine running redis or restart redis server. reboot or restart connection lost. there standard way of dealing use case in redis/jedis or need put logic in clients myself? redis failure/connection dropped in case, redis either goes down or drops connection while process remains active. ensure process gets connection, use testonborrow=true in jedis connection/pool config. jedis test each connection 'ping' before using it; if redis not respond, connection discarded , try connection. machine reboot/restart (not redis) if application node fails or reboots, "processes" should configured restart automatically upon reboot (if that's behavior desire), or starts manually. in either case, i'd expect process create , initialize new jedis connection before real work...so else need beyond that?

Rails Associations -

i have 2 tables, movies , likes. movie has_many :likes, dependent: :destroy, foreign_key: "movie_id" , belongs_to :movie in likes controller there 2 actions: uplikes (where :vote=>1) , dislikes (where :vote=>2) in movies/show.html.erb show amount of uplikes , dislikes movie has such : view show.html.erb <%= @uplikes.size %> <%= @dislikes.size %> controller def show @uplikes = like.where(:movie_id => params[:id], :vote => '1') @dislikes = like.where(:movie_id => params[:id], :vote => '2') this works fine. have problems displaying amount of dislikes , uplikes of movie in index action when calling movies.each i have pasted above controller code def show action def index action , changed params[:id] params[:movie_id] but when call <%= @uplikes.size %> <%= @dislikes.size %> to view, displays 0 if rid of :movie_id => params[:id], in controller, shows number of uplikes , d...

stored procedures - Return row ID from StoredProcedure MySQL -

i attempting return value of row statement: insert systemname (systemname) select * (select v_systemname) tmp not exists ( select * systemname systemname = v_systemname ) limit 1; set id = last_insert_id(); if insert need return row id, otherwise needs return new row id. tried use last_insert_id() didn't return needed because if didn't insert give wrong result. have idea make work? http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id assuming procedure expects row id , no further processing done can try: select last_insert_id();

Google chrome wont display SVG search icon, but the SVG background is OK -

i have svg background, looks find in both ff & chrome, search icon, ok in ff , wont display in chrome. both svgs load external css stylesheet. here shot: http://imgs.ir/imgs/201308/svg.png let me know if jsfiddle needed.

.net - Extension can't be found -

my wcf - configuration runs fine on developer machine. when try release demonstration environment (another server), give me following error: an error occurred creating configuration section handler system.servicemodel/behaviors: extension element 'log4net' cannot added element. verify extension registered in extension collection @ system.servicemodel/extensions/behaviorextensions. my configuration, in both cases same: <system.servicemodel> <services> <service name="ui.ws.services.myservice" behaviorconfiguration="servicebehavior"> <endpoint address="" binding="wshttpbinding" contract="ui.ws.services.imyservice" bindingconfiguration="wssecuritymode"> <identity> <dns value="localhost" /> </identity> </endpoint> ...

html - how to make this div resizable -

i have these 2 divs: <div class="bubble"> blablablabla <div class="arrow-left"></div> </div> . .bubble{ background-color:#156ac6; padding: 15px 10px 10px 10px; color: white; font-family:georgia; } .arrow-left { position:relative; top:42px; right:0; border-left: 42px solid transparent; border-right: 0px solid transparent; border-top: 42px solid #156ac6; margin: 10px; } http://jsfiddle.net/jgwmm/ i want flexible, e.g. if resize browser, should shrink according width of browser. dont want media queries. css. how possible? since haven't set widths on divs, should resize according browser default. however, can set widths in percent sure: .bubble { width: 100%; } .arrow-left { width: 100%; } also don't need media queries media queries css.

c# - How to emit LDC_I8 for a ulong.Parse call? -

i'm having issue emitting il set uint64 property value. below minimal code reproduce issue. using system; using system.reflection; using system.reflection.emit; namespace consoleapplication1 { class program { static void main(string[] args) { assemblybuilder assemblybuilder = appdomain.currentdomain.definedynamicassembly( new assemblyname("test"), assemblybuilderaccess.runandsave); modulebuilder m_modulebuilder = assemblybuilder.definedynamicmodule("test.dll", "test.dll"); typebuilder typebuilder = m_modulebuilder.definetype("class1", typeattributes.public | typeattributes.class | typeattributes.autoclass | typeattributes.ansiclass | typeattributes.beforefieldinit | typeattributes.autolayout, null); fieldbuilder fieldbuilder = typebuilder.definefield("m_prop1", typeof(ulong), fieldattributes.private); methodb...

android - Open Web Browser from App - Always Crashes -

i'm trying open web browser app using: intent browser = new intent(intent.action_view, uri.parse("http://developer.android.com/")); startactivity(browser); but app crashes: 08-07 17:18:29.912: e/androidruntime(751): fatal exception: main 08-07 17:18:29.912: e/androidruntime(751): java.lang.nullpointerexception 08-07 17:18:29.912: e/androidruntime(751): @ android.app.activity.startactivityforresult(activity.java:3131) 08-07 17:18:29.912: e/androidruntime(751): @ android.app.activity.startactivity(activity.java:3237) 08-07 17:18:29.912: e/androidruntime(751): @ com.co.drumkit$9.onclick(drumkit.java:658) 08-07 17:18:29.912: e/androidruntime(751): @ android.view.view.performclick(view.java:3110) 08-07 17:18:29.912: e/androidruntime(751): @ android.view.view$performclick.run(view.java:11934) 08-07 17:18:29.912: e/androidruntime(751): @ android.os.handler.handlecallback(handler.java:587) 08-07 17:18:29.912: e/androidruntime(751): @ android.os.hand...

Equivalent of C's pointer to pointer in Java -

this question has answer here: c++ pointers pointers in java 5 answers i unable pass pointer pointer argument function in java.i know java don't have pointers instead pass reference objects. want know how done. clear doubt pasting code snippet of program implementing. in following program calling method "partition" method "quicksortrecur". work on c of time don't know how send parameters newhead , newend pointer pointer . i have mentioned c equivalent of below lines , want know how can implement same in java? java : public listnode partition(listnode lhead,listnode lend,listnode newhead,listnode newend){ --------- --------- --------- } public listnode quicksortrecur(listnode lhead,listnode lend){ listnode newhead=null; listnode newend=null; listnode pivot; pivot=partition(lh...

python - Take certain words and print the frequency of each phrase/word? -

i have file has list of bands , album , year produced. need write function go through file , find different names of bands , count how many times each of bands appear in file. the way file looks this: beatles - revolver (1966) nirvana - nevermind (1991) beatles - sgt pepper's lonely hearts club band (1967) u2 - joshua tree (1987) beatles - beatles (1968) beatles - abbey road (1969) guns n' roses - appetite destruction (1987) radiohead - ok computer (1997) led zeppelin - led zeppelin 4 (1971) u2 - achtung baby (1991) pink floyd - dark side of moon (1973) michael jackson -thriller (1982) rolling stones - exile on main street (1972) clash - london calling (1979) u2 - can't leave behind (2000) weezer - pinkerton (1996) radiohead - bends (1995) smashing pumpkins - mellon collie , infinite sadness (1995) . . . the output has in descending order of frequency , this: band1: number1 band2: number2 band3: number3 here code have far: def read_albums(filename) : fi...

ASP.NET web service does not connect with database in IIS7 -

when try publish asp.net web service application on iis7, application works perfect when debugging visual studio. but, when try access webservice iis typing on browser: http://localhost:port/service1.asmx , click on method , click "invoke" gives me error: system.data.sqlclient.sqlexception: select permission denied on object &#39;marimi&#39;, database &#39;emagazin&#39;, schema &#39;dbo&#39;. @ system.data.sqlclient.sqlconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose) @ system.data.sqlclient.tdsparser.tryrun(runbehavior runbehavior, sqlcommand cmdhandler, sqldatareader datastream, bulkcopysimpleresultset bulkcopyhandler...

2d - R aggregate data in one column based on 2 other columns -

so, have these data given below, , goal aggregate column v3 in terms of columns v1 , v2 , add v3 values each bin of v1 , v2. example, first line correspond interval v1=21, v2=16, value of v3 aggregated on (v1,v2) interval. , repeat rest of rows. want use mean aggregation function! > df v1 v2 v3 1 21.359 16.234 24.283 2 47.340 9.184 21.328 3 35.363 -13.258 14.556 4 -29.888 14.154 17.718 5 -10.109 -16.994 20.200 6 -32.387 1.722 15.735 7 49.240 -5.266 17.601 8 -38.933 2.558 16.377 9 41.213 5.937 21.654 10 -33.287 -4.028 19.525 11 -10.223 11.961 16.756 12 -48.652 16.558 20.800 13 44.778 27.741 17.793 14 -38.546 29.708 13.948 15 -45.622 4.729 17.793 16 -36.290 12.383 18.014 17 -19.626 19.767 18.182 18 -32.248 29.480 15.108 19 -41.859 35.502 8.490 20 -36.058 21.191 16.714 21 -23.588 0.524 21.471 22 -24.423 39.963 18.257 23 -0.042 -45.899 17.654 24 -35.479 32.049 9.294 25 -24.632 20.603 17.757 26...