Posts

Showing posts from May, 2010

Can I have conditional constants in VHDL? -

i have entity has generic integer parameter fs_in_khz can 5, 10 or 2: entity test_control_source generic( -- should 5, 10 or 20 fs_in_khz : integer := 20 ); it nice if take advantage of vhdl's features , restrict type values, perhaps using like: type control_source_freq (f5_khz, f10_khz, f20_khz); ... entity test_control_source generic( -- should 5, 10 or 20 fs_in_khz : control_source_freq := f20_khz ); however, later on in architecture of entity, have architecture source_behaviour of test_control_source constant cs_period : integer := 5000 * clock_rate / fs_in_khz; begin ... i prefer having parameter computed outside of processes use it, rather repeating computation everywhere it's needed. can restrict allowed values of fs_in_khz generic parameter and keep constant cs_period factored out of processes it's used? create enumerated type in package, suggest also create function called calculate_period take...

java - How to add a parameter to a URL in GWT? -

i have java/gwt application. in there list of items. if click on item title item opened full description. i using anchor item title, want when user clicks on item title in url id of item appended current url. for example, url: "http://127.0.0.1:8888/myapp.html?gwt.codesvr=127.0.0.1:9997#listitem?list" and have append id end of url like: "http://127.0.0.1:8888/myapp.html?gwt.codesvr=127.0.0.1:9997#listitem?list &itemid=55 " using window.location should trick : see doc here something : string url = window.location.gethref(); url = url + "&itemid=" + itemid; window.location.replace(url); although of course, crollster pointed out, should insert url parameter before # sign. give more details on you're looking (why have add parameter manually, page have reload ...)

php - Captcha for Joomla 1.5 and VirtueMart 1 -

i have website running on joomla 1.5 old virtuemart installed. there captcha extension can used virtuemart product enquiry form. have tried , looked on web , joomla extensions , not find 1 works both joomla , virtuemart old versions. i unfortunately cannot upgrade vm or joomla new packages on website. thank in advance! great tutorial, if encounter problems, don't mind ask :) http://forum.virtuemart.net/index.php?topic=66513.0

c# - Unable to access property using MVC3 Razor -

i want access property public string gridhtml { get; set; } that have defined in controller. trying access property using javascript, mvc3 razor this $(document).ready(function() { var str = @model.gridhtml ; } but getting error above variable not defined. can me. in advance. if have passed model correctly following should work, unless razor syntax not residing inside separate js file $(document).ready(function() { var str = '@:model.gridhtml'; console.log(str); }

Call C++ native dll from C# code -

i wrote total native c++ code dll , want call method thru c# code using p/invoke. need change in properties of native dll ? p/invoking requires stdcall convention. if functions declarations preceeded __stdcall. otherwise stack gets corrupted. also @ pinvokestackimbalance c# call unmanaged c++ function

fgetpos available in Go? Want to find File.Position -

i have file , want find file offset/position, fgetpos in stdio . can't seem find in http://golang.org/pkg/io/ . have count myself or there build in method? you should able seek() 0 bytes current position, returns resulting position. i'm not 100% sure result absolute position you're after, expect be.

c# - Mahapps.Metro : The attachable property WindowCommands was not found in type MetroWindow -

i thought i'd try out wpf metro using mahapps.metro , have come across error: the attachable property windowcommands not found in type metrowindow i have included packages nuget , have following xaml: <controls:metrowindow x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:mahapps.metro.controls;assembly=mahapps.metro" title="mainwindow" height="350" width="525"> <window.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="pack://application:,,,/mahapps.metro;component/styles/colours.xaml" /> <resourcedictionary source="pack://application:,,,/mahapps.metro;component/styles/fonts.xaml...

sql server - How to get the name of the DataSource referenced by my shared DataSet? -

i display name of data source used in report, way identify origin of data. i know can display name of embedded datasource : =datasource("name").datasourcereferencestring however report not embed datasource using shared datasets. any ideas ? "doing wrong" ? edit : answers far involve using datasources collection. thing is... report not reference data source whatsoever. reference shared dataset, references data source. approach allows me change data source of reports editing shared dataset. i'm open better ideas. this might u .it represents collection of data sources referenced within body of report datasources("name").type for detail explanation can go through link using global collections in expressions (reporting services)

javascript - How can I detect overwritten css properties? -

Image
i can css properties element document.stylesheets of not active because properties overwritten. in firebug (chrome developer tools has feature), if there's overwritten css property, see that: the way can think of comparing active css property element (in jquery $(element).css(property) ) , defined css property in document.stylesheets it's not reliable way it. suggestion? in webkit, can use getmatchedcssrules achieve want. returns css rule set in order of inheritance applied browser , is webkit inspector used time ago. gecko based browsers firefox there seems polyfill available here although i've not tested it. a basic, working solution the following code available fiddle because getmatchedcssrules only works inline stylesheets , first have inline linked stylesheets: function inlinestyles() { var stylesheets = document.getelementsbytagname('link'), head = document.getelementsbytagname('head')[0]; (var = 0; < sty...

SQL SErver Trigger not evaluating as Insert or Update properly -

i want have 1 trigger handle updates , inserts. of sql actions in trigger both. exception fields i'm using record date , username insert , update. have, updates of fields used track update , insert not firing right. if insert new record, createdby, createdon, lasteditedby, lasteditedon populated, lasteditedon 1 second after createdon (which dont want happen). when update record, lasteditedby & lasteditedon changes (which correct). i'm including full trigger reference: set ansi_nulls on; go set quoted_identifier on; go -- ================================================================================= -- author: paul j. scipione -- create date: 2/15/2012 -- update date: 6/5/2012 -- description: concatenate several fields set formatted unitdescription, -- total span & loop footages, set appropriate acctcode, & track -- user inserts -- ================================================================================= if object_id(...

jquery ui - jqGrid behaving weird with Razor views -

Image
i experiencing weird behavior razor views when using jquery. seem though views having there css changed when modal windows loaded? i can't begin tell why happening. created same views using mvc 2 , had little trouble css overloads. have of experienced similar problems? particularly loading jquery ui , jqgrid application? probably have same problem (or close problem) problem described in the answer . recommend add in css either .ui-jqgrid { font-size: 11px !important; } or alternatively following css .ui-jqgrid .ui-jqgrid-view { font-size: 11px; } .ui-jqgrid .ui-jqgrid-pager { font-size: 11px; } .ui-jqgrid .loading { font-size: 11px; }

javascript - drawImage (canvas) is not working -

i want draw multiple canvases on single canvas using drawimage() method not working code <html> <head> <script> window.onload = function() { var context1= document.getelementbyid("canvas1").getcontext("2d"); var context2 = document.getelementbyid("canvas2").getcontext("2d"); var context3 = document.getelementbyid("canvas3").getcontext("2d"); context1.font = "20pt calibri"; context1.fillstyle = "blue"; context1.filltext("hello ", 50, 25); context2.font = "20pt calibri"; context2.fillstyle = "red"; context2.filltext("world!", 100, 25); var imageobj = new image(); imageobj.onload = function() { context3.drawimage(context1.canvas, 50, 25); context3.drawimage(context2.canvas, 100, 25); }; }; </script> </head> <body> <canvas id="canvas1" ...

c - IP checksum changes automatically -

i new network programming. past couple of days learning that. today tried play raw socket. went well. ip checksum didn't helped me well. whatever value gave manually iph->check, while receiving checksum different. actually did created raw socket c program create tcp packet send loop interface using raw socket. , captured packet wireshark. when interpreting received packet, found whatever value gave check sum in program, shows different constant value. here code #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/ip.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <errno.h> //#include <linux/in.h> unsigned short calculate_check_sum (unsigned short *buf, int nwords) { unsigned long sum; (sum = 0; nwords > 0; nwords--) { sum += *buf++; } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); return ~sum; } int main () { int sockfd ...

ruby - Nokogiri and xpath for extracting table data -

i'm bit of newbie , i'm trying scrape data table, not having luck using xpath. can first field need, then... nothing. the table structure each row follows: <tr bgcolor="#fff7e7"> <td valign="top"><font color="#8c4510"> <span id="datagrid1__ctl3_label2">index</span> </font></td> <td><font color="#8c4510"><a href="javascript:__dopostback('datagrid1$_ctl3$_ctl0','')"><font color="#8c4510">title</font></a></font></td> <td><font color="#8c4510"><a href="javascript:__dopostback('datagrid1$_ctl3$_ctl2','')"><font color="#8c4510">people</font></a></font></td> <td valign="top"><font color="#8c4510">date</font></td><td><font color="#8c4510"><a hr...

java.lang.IllegalArgumentException: Document base tomcat\webapps\appdata does not exist or is not a readable directory -

i had war deployed on local tomcat (6.0.35) instance called appdata.war , , webapps directory looked like: webapps/ docs/ examples/ host-manager/ manager/ appdata/ (exploded war) root/ appdata.war i deleted appdata/ , appdata.war (so tomcat wouldn't try redeploy it) , added new war ( appmon-qa.war ) directory. ran tomcat startup script , saw deployment errors referencing "old" appdata war. poked around , saw folder name located @ ${tomcat.home}/work/catalina/localhost/appdata , deleted (again, prevent tomcat re-deploying it). re-ran startup scripts , seeing in catalina log: severe: error starting static resources java.lang.illegalargumentexception: document base c:\program files\apache\apache-tomcat-6.0.35\webapps\appdata not exist or not readable directory @ org.apache.naming.resources.filedircontext.setdocbase(filedircontext.java: @ org.apache.catalina.core.standardcontext.resourcesstart(standardcontext.java:432...

java - Multiple ResultSet-s with single Statements in JDBC -

connection.createstatement() has no parameters. call statement.executequery() retrieve data. can use single statement instance multiple different queries run? yes, not concurrently. when re-execute statement, the previous result set closed : a resultset object automatically closed when statement object generated closed, re-executed, or used retrieve next result sequence of multiple results.

How expressive can I get with a PowerShell Expression in Format-Table? -

i have following script outputs color coded folder hierarchy of user's exchange mailbox. output line in red if it's on threshold (20 mb in case) , gray if not. #get folder size breakdown table color coding get-mailbox $username | get-mailboxfolderstatistics | ft @{ name="name" expression= { $prefix="" foreach($c in $_.folderpath.tochararray()) { if($c -eq '/'){$prefix+='-'} } if($_.foldersize -gt 20mb) { $host.ui.rawui.foregroundcolor = "red" } else { $host.ui.rawui.foregroundcolor = "gray" } $prefix + $_.name } }, foldersize, folderandsubfoldersize there few problems script. if last folder processed larger 20 mb, console text remains red after runs. script assumes original console text gray. if it's...

sharepoint - Unable to Refresh the Excel Connection in Excel Webaccess Webpart -

Image
i'm using excel workbook pivot in it. i'm using excess webpart display it. click on refresh data connection. it throws error. screen shot attached. i have configured secure store service , excel service application. suggestions ?? i have installed sp2010 + sql server 2008r2 in server. have excel sheet contains pivot(the data comes sql server). i want show excel file in sharepoint. using excel web access webpart show it, on clicking refresh data connections, throws error. firstly gving error of delegation. when configured secure store service excel services, error changes unable refresh data connection ,contact system administrator. note: tried deploy powerpivot solution in sp 2010, solution not found in farm solution(). i 'm installing powerpivot(sql server) in existing setup.so please can tell me how proceed above mentioned scenario once when installation of powerpivot complete ? can 1 suggest related it? thanks in advance. find below url lin...

html - How to show multiline text in a table cell -

i want show paragraph database table cell. the result large 1 line, ignoring how organised in database. ignoring 'enters' example (new lines) i want show according how it's written in database. for example if paragraph saved this: hello , name x. i want showed that, instead of: hello, myname x. you want use css white-space:pre applied appropriate <td> . table cells, example: td { white-space:pre } alternatively, if can change markup, can use <pre> tag around content. default web browsers use user-agent stylesheet apply same white-space:pre rule element. the pre element tells visual user agents enclosed text "preformatted". when handling preformatted text, visual user agents: may leave white space intact. may render text fixed-pitch font. may disable automatic word wrap. must not disable bidirectional processing.

java - Building complex promises in Play -

supposed need return promise method, depends on external resource , calculation. imagine like: promise<integer> foo() { return ws.url(url) .getasync() .callwhenready(new function<httpresponse>(){ integer parse(httpresponse response) { // parsing business logic // ... int parsed = ...; return parsed; } }); } what can use callwhenready ? jquery.promise() behaves. i think want f.promise.map (play 2.0.2): /** * maps promise promise of type <code>b</code>. function <code>function</code> applied * promise redeemed. * * exceptions thrown <code>function</code> wrapped in {@link java.lang.runtimeexception}, unless * <code>runtimeexception</code>'s themselves. * * @param function function map <code>a</code> <code>b</code>. * @return wrapped promise maps type <code>a</code> ...

Is there a test class specific listener ( similar to Junit runner ) in TestNG? -

existing junit setup : i have written junit test runner parses test class before execution , reads custom annotations written on each testable method in test class .based upon aggregated value of annotations formulate configuration use setup test environment , manipulate . when tests executed based upon manipulation done on test environment generate result . current state : now evaluating testng same task .i understand terminologies , ways of execution bit different in testng . have different suites file various suites in testng , each of suite has test section multiple test classes inside . wanted did junit (as mentioned above) in testng , hence when suites execute , each test class executed before execution of test class want perform environment setup , manipulation .i saw documentation various listeners in testng , haven't been able find specific listener purpose (capable of intercepting individual class execution ). listener doing need or there way achieve want ? i...

delphi - Correct way to ensure mainform has maximized and fully redrawn before showing a modal form on application load -

what recommended way ensure mainform maximized , controls redrawn before showing modal form on application first load? i need show modal dialog when application starts (not login screen) if set form wsmaximized whilst screen maximizes, controls not have chance redraw , left ugly mess. i show modal screen @ present using following: procedure tform1.formactivate(sender: tobject); var frmorderlookup:tfrmorderlookup; begin onactivate := nil; frmorderlookup:=tfrmorderlookup.create(nil); try frmorderlookup.showmodal; frmorderlookup.free; end; end; what post custom message form. way won't processed until other messages form have been handled. time message gets processed, form should have finished redrawing. type tmyform = class(tform) procedure formcreate(sender: tobject); private procedure handlelookupmessage(var message: tmessage); message wm_user + 1; end; procedure tmyform.handlelookupmessage(var message: tmessage); var frmo...

ruby on rails - RoR Tutorial Hartl Chapter 9.3 -

i got stuck tutorial , have been pulling shape. (i'm 2 week newbie). when run bundle exec rspec spec/requests/user_pages_spec.rb -e "edit page" i get sis-macbook-pro:sample_app lagaspi$ bundle exec rspec spec/requests/user_pages_spec.rb -e "edit page" run options: include {:full_description=>/(?-mix:edit\ page)/} fff failures: 1) user pages signup valid information edit page failure/error: before { visit edit_user_path(user) } actionview::template::error: undefined method `model_name' nilclass:class # ./app/views/users/edit.html.erb:6:in `_app_views_users_edit_html_erb___432836341465923353_70096274496380' # ./spec/requests/user_pages_spec.rb:96:in `block (5 levels) in <top (required)>' 2) user pages signup valid information edit page failure/error: before { visit edit_user_path(user) } actionview::template::error: undefined method `model_name' nilclass:class # ./app/views/users/edit.html.erb:6:in `_app_views_u...

C++: Calling class functions within a switch -

i've been trying study finals practicing classes , inheritance, i've come far inheritance , such i'm unsure how fix error occuring below. #include<iostream> #include<iomanip> #include<cmath> #include<string.h> using namespace std; //base class definition class hero { protected: string name; string mainattr; int xp; double hp; double mana; double armour; int range; double attkdmg; bool attktype; public: void dumpdata(); void getname(); void getmainattr(); void getattkdata(); void setattkdata(string); void setbasics(string, string, double, double, double); void levelup(); }; //class functions void hero::dumpdata() { cout << "name: " << name << endl; cout << "main attribute: " << mainattr << endl; cout <...

android - getting Exception on Shared Preferences Store -

i trying save shared preferences using sharedpreferences sharedpref = getsharedpreferences("bluefreesharedpreferences",0); preferencemanager.getdefaultsharedpreferences(getapplicationcontext()); prefeditor = sharedpref .edit(); prefeditor.putstring("username", username); prefeditor.putstring("password", password); prefeditor.commit(); on samsung galaxy 1900 2.2.1 not saving shared preferences on emulator 2.2.1 , htc y 1 4.0.3 os working fine. read post here http://code.google.com/p/android/issues/detail?id=14359 can guide me still issue? i don't think you've initialized editor right, here's little code i've written while ago, makes preference of counter , increments upon execution sharedpreferences counter = getsharedpreferences("prefs", context.mode_private); sharedpreferences.editor count_editor = counter.edit(); int currentcount = counter.getint(packagename +"", 0); currentcount++; count_editor.pu...

(Python) Why doesn't my method object execute when I call it after my class definition? -

when try run program in idle (the text editor i'm using @ moment, notepad ++ said indentation error , don't know why) code in __init__ , shows it's been created object. line after tried use main method , doesn't anything. changed different method didn't work either. here's program: import sys class main: def __init__(self): winx = false wino = false turn = 'x' lastturn = 'x' a, b, c, d, e, f, g, h, = ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' poslist = [] poslist.append(a) poslist.append(b) poslist.append(c) poslist.append(d) poslist.append(e) poslist.append(f) poslist.append(g) poslist.append(h) poslist.append(i) self.board = '+---+---+---+\n| ' + poslist[0] +' | '+ poslist[1] +' | '+ poslist[2] +' |\n+---+---...

php - How to effectively replace (mysql_result(mysql_query()) in PDO? -

as process complete rewriting web pdo instead of mysql_* commands testing changed functions. , seems changed function mysql_result(mysql_query() returns true, why that? lets see original , changed code: if (mysql_result(mysql_query("select count(*) account id='".$_session["user_id"]."' , online=1"), 0)>0) { return true; } else return false; and changed code here: $stmt = $db_login->prepare("select count(*) account id=:id , online=1"); $stmt->bindvalue(':id', $_session["user_id"], pdo::param_int); $stmt->execute(); $results_login = $stmt->fetch(pdo::fetch_assoc); $rows = count($results_login); if ($rows > 0) { return true; } else return false; so wrong why returns true when column has online=0? thank you $stmt->fetch fetches one row result set. out of array containing selected columns, looking this: array( 'count(*)' => 42 ) a count() on array res...

jQuery slider: clone and delete element based on slider value -

just title says... i'm trying find best way duplicate/clone div based on slider value; conversely, i'm trying remove added elements when slider value decreased. effectively, slider value should reflect number of cloned elements displayed (stacked on top of each other). initially, 0 elements displayed. e.g. element cloned: <div class="test" style="display: none">test</div> slider: http://jqueryui.com/demos/slider/#slider-vertical init: max: 20, value: 0, thanks in advance! you can use stop event of slider calculate how many divs need add or remove. adding , subtracting div elements clone well. demo: http://jsfiddle.net/lucuma/ggc8s/ $(function() { $("#slider-vertical").slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 0, stop: function(event, ui) { $("#amount").val(ui.value);...

qt4 - To avoid Qt Creator from source mistakes the version of Qt upon building -

i got following error when try building qt creator from source . user@host:/usr/share/qtcreator/qtcreator_build$ qmake -version qmake version 2.01a using qt version 4.8.2 in /usr/local/trolltech/qt-4.8.2/lib user@host:/usr/share/qtcreator/qtcreator_build$ sudo qmake ../qtcreator_fromsrc/qtcreator.pro project message: cannot build qt creator qt version 4.6.2. project error: use @ least qt 4.7.4. as shown, qt library in use above 4.8.2, should qualifying ver 4.7.2. it's installed from source . how can let qtcreator installer recognize right qt version? my workaround copy source of qt creator area doesn't require super user permission. hth.

.net - Enums of colors -

my idea switch between colors, don't have use multiple pens can declare one. i'm not sure have understood how enums work, please correct me: type colortype = | red = color.red | green = color.green | blue = color.blue and wish use in: let p = new pen(colortype.[index]) g.drawrectangle(p, 0, 0, 10, 10) where index int variable (0 2) i'll use switch colors. problem can't declare enum, color not accepted. possible solutions? to access colors index, put them in array: let colors = [| color.red color.green color.blue |] let p = new pen(colors.[index]) g.drawrectangle(p, 0, 0, 10, 10)

c# - Error Ambiguity and Missing partial modifier -

i follow http://www.dotnetcurry.com/showarticle.aspx?id=585 project have error ambiguity , missing partial modifier. my code @ iservice1.cs namespace wct_dataserviceapp { [servicecontract] public interface iservice1 { [operationcontract] imageemployee getempbyempno(int empno); } [datacontract] public class imageemployee { [datamember] public int empno { get; set; } [datamember] public byte[] empimage { get; set; } } } and code @ service1.svc.cs namespace wct_dataserviceapp { // note: can use "rename" command on "refactor" menu change class name "service1" in code, svc , config file together. public class service1 : iservice1 { public imageemployee getempbyempno(int empno) { var conn = new sqlconnection(@"data source=yeo-pc\sqlexpress;initial catalog=image;integrated security=true"); conn.open(); ...

java - What change did really happen in Async Task after Android Gingerbread? -

what change did android team make in async task after android 2.3. when executed following code getting same result in both android 2.3 , 3.0. package com.sample.asynctask; import android.app.activity; import android.os.asynctask; import android.os.bundle; import android.util.log; public class asynctasktestactivity extends activity { private static final string tag = "asynctasktestactivity"; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); //executorservice executorservice = executors.newfixedthreadpool(1); (int = 1; <= 20; i++) { testtask testtask = new testtask(i); testtask.execute(); } } private static class testtask extends asynctask<void, integer, void> { int i; public testtask(int i) { log.i(tag, "constructor ...

css - border-radius not working -

i'm working on basic div , peculiar reason, border-radius: 7px isn't applying it. .panel { float: right; width: 120px; height: auto; background: #fff; border-radius: 7px; // not working } to whomever may have issue. problem border-collapse. set to: border-collapse: collapse; i set to: border-collapse: separate; and fixed issue.

Freezing a Git branch -

Image
let's have develop branch. create feature branch develop feature. once feature developed, merged develop. pretty shown here: is there way can freeze feature branch no further commits can made it? the reason not outright deleting branch viewing history can still show feature branch , if there needs tweak made feature possible create new feature branch last commit of previous feature. christopher right, tagging this. recommend deleting branch name make little harder checkout branch , make edits. first, merge branch develop git checkout develop git merge --no-ff feature_1 then checkout branch git checkout feature_1 then create tag, comment. git tag -a -m "freezing feature branch fixes.." feature_1_frozen then delete branch git checkout develop git branch -d feature_1 after doing this, won't able checkout branch name. instead you'll able checkout tag name, put detached head state deter changes code. now wrap things , sync origi...

Random number generator in c with max and min -

possible duplicate: in c, how specific range of numbers rand()? #include <stdio.h> #include <stdlib.h> #include <time.h> int main(int argc, char** argv) { srand(time(null)); int r = rand(); printf("%d\n", r); return (exit_success); } i have code , want make random numbers 1-6 , fill them board [40] ideas? int main(int argc, char** argv) { int i; int array[40]; srand(time(null)); (i=0; i<40; i++) array[i] = rand()%6 + 1 return (exit_success); }

iphone - Rotating Not Detected -

i using: if (uiinterfaceorientationlandscapeleft | uiinterfaceorientationlandscaperight) { viewofimage.frame = cgrectmake(130, 45, 220, 115); share.frame = cgrectmake(205, 161, 70, 70); invite.frame = cgrectmake(8, 161, 70, 70); contact.frame = cgrectmake(402, 161, 70, 70); invitation.frame = cgrectmake(3, 227, 81, 21); sharing.frame = cgrectmake(200, 227, 81, 21); contacting.frame = cgrectmake(397, 227, 81, 21); } else { viewofimage.frame = cgrectmake(20, 64, 280, 206); invite.frame = cgrectmake(8, 285, 70, 70); share.frame = cgrectmake(125, 285, 70, 70); contact.frame = cgrectmake(242, 285, 70, 70); invitation.frame = cgrectmake(3, 358, 81, 21); sharing.frame = cgrectmake(120, 358, 81, 21); contacting.frame = cgrectmake(237, 358, 81, 21); } to set buttons , labels in places when rotated. issue when leave view controller , go different controller, same code in place, not move buttons , labels defined cgrectmake values. ...

php - Recognizing duplicates while iterating through query results -

this follow-up question asked previously . i can calculate rank (including logic ties) fine; issue detecting future duplicates when come across first instance of duplicate rank. here sql query result set: select s1.team_id, sum(s1.score>s2.score) wins scoreboard s1 left join scoreboard s2 on s1.year=s2.year , s1.week=s2.week , s1.playoffs=s2.playoffs , s1.game_id=s2.game_id , s1.location<>s2.location group s1.team_id order wins desc; here sample sql result set i'll loop through in php: team_id wins -------------- 10 52 2 48 5 46 11 46 3 42 9 39 ... here php code display, needs append "t-" tied ranks: $i = 0; while($row = mysql_fetch_assoc($r)) { //iterate thru ordered (desc) sql results ++$i; ($row['wins'] == $prev_val) ? $rnk = 't-' . $rnk //same previous score, indicate tie : $rnk = $i; //no...

jquery element properties is not loading in rjs file elements? -

i using rails3 , in application auto complete-functionality there. when users/new template auto-complete functionality working. users/new partial file also. if want call ajax request file , auto-complete field not working. from knowledge jquery properties not applying rjs or partial file elements . thanks in advance, prasad.

java - what's the difference between these two binding declarations with Google Guice? -

what's difference between bind(fooimpl.class).in(scopes.singleton); bind(foo.class).to(fooimpl.class); and bind(foo.class).to(fooimpl.class).in(scopes.singleton); with google guice? edit: the second declaration create 2 instances on singleton in project working on. reference here in reference google guice documentation: in linked bindings, scopes apply binding source, not binding target. suppose have class applebees implements both bar , grill interfaces. these bindings allow 2 instances of type, 1 bars , grills: bind(bar.class).to(applebees.class).in(singleton.class); bind(grill.class).to(applebees.class).in(singleton.class); this because scopes apply bound type (bar, grill), not type satisfies binding (applebees). allow single instance created, use @singleton annotation on declaration class. or add binding: bind(applebees.class).in(singleton.class); so, it's possible have 2 instances of fooimpl in second way not first ...

Gnuplot, yerrorbar, text as x axis -

i have following data: t4.8k 1.84 1.86 1.83 t5.8k 1.82 1.84 1.8 t7.10k 1.79 1.8 1.77 t8.8k 1.8 1.84 1.76 i need plot in gnu plot using yerror bars. column1 - dataset name. xaxis scale. column2 - y-mean column3 - y-max column4 - y-min here plotting code use: plot "chameleonconfidence.dat" using xtic(1):2:4:3 title "ratio of time taken" yerrorbars but gives me following error warning: empty x range [4.94066e-324:4.94066e-324], adjusting [4.94066e-324:4.94066e-324] "chameleonconfidence.gplot", line 15: x_min should not equal x_max! can me this? this works me. set xrange [-1:4] title="ratio of time taken" plot "chameleonconfidence.dat" using ($0):2:4:3:xticlabels(1) yerrorbars title title the xtic function doesn't replace x-values in file -- automagic field can add using specification add xticlabels on axis. basically, need line number ( $0 ) x value , set (movi...

JQuery: Getting data from child elements -

markup: <ul> <li><a href="#" class="item-list" data-id="1">link 1</a></li> <li><a href="#" class="item-list" data-id="2">link 2</a></li> <li><a href="#" class="item-list" data-id="3">link 3</a></li> </ul> in jquery, select link 1 , should able fetch data-id of link1. tried $('.item-list').click(function(){ var link = $(this); alert($(this).data('id')); }); it doesn't have result. oh. list gets generated after page loaded. querying db list. also, possible list change, depending on how user filters db. thanks. if list generated after page loaded, .click binding might not work. maybe can try .live , so: $('.item-list').live('click', function(){ var link = $(this); alert($(this).data('id')); }); edit: what seem forget :) of jquery 1.7, ...

android - How to find another phone is on or off -

is possible find phone number on or off . i think depends on service provider , in india there no service provider gives information. in uruguay possible!! , if possible how can check in india? thanks in advance. there no standard determining if cell phone powered on or off. of can tell if cell phone powered off when calling phone fact goes voice mail immediately. there no ring-back when occurs may differ carrier carrier. other issue using determination user can select avoid call if fast enough may give similar results caller. you may able make determination on whether cell phone on or off using call progress analysis, fore mentioned reasons not 100% accurate. 1 way call progress analysis use call control xml (ccxml) platform has call progress analysis voxeo's prophecy . if @ documentation on ccxml there section on outbound dialing covers call progress analysis. see if there no ring-back before answer determine if phone off.

'Freeze panes'-style effect using CSS/HTML -

is possible/easy create web page act microsoft excel spreadsheet has 'freeze panes' applied it? this, mean header , sidebar should remain fixed in places scroll down/right when page scrolled. i need this , except want applied whole page , not table. this can don switching position: fixed . for example div class #fixed-div { position: fixed; top: 0; left: 0; right: 0; height: 100px; background-color: #000; } will remain fixed in upmost 100px of browser viewport when you're scrolling. this fiddle demonstrates effect in both vertical , horizontal direction. http://jsfiddle.net/ukzyf/1/ hope helps.

SAP, how to checkIn document files? -

i want create new document in sap. additional have files belongs document, these files want upload sap knwolegde base. i'm using bapi_document_create2 create or bapi_document_checkin2 add files document info data. every thing works fine, except file upload or checkin. i'm using documentfiles table. add row each file, set 3 fields: row["storagecategory"] = "dms_c1_st"; row["docfile"] = "c:\temp\bom.pdf"; row["wasapplication"] = "pdf"; bapi erro message: "error while checking in , storing c:/temp/bom.pdf" i set parameter pf_ftp_dest = "sapftpa"; pf_http_dest = "saphttpa"; i have looked in log data (slg1). found following entry: errmsg: error in opening file "..." reading (no such file or directrory) v1: scms_doc_create_files v2: 13 it nice if has idea , bring light in issue. in advance thomas remember bapis run inside applic...

ruby on rails - Redmine REST api [update status] -

i looking @ way automate bug tracking test tools. found: http://www.redmine.org/projects/redmine/wiki/rest_api_with_ruby which describes way interact rest api in redmine. following able create/update/destroy issues, update simple fields subject or description.(can't update status or priority) i can't find way change status of bug. the fields can't update "?structures(with attributes)?". has managed , have been doing worng? i'm assuming you've cloned repository , started looking through code. there line in issues#update action shows might permissions problem. @allowed_statuses = @issue.new_statuses_allowed_to(user.current) ensure user has permissions change status , priority given issue. i've added example of fields issue 1 of projects. id: 83, tracker_id: 2, project_id: 8, subject: "comments", description: "add comments trace on list , on graph view...", due_date: nil, category_id: nil, status_id: 1...

java - Meaning of compiled without debug information -

in javadoc of localvariabletableparameternamediscoverer http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/core/localvariabletableparameternamediscoverer.html the below line mentioned: implementation of parameternamediscover uses localvariabletable information in method attributes discover parameter names. returns null if class file compiled without debug information. i didn't meaning of compiled without debug information. please explain if having idea regarding this. in order allow debugging, compilers have debugger friendly flag. when flag set, optimizations re-order code not done , generated executable has information link machine code source line generated from. on other hand, compiler can made create debug unfriendly executable removed in order speed program tiny bit. the class mentioned cannot parameter names out of class file in names removed compiler save space.

Transfer Python setup across different PC -

my scenario have 2 laptops fresh installation of windows . use both of them programming. so, lets suppose install various python modules/packages in 1 of laptop. there way can clone complete python setup on other laptop. reason internet connection slow don't want download same module or packages twice , install them again. i know can download modules in zip file, transfer them on other , run python setup.py install going use pip install modules. anyways, wondering if cloning of python setup possible. here different suggestion, recommended if want synchronize packages between 2 pcs , not cloning once. it works if install packages pip . not work packages not installable/installed pip. set pip cache network storage / usb stick accessible both pcs (see https://stackoverflow.com/a/4806458/851737 instructions) freeze current package environment source pc requirements file: $ pip freeze > req.txt copy req file target pc , install packages: $ pip inst...

link two WPF animations together -

i animating image rotation using doubleanimation linked click event of button. animation has ease in , ease out + duration of 10 seconds. what want @ same time animate image in last 3 seconds of first animation second image faded in , out using opacity animation. i have no experience of storyboards , not sure how accomplish effect. regards, dan if you're controlling durations explicitly, easiest way set begintime of opacity animation start @ 7 seconds , set duration last 3 seconds. if they're both in same storyboard , start storyboard, timing handled setting properties. here's rough example. <!-- 10 second storyboard --> <storyboard duration="00:00:10.000"> <!-- 10 second animation --> <doubleanimation begintime="00:00:00.000" duration="00:00:10.000" /> <!-- 3 second opacity animation starts @ 7 seconds --> <doubleanimation begintime="00:00:07.000" duration=...

mysql - Show all current locks from get_lock -

is there way select / show current locks have been taken out using get_lock function ? note get_lock locks different table locks, acquired lock tables - readers want know how see those locks should read detecting locked tables (locked lock table) starting mysql 5.7, performance schema exposes metadata locks, including locks related get_lock() function. see http://dev.mysql.com/doc/refman/5.7/en/metadata-locks-table.html

SQL Server Temp Tables across multiple scripts/tabs -

i read quote zed shaw once said "if software developer writes same code more once, should write function doesn't have repeat himself". on daily basis, find myself making temp tables in sql server more once per day. don't need these tables live past midnight each day why chose use temp table. however, have various scripts in different tabs in sql management studio - have repeat these temp tables in every 1 of scripts in order reference it, , seems quite inefficient. ultimate goal run stored procedure populate multiple temp tables , have them available run analyses. is there better way reference tables current usage? there way reference temp tables across sessions in sql server 2008 ? it seems want global temporary tables . syntax use them same normal temporary tables, have 2 ## instead of 1 ( ##temptable ). please take @ link first know limitations of them.