Posts

Showing posts from May, 2010

logging - My iOS app crashes on start up -

i have been developing ios app , of sudden when start debugger bunch of machine code , halts here: 0x2c70bb: popl %ebp 0x2c670bc: ret i no output in log. when run zombies or leaks app runs fine, when use simulator nothing. put breakpointer in first line of code in app delegate , doesn't hit it. any tips? went in code working code before happened , same thing. ive been developing ios 2 years , first. i have searched solution have found nothing. if app delegate not hitting crashing within autorelease pool statement in main.m. without full stack trace it's difficult debug. i'd recommend following: make sure main window , root xibs ok stripping basics app delegate also, inside main.m file, should see similar this: uiapplicationmain(argc, argv, nil, nsstringfromclass([appdelegate class])); the fourth argument delegateclassname, , apple docs says: delegateclassname name of class application delegate instantiated. if princip

c# - How to remove the ID part in my form html tag when using Html.Beginform helper? -

i'm using form helper so: @using (html.beginform("upload", "file", formmethod.post, new { enctype = "multipart/form-data"})) } my controller's action is: [httppost] public actionresult upload(httppostedfilebase file) { } when @ html, generated form tag is: <form action="/file/upload/123123" enctype="multipart/form-data" method="post"> </form> for reason including id part of url during request. how can remove just: action="/file/upload" also understand, change action declaration also? i don't understand why want remove id part. but answer question, yes can. here how it. try first based on html.beginform(string actionname, string controllername) . @using(html.beginform("upload", "file") { } if doesn't work (or) still putting in id value, try using this html.beginform(routevaluedictionary routevalues) . @using(html.beginform

c# - LINQ distinct to @Html.DropDownList -

ok having lot of trouble think should pretty easy. trying populate dropdown list distinct values table. this linq provides list of departments need each drop down option. ipacs_master_lists .where (x => (x.department != null)) .select (s => s.department) .distinct () .select (v => v) how make dropdown list this? i've tried messing @html.dropdownlist cannot work seems. my controller follows. tried pass in viewbag couldn't work either. public actionresult index() { var docs = db.ipacs_master_list; viewbag.departments = new selectlist(db.ipacs_master_list.where(x => (x.department != null)).select (s => s.department).distinct().select (v => v), "id", "department", 0); return view(docs); } don't use viewbag , everytime use kitten dies. seriously, really bad practice. first, assuming in model: public class mymodel { public list<documents>

asp.net mvc 3 - Problems with Linq(join) -

i writting query linq(follow code bellow). looking data db.imovel , each 1 bring picture nested db.fotoimovel. keep in mind may have more 1 picture each db.imovel data. the issue when run, returns me pictures same db.imovel data in of them. it works me if return db.imovel data one(may first picture) db.fotoimovel. code: var retorno = (from c in db.fotoimovel join p in db.imovel on c.idimovel equals p.idimovel p.metragemimovel >= metragem1 && p.metragemimovel <= metragem2 && p.statusimovel == opcao && ((string.isnullorempty(bairro)) || p.bairroimovel == bairro) && ((imovel == null) || (p.tipoimovel == imovel)) && ((carros == null) || (p.qtdvagagaragemimovel == carros)) && ((quartos == null) || (p.qtdquartoimovel == quartos)) select new dadosimovel

jquery - How do I make an image slide up when the caption is slide up? -

i've created next html snippet: http://jsfiddle.net/4gdmk/ works good, can't find way move captions , image same time up, image isn't visible anymore. here base html: <figure> <img src="http://4.bp.blogspot.com/_1vc-o2p4phq/s1bi97agdoi/aaaaaaaacxs/moo533hzesw/s200/technical_stockphoto2.jpg" alt="stockphoto 1" /> <figcaption>caption text</figcaption> </figure> look @ site example: http://etchapps.com/ on blocks can click, , caption shown , image goes up. need, on hover. does know how make this? with kind regards ok, there lot of changes, bear me. the css has been trimmed down (since effects jquery): figure { display: block; position: relative; float: left; width:200px; height: 200px; overflow: hidden; margin: 20px; } figure img { display: block; max-width:200px; } figcaption { position: absolute; background: black; background: rgba(0, 0, 0, 0

Facebook scores blocked by "only me" visibility -

i have game highscores , use fb-score api generate friend leaderboard. 1 problem though ... save score fb-user, app has "post data user" ... in case, score-data. user can choose mark "posting" permission visible "only me" instead of global or friends. lot of users since sounds aid privacy. that means score of ... lets user ... never show in leaderboard of friend (user b), since app has posted user a, , unintentionally invisible of friends. user has not way find out mistake, , none of friends can see awesome highscore, since can see highscore without problems. that brings me question: how can work around or approach problem in way? there way score data user when marked "app posts" visible himself? accesstoken thing, user or app? or somehow check if user has done such thing , alert him change post-permission visibility? far know can check if permission given or not, not visibility. want work past setting server of own handle data.

Is it possible to use jQuery's .when() with a forEach loop of ajax calls? -

i have several forms post server @ once. then, want listen of them complete. if hear them complete successfully, take 1 action and, if see 1 fail, take different action. i believe should use jquery's .when(): http://api.jquery.com/jquery.when/ this post on stackoverflow shows example on how when have of ajaxrequests explicitly defined: wait until jquery ajax requests done? wondering if possible achieve same effect loop somehow? i have code, not wait complete: _.each($('form'), function (form) { var $form = $(form); if ($form.valid()) { // post form data $.ajax({ url: $form.attr('action'), type: $form.attr('method'), data: getformdata($form), success: function () {} error: function(){} }); } }); edit: while i've accepted answer.. worth noting correct

search - Workin with binary in python -

is there easy way work in binary python? i have file of data receiving (in 1's , 0's) , scan through , patterns in binary. has in binary because due system, might off 1 bit or throw off when converting hex or ascii. for example, open file, search '0001101010111100110' or string of binary , have tell me whether or not exists in file, is, etc. is doable or better off working language? to convert byte string string of '0' , '1', can use one-liner: bin_str = ''.join(bin(0x100 + ord(b))[-8:] b in byte_str) combine opening , reading file: with open(filename, 'rb') f: byte_str = f.read() now it's simple string search: if '0001101010111100110' in bin_str:

xml - How to output text node value line by line using xslt 1.0? -

i have xml file like: <messages> error message 1 error message 2 </messages> i have output as: error 1: error message 1 error 2: error message 2 i'm using xslt 1.0, , tried: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" omit-xml-declaration="yes"/> <xsl:template match="messages"> <h3>error 1:</h3> <xsl:value-of select="substring-before(./text(), '&#10;')"/> <h3>error 2:</h3> <xsl:value-of select="substring-after(./text(), '&#10;')"/> </xsl:template> </xsl:stylesheet> but returned me nothing...could me this? thanks! you can use recursive template achieve this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.

javascript - Functional Programming: Printing to JS console in Chrome -

i'm implementing functional programming eloquent javascript js console in google chrome. there's function loops through each element in array , performs given action in initial parameter said element. function foreach(array, action) { (var = 0; < array.length; i++) action(array[i]); } foreach(["wampeter", "foma", "granfalloon"], console.log); i expecting console print out each item in array, in red: typeerror: 'illegal invocation' is there way can print on js console or should use else compile code? when pass foreach , function losing reference this value (the console object). following should work: function foreach(array, action) { (var = 0; < array.length; i++) action(array[i]); } foreach(["wampeter", "foma", "granfalloon"], console.log.bind(console)); http://jsfiddle.net/th2a5/ for browsers don't support bind , can use shim available on m

javascript - trying to map someFunction.jQuery to "$" -

i found function ( via person's github ) might use in script mimics functionality of api object. here's relevant code link: unsafewindow = (function() { var e1 = document.createelement('p') e1.setattribute('onclick', 'return window;'); return e1.onclick(); })(); where poster says can use function in format unsafewindow.jquery now, want able use $ instead of jquery keyword elsewhere in code. tried learning this stack overflow question simplify , re-wrote code so: (function($){ var e1 = document.createelement('p') e1.setattribute('onclick', 'return window;'); return e1.onclick(); })(jquery); but didn't work. guess try $ = unsafewindow.jquery in order map $ , wanted try in format seen above. you map $ unsafewindow.jquery so: unsafewindow = ( function () { var dummyelem = document.createelement('p'); dummyelem.setattribute ('onclick', 'return

Classes Python and developing Stack -

i have created own lifo container class stack supports methods of push, len, pop, , check on isempty. methods appear working in example calls, except when call created instance of class(in example s) receive memory location created object when want see actual contents of object. class stack: x = [] def __init__(self, x=none): if x == none: self.x = [] else: self.x = x def isempty(self): return len(self.x) == 0 def push(self,p): self.x.append(p) def pop(self): return self.x.pop() def __len__(self): return(len(self.x)) s = stack() s.push('plate 1') s.push('plate 2') s.push('plate 3') print(s) print(s.isempty()) print(len(s)) print(s.pop()) print(s.pop()) print(s.pop()) print(s.isempty()) i result of running line print(s) <__main__.stack object @ 0x00000000032cd748>t when expect , looking ['plate 1

Java: passing the value of a String to another class to use for setText on Pane -

i quite new this, not understand how classes communicate despite reading docs, think need working example drill in. i have jlist , jeditorpane sharing jsplitpane. list functionality fine, jeditorpane in class, have obtained string need by: public void setbookmarkpreview(listselectionevent evt) { bookmarkstring = (string)this.getselectedvalue(); //system.out.println(bookmarkstring); this works, have no idea how pass string "bookmarkpreview" class extends jeditorpane, can display retrieved result above on editor pane second class. i've tried reading online can't head around context. i created public static string bookmarkstring; thinking updated based on list listener method, result in class 2 prints "null" missing here. here second class tried call public static string public class bookmarkpreview extends jeditorpane { public bookmarkpreview() { bookmarkpane test = new bookmarkpane(); this.seteditable(false); settext(bookmarkpane.boo

objective c - How to initialize a NSMutable array in a UIView subclass -

i create nsmutablearray , fill bunch coordinates. i assign array property of array this: draw.shapecoords = [shapes shapecoords]; where draw class , shapes class , shapecoords properties in both of them. when drawrect method, array of coordinates empty. i'm did little research , found @synthesize not fully instantiate nsmutablearray, how in draw class (which implements uiview) initialize array? basically, need access data in array, how it? @synthesize doesn't instantiate object @ — creates variable (initialized nil) , accessor methods. need create array. in initwithframe: , you'll want _shapecoords = [[nsmutablearray alloc] init] .

abnormal string list behaviour in python -

this question has answer here: remove items list while iterating 18 answers print difflist line in difflist: if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))): difflist.remove(line) print difflist here, initially, difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< @ ', '---', '> add ', ''] and expect of code print ['1a2', '3c4,5', '5c7', ''] but instead difflist= ['1a2', '3c4,5', '---', '> ', '5c7', '---', ''] when iterating on list, python keeps integer index of array element it's pointing to. however, when remove

extjs - How to get KeyMap keydown event on grid panel with paging toolbar -

i trying keydown event working on gridpanel pagingtoolbar when hold or down arrow keys carries on through pages without need stopping or repetitive key presses. process works on keyup event have not managed recognise keydown events. my code current: grid: trackgrid = new ext.grid.gridpanel({ layout: 'fit', autosizecolumns:false, autoheight:true, maxheight:400, frame:true, trackmouseover:true, selmodel: ext.create("ext.selection.rowmodel"), store: trackpaged, columns:[ {header: 'time', width:55, sortable: true, dataindex: 'time'}, {header: 'speed', width:50, sortable: true, dataindex: 'speed', renderer: this.rendertrackspeed}, {header: 'dirn', width:50, sortable:true, dataindex: 'hdg', tooltip: 'direction of travel'}, {header: 'ecode', width:70, sortable:true, dataindex: 'ev

php - Learning SELECT FROM WHERE prepared statements -

can re-write below code prepared statement? result = mysqli_query($con,"select * note_system note = '$cnote'") or die("error: ".mysqli_error($con)); while($row = mysqli_fetch_array($result)) { $nid = $row['id']; } i trying learn prepared statements , having trouble understanding how works many examples have found while searching. hoping if see code familiar re-written prepared statement might click me. please no pdo, confusing me @ current level of knowledge. thanks. hello butterdog let me walk through pdo step step. step 1) create file called connect.php (or ever want). file required in each php file requires database interactions. lets start please note comments : ?php //we set our database configuration $username="xxxxx"; // mysql username $password="xxxxx"; // mysql password // connect server via php data object $dbh = new pdo("mysql:host=xxxxx;dbname=xxxxx", $username, $password);

ruby on rails - URL parameter not preserved after validation fails and 'new' action is rendered -

when call new function variables load correctly. params[:code] url param defined in routes. however, when validation fails on create , new rendered, @m variable not loaded (this causes nomethoderror when attribute of @m called in 'new' template). so, :code parameter not obtained after rendering new. can :code parameter preserved after validation fails? class affiliatescontroller < applicationcontroller def new @m = merchant.find_by_code(params[:code]) @affiliate = affiliate.new end def create = affiliate.new(params[:affiliate]) if a.save redirect_to 'http://' + params[:ref] else render 'new' end end end another way preserve params[:code] , aside using session, add hidden field in form. <%= form_for @affiliate |f| %> <%= hidden_field_tag :code, @m.code %> then change create action to def create @a

PHP script to write a list of folder names inside a directory into .html file -

i create php script reads folders located in specific directory , writes names in .html file, structure of html should be: <ul class="galleries"> <li><a href=".../control/includes/gallery-select.php?g=folder-xx">gallery 1</a></li> <li><a href=".../control/includes/gallery-select.php?g=folder-xx">gallery 2</a></li> </ul> where folder-xx names of folders in control\data\img\gallery\ i'm not big expert of php i'll grateful hint.. , sorry english. thanks try this echo "<ul>"; $folder_name = "."; $d = opendir($folder_name); while ($f = readdir($d)) { if (is_dir($folder_name."/".$f)) echo "<li><a href='your_script.php?dir=$f'>$f</a></li>"; } closedir($d); echo "</ul>";

discrete mathematics - Calculating the sign of a NxN determinant -

is there more efficient way determine sign (negative or positive or zero) of determinant calculating full value of determinant , comparing zero? there methods, can approximate determinat of integer matrix faster, computing exact value. these methods used compute sign, since there great probability of correct result. see this paper more details. however afaik there no exact method of computing sign of determinant faster computing value itself.

jquery - Twitter Bootstrap Tabs active class toggle not working -

i using twitter bootstrap nav tabs , nav pills. code: <div class="header2" style="background-color:#1e3848"> <div id="headertab"> <ul class="nav nav-tabs"> <li class="active ans-tab"> <a href="http://myweb.com/">home</a></li> <li class="toptab"><a href="http://myweb.com/score/">score</a></li> <li class="toptab"><a href="http://myweb.com/leaderboards/">leaderboards</a></li> </ul> </div> <div id="subheadertabplayer"> <ul class="nav nav-pills"> <li class="active"> <a href="http://myweb.com/">top</a></li> <li><a href="http://myweb.com/rules/" data-tog

web scraping - Read Data From Web Form to Excel using VBA? -

Image
i new vba , need fetch values this form excel spreadsheet. once user clicks on estimate, exchange rate displayed. excel spreadsheet have column headings matching field names in form. in form, 'send amount' 50, 100, 500, 1000, 2500 , 7000. 'from' country 'united states'. worksheet should populated possible selections in other fields of form against 'united states' , corresponding exchange rates. santosh...there 2 ways of doing this intercept webservice xml create connection underlying db you need know db details or create com modules in vba xml (which again needs server details) if not know @ all. suggest go youtube , "vba com connections" or "vba xml". there nice videos, handing on server details on open forum not ideal thing do

c# - What exactly is a .base.cs file extension -

what .base.cs file extension? how different regular .cs class file? , how used differently? used code generation tool, , generated, , project builds, i'm not sure made .base.cs , not .cs - classes partial classes, not sure if clue. it's extension used code generation tool ensure name of generated file doesn't conflict existing file in project. since generated classes partial create own code file same name (minus .base ) extend them. example: myclass.base.cs // classes created code generator myclass.cs // custom extensions generated classes it compile other code file.

PHP - try and catch block (Exception) handling -

i'm in doubt exception handling. if have function foo(); same if handle this: try { foo(); } catch (exception $e) { // someting } or if in function this: foo() { try { // function body } catch (exception $e) { // someting } } and if not throw exception ? code continue execute if error appears ? yes, code continue. in php exists errors , exceptions. can handle errors function set_error_handler() , handle uncathable exceptions function set_exception_handler() , can handle exceptions using try .. catch

c++ - Expression must have integral or unscoped enum type on Pointers -

i'm trying open link log usernames unameaddr . url: http://zzz.com?username=mynameisjack . need "http://zzz.com?username=" + unameaddr . i'm getting error. guess syntax seems wrong? curl_easy_setopt(curl, curlopt_url, "http://zzz.com?username=" + unameaddr); the whole code: char *unameaddr = (char*) exebaseaddress + 0x34f01c; printf("%s \n", unameaddr); curl *curl; curlcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, curlopt_url, "http://zzz.com?username=" + unameaddr); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } update so tried: char username[512]; strcpy ( username, "http://zzz.com?username=" ); strcat ( username, unameaddr ); but application crashes when processing part. curl_easy_setopt(curl, curlopt_url, username); #include <iostream> #include <string> using namespace std; ... ... string str1 = "hello world.";

php - Fetch Json values -

the below result getting url . in need fetch values below json response in php {"request":{"airport":{"requestedcode":"ixj","fscode":"ixj"},"date":{"year":"2013","month":"4","day":"18","interpreted":"2013-04-18"},"hourofday":{"requested":"12","interpreted":12},"numhours":{"requested":"6","interpreted":6},"utc":{"requested":"false","interpreted":false},"codetype":{},"maxflights":{"requested":"1","interpreted":1},"extendedoptions":{},"url":"https://api.flightstats.com/flex/flightstatus/rest/v2/json/airport/status/ixj/dep/2013/04/18/12"},"appendix":{"airlines":[{"fs":"g8","iata":"g8&qu

entity framework - ASP.NET with EF, how to autocomplete for text field to lookup from database -

i'm not sure how search - i'm using .net mvc 4 ef , have 2 simple models 1 many relationship - company , location. company can have many locations (eg, australia, us, canada etc) i'd create form has text field user can enter in comma seperated list of locations, either autocopmlete existing locations, or add new location new ones. ie, if start typing in "aus" , austrlia , austria both in locations database table, user should shown these choose - stackoverflow tags. if type in location doesn't exist in database table should create new record. any pointers appreciated! thanks, robbie i read locations db prior rendering view , serialize them in json structure, or simple javascript array in rendered view. used autocomplete on client side of jquery (you use plugin, should simple enough make need. wouldn't complicate things employing kind of ajax call server triggered keydown event. after form submitted, content of location field going t

android - Fitting a wide webpage to the width of mobile device -

i have site, in order fit content of of pages, min-width of site 1170px. can't make separate mobile version. iphones , droids automatically resize page in order fit width. seem not resize page if height of content less height of screen , width runs off screen. any ideas of should change? don't know edits make won't mess desktop presentation. there way important before else if target work on in devices put code before end tag of </head> <meta name="viewport" content="width=device-width" /> then if dont want repeat code target screen want website display using media queries example below: @media handheld, screen , (max-width: 320px){ .yourelementclassorid { width:100%; } } @media handheld, screen , (max-width: 720px){ .yourelementclassorid { width:100%; } } @media handheld, screen , (max-width: 620px){ .yourelementclassorid { width:100%; } } but easy mani

osx - Correct way to install scikit-learn on OS-X using port -

i'm tying install scikit-learn using port on os-x. idea i'm missing here. port version version: 2.1.3 os-x 10.8.2 build 12c60 xcode version 3.2.5 (1760) python python 2.7.2 (default, jun 20 2012, 16:23:33) [gcc 4.2.1 compatible apple clang 4.0 (tags/apple/clang-418.0.60)] on darwin type "help", "copyright", "credits" or "license" more information. >>> command install scikit-learn sudo port install py27-scikit-learn ---> computing dependencies py27-scikit-learn ---> cleaning py27-scikit-learn ---> scanning binaries linking errors: 100.0% ---> no broken files found. however, looks it's not installed or configured properly. missing here ? >>> import sklearn traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named sklearn >>> sklearn import cluster, covariance, manifold traceback (most recent call la

vi - How to stop Vim from creating/opening a new file? -

vim creates new files when give name of non existing file. undesirable me, give wrong file name , have no intention open file, , close it. is there way stop vim opening new files? example, when vi file1 , should file doesn't exist , stay on bash terminal (without opening vi window) you add function .bashrc (or equivalent). checks command-line arguments exist before invokes vim. if want create new file can pass --new override checks. vim() { local args=("$@") local new=0 # check `--new'. ((i = 0; < ${#args[@]}; ++i)); if [[ ${args[$i]} = --new ]]; new=1 unset args[$i] # don't pass `--new' vim. fi done if ! (( new )); file in "${args[@]}"; [[ $file = -* ]] && continue # ignore options. if ! [[ -e $file ]]; printf '%s: cannot access %s: no such file or directory\n' "$funcname" "$fil

java - "The type of the expression must be an array type but it resolved to TextView" -

i'm having issue compiling bit of source code , i'm getting error stating "the type of expression must array type resolved textview" i've attempted on both google , stackoverflow , returning 1 (unanswered) result. can either point me in right direction or give example of how issue can resolved? much appreciated. - tim i have 2 instances of error on following 2 lines: beammsg[i].settext(new string(msg[i].getrecords()[1].getpayload())); beammsg2[i].settext(new string(msg[i].getrecords()[1].getpayload())); source: void processintent(intent intent) { parcelable[] rawmsgs = intent.getparcelablearrayextra( nfcadapter.extra_ndef_messages); // 1 message sent during beam ndefmessage[] msg = new ndefmessage[rawmsgs.length]; (int = 0; < msg.length; i++) { msg[i] = (ndefmessage) rawmsgs[i]; // record 0 contains mime type, record 1 aar, if present beammsg[i].settext(new string(msg[i].getrecord

ember.js - mocha testing doesn't work in the yeoman ember generator -

i've barely modify generated code ember generator yo ember and change test/spec/test.js little bit 'use strict'; (function () { describe('give context', function () { describe('maybe bit more context here', function () { it('should equal title', function () { var title = document.title; title.should.equal('ember starter kit'); console.log(title) //doesn't output in terminal }); it('should equal number', function () { 1.should.equal(1); }); }); }); })(); there's 2 strange thing: console.log doesn't output in terminal it shows 0 test: running "mocha:all" (mocha) task testing: http:// . .*.*/index.html 0 tests complete (1 ms) done, without errors. i've noticed when "0 tests complete", there's error within test file. the

android - how to move a view from viewgroup into another viewgroup? -

<linearlayout android:id="@+id/linear1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff4d00" android:orientation="vertical" > <button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="button" /> </linearlayout> <linearlayout android:id="@+id/linear2" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff4d00" android:orientation="vertical" > </linearlayout> i wanna move @button1 @linear2, , attributes belong button1 can't lost, include click lisener. then, @linear1 gonna empty. cut operation. how can do? you need add , remove button pragmatically ur activity class this ma

android - onPostExecute called before doInBackground completes - Async task -

i have method : public void extractfiles() { asynctask<void, void, boolean> extractiontask = new asynctask<void, void, boolean>() { @override protected void onpreexecute() { progressdialog = new progressdialog(activity.this); progressdialog.setcancelable(false); progressdialog.setmessage("extracting files please wait..."); progressdialog.setprogressstyle(progressdialog.style_spinner); progressdialog.setprogress(0); progressdialog.show(); super.onpreexecute(); } @override protected boolean doinbackground(void... params) { // todo auto-generated method stub string xapkfilepath = xapkfilepath(activity.this); string exportdirectory = environment.getexternalstoragedirectory().getabsolutepath() + "/android/data/" + activity.this.getpackagename() + "/files/"; file exportdirectoryfilepath = new file(ex

c# - Read Internet header in each outlook 2003 mail -

i developed application works in version of outlook (2003,2007, 2010). in project process internet header information of each outlook mail. done outlook versions (2007, 2010) using propertyaccessor property. found propertyaccessor available outlook versions (2007, 2010). want process internet header information of each oulook 2003 mail also. done using redemtion dll (third party) overcome above problem. can assist me there other option overcome issue or suggest me redemtion dll approach right one. working past 3 years on big outlook (2003,2007,2010,2013) project can concur using redemption right approach, that's did outlook 2003 , works well.

plsql - Execution of variable with Execute Immediate -

when trying run below code getting error "pl/sql compilation error". did wrong in ? declare vsql varchar2(500); begin vsql:='begin create global temporary table temp_subset ( id number ,"category" varchar2(2048) ,"class" varchar2(2048) ,"measure" varchar2(2048) ,"actuals year total" varchar2(2048) ,"col name" varchar2(256) ,value varchar2(2048) ); end;'; execute immediate vsql; end; thanks. try this: vsql:=' create global temporary table temp_subset ( id number ,"category" varchar2(2048) ,"class" varchar2(2048) ,"measure" varchar2(2048) ,"actuals year total" varchar2(2048) ,"col name" varchar2(256) ,value varchar2(2048) ) on commit delete rows'; if 2 tables needed created: vsql:=' begin execute immediate ''create

Required Field Missing. PHP Paypal REST API -

i'm trying use php paypal rest api. however, seems unable pass list of items through transaction because "required field(s) missing". $item = new item(); $item->setquantity("1"); $item->setname("stuff"); $item->setprice("305.00"); $item->setcurrency("usd"); $amount = new amount(); $amount->setcurrency("usd"); $amount->settotal("305.00"); $item_list = new itemlist(); $item_list->setitems(array($item)); $transaction = new transaction(); $transaction->setamount($amount); $transaction->setdescription("this incredibly awesome."); $transaction->setitem_list($item_list); i've filled fields paypal's documentation deems "required" per "common objects" in documentation ( https://developer.paypal.com/webapps/developer/docs/api/#common-objects ). being thrown error when try redirect paypal start transaction: exception: got http response code

javascript - Howto use WWW::Mechanize to access pages split by drop-down list -

i have list of genes download following links. problem it's separated 60 pages, under drop-down list. http://diana.cslab.ece.ntua.gr/micro-cds/index.php?r=search/results_mature&mir=hsa-mir-3131&kwd=mimat0014996 how can make www::mechanize access genes pages? this current code have: use www::mechanize; use strict; use warnings; $url = "http://diana.cslab.ece.ntua.gr/micro-cds/index.php?r=search/results_mature&mir=hsa-mir-3131&kwd=mimat0014996"; $mech = www::mechanize->new(); $mech->agent_alias("windows ie 6"); $mech->get($url); #only access first page. the page drop-down implemented using javascript. can't mechanize, because doesn't implement javascript. see faq

c# - Placeholder controls count always return 0 in button click -

i created textbox dynamically using code below , entered text in textbox. want read control's id while adding text database. how can id of textbox on click of button. for (int = 0; < dv_count; i++) { textbox txt_box = new textbox(); txt_box.text = ""; txt_box.id = "s" + i; placeholder1.controls.add(txt_box); } protected void btn_act_proceed_click(object sender, eventargs e) { int count = placeholder1.controls.count; //always return 0 if (count > 0) { int dv_count = count / 2; (int = 0; < dv_count; i++) { textbox lbl_type = (textbox )placeholder1.findcontrol("s" + i); } } } try in aspx page <div runat="server" id="plcholder"> </div> <asp:button id="button1" runat="server" text="button" onclick="button1_click" /> now in code behind protected void page_load(object sen

javascript - How do I click a link and make the game pop up in a certain area on my page without showing till clicked -

i'm trying figure out how make link on page access game in spot on same page. have multipal games embeded>. have multipal links on same page. after click 1 of links, pop in area next link , can play it. if can me out give credit needed. i'm using antenna web design , i'm not sure if need call functions can put code in area. thank time if help. if need in same page means use <iframe></iframe> otherwise make link. open same window or use target="_blank" open tab

oracle - retrieve user defined datatype from table -

sql> -- case 1 sql>select nest_test.id.num nest_test; select nest_test.id.num nest_test * error @ line 1: ora-00904: "nest_test"."id"."num": invalid identifier sql> -- case 2 sql>select n.id.num nest_test n; id.num ---------- 12 as, afaik, aliasing table giving simple name table or column. then, why i'm getting error in case 1 , when i'm trying retrieve user defined object table ? happened, when aliased table. the oracle documentation states table aliases required reference methods or attributes of objects avoid potential "inner capture" (a table column name clashing object attribute name). find out more . the documentation states: "you must qualify reference object attribute or method table alias rather table name if table name qualified schema name." it doesn't why oracle enforce rule. there complexity in namespace implementation, caused retrofitting objects rel

css3 - How to properly declare variables in CSS custom fragment shader? -

for reason every time declare custom variable in css fragment shader, shader stops working. have no idea why case since i'm quite sure syntax correct. here html code , css: #holder{ width:600; height:600; -webkit-filter :custom(url(v.vs) mix(url(f2.fs) multiply source-over), 20 20); } ... ... <div id="holder"></div> here fragment shader f2.fs: void main() { uniform float time;//remove line , shader work! css_mixcolor = vec4(0.738, 0.821, 0.321, 1.0); css_colormatrix = mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ); } instead of uniform float , tried float or vec4 test = vec4(1,1,1,1); , no matter shader won't applied every time tried declare custom variable. thoughts? i'm not familiar shaders in css, in webgl have declare uniform s @ top level, outside of main .

character encoding - How to get charset of filename -

good day, all. is there anyway retrieve charset of filename? i want transform charset of file's name (not include content) specific encode utf-8. need original charset achieve that. any solutions appreciated. commandline solution better. this,you can current character set: system.getproperty("file.encoding")

android - How to destroy the activity when logout? -

i developing apps in android. in have login , logout activity session management using sharedpreferences. apps logout , store data in sharedpreferences maintain session done. when logout apps(second activity) , rendered first activity(login activity ) happen when clicked button on emulator after logout still again rendered second activity , version 2.3.3 etc encountered exception java.lang.runtimeexception: unable destroy activity {com.oj.bs/com.oj.bs.loginactivity}: java.lang.nullpointerexception can fix problem. please refer following code following login activity code sessionmngr = new sessionmanager(getapplicationcontext()); jsonobject json_user = jsonobj.getjsonobject("user"); sessionmngr.createloginsession(id,json_user.getstring(key_uname), json_user.getstring(key_uemail)); . . following session management public class sessionmanager { share

How to pass variables to a class in c# -

i've simple code: class resourceinterceptor: iresourceinterceptor { public bool onfilternavigation(navigationrequest request) { return false; } resourceresponse iresourceinterceptor.onrequest(resourcerequest request) { request.referrer = "http://www.google.com"; return null; } } i need pass variable class (just read it, not edit), if insert variable not declared within class gives me error: cannot access non-static member of outer type 'windowsformsapplication1.form1' via nested type 'windowsformsapplication1.form1.resourceinterceptor' for example need somethin (obviously doesn't works!) public string referrer = "www.google.com"; class resourceinterceptor: iresourceinterceptor { public bool onfilternavigation(navigationrequest request) {

ios - Organizer - Archives. Different name than ${PRODUCT_NAME} -

Image
i'm having issue that's driving me crazy. i'm using ejecta js wrapper (sorta phone gap games). i double checked in xcode , ${product_name} set correctly in "build settings"->"product name", check everywhere knowledge took me , in xcode there no mention anywhere of "ejecta". , if case archive (no issues, no warnings) , in organizer, under name find "ejecta" instead of correctly set app name. can me understand why? issue be? thank help i'm thinkig of few things here. the bundle display name in info.plist file maybe created file called infoplist.strings cfbundledisplayname 'ejecta' if none of it, track down (see included screenshot). create run script phase in target make sure option 'show environment variables in build log' selected make stop error code (>0) when error generated, right click -> show in log check everywhere word 'electra' hope helps

objective c - Are we able to call dictation feature on Mountain lion on button click -

mountain lion dictation feature invoked default while pressing fn key twice in text control. i know if possible invoke same feature other controls , events, example invoke after button click event? i application use default dictation feature provided mountain lion. cross platform application (wxwidgets) has editor derived wxcontrol, not have default behaviour invoking dictation feature; feature works works fine if use default text control instead. please suggest. thanks you can try this: nsapplescript *scriptforcmdkey = [[nsapplescript alloc] initwithsource:@"tell application \"system events\"\nset theprocess first process frontmost true\ntell theprocess\nrepeat 2 times\nkey down {command}\nkey {command}\nend repeat\nend tell\nend tell"]; [scriptforcmdkey executeandreturnerror:nil]; nsapplescript *scriptforfnkey = [[nsapplescript alloc] initwithsource:@"tell application \"system events\"\nset theprocess first process frontmost

mysql - GROUP_CONCAT but with limits to get more than one row -

i developing small jumbled-words game users on ptokax dc hub manage. this, i'm storing list of words inside mysql table. table schema follows: create table `jumblewords` ( `id` int(10) unsigned not null auto_increment, `word` char(15) not null, primary key (`id`), unique index `word` (`word`) ) comment='list of words used jumble game.' collate='utf8_general_ci' engine=myisam; now, in game-engine; want fetch 20 words string randomly. can achieve query similar this: select group_concat(f.word separator ', ' ) ( select j.word word jumblewords j order rand() limit 20) f but have execute statement everytime list expires(all 20 words have been put before user). can modify query can fetch more 1 row results generated query have above? probably easier way solve problem storing random words in temporary table , later extract values. stored procedure perfect that. delimiter // drop procedure if exists sp_jumbleword

mongodb - Error throwing when trying to use new data base - wrong type for field (0) 1 != 2 -

i getting below error while trying run show collections, dropdatabase(), repairdatabase() commands etc. below mydb new database. mongos> use mydb switched db mydb mongos> show collections thu apr 18 08:25:05.435 javascript execution failed: error: { "$err" : "error creating initial database config information :: caused :: wrong type field (0) 1 != 2", "code" : 13111 } @ src/mongo/shell/query.js:l128 mongos> db.dropdatabase(); thu apr 18 08:25:10.285 javascript execution failed: error: { "$err" : "error creating initial database config information :: caused :: wrong type field (0) 1 != 2", "code" : 13111 } @ src/mongo/shell/query.js:l128 mongos> db.repairdatabase(); thu apr 18 08:36:17.170 javascript execution failed: error: { "$err" : "error creating initial database config information :: caused :: wrong type field (0) 1 != 2", "code&quo

multithreading process in C++, all threads are ended up without completion -

i run following code using pthread.h... while run, before thread finishes, code exits... i attached code... #include<iostream> #include<pthread.h> using namespace std; #define num_threads 5 void *printhello(void *threadid) { long tid = (long)threadid; cout<<"hello world! thread id,"<<tid<<endl; pthread_exit(null); return &tid; } int main() { pthread_t threads[num_threads]; int rc; int i; for(i=0;i<num_threads;i++) { cout<<"main() : creating thread,"<<i<<endl; rc = pthread_create(&threads[i],null,printhello,(void*)i); //sleep(1); if(rc) { cout<<"error:unable create thread,"<<rc<<endl; exit(-1); } } pthread_exit(null); return 0; } you should join threads before call pthread_exit in main. for (i = 0; < num_threads; i++) { pthread_jo

php - trying to understand some codes in zend framework -

project/index.php <?php error_reporting(e_all|e_strict); date_default_timezone_set('europe/london'); set_include_path('.' . path_separator . './library' . path_separator . './application/models/' . path_separator . get_include_path()); include "zend/loader.php"; zend_loader::loadclass('zend_controller_front'); // setup controller $frontcontroller = zend_controller_front::getinstance(); $frontcontroller->throwexceptions(true); $frontcontroller->setcontrollerdirectory('./application/controllers'); // run! $frontcontroller->dispatch(); ?> zend/controller/front.php <?php ... class zend_controller_front { ... protected static $_instance = null; ... protected $_throwexceptions = false; ... protected function __construct() { $this->_plugins = new zend_controller_plugin_broker(); } ... public static function getinstance() { if (null === self::

How to combine TRIM and LOWER functions in JPQL? -

i need perform following select: select c.address customer c lower(trim(c.name)) = :name but following exception: javax.persistence.persistenceexception: org.hibernate.exception.sqlgrammarexception: not execute query any idea how can combine trim lower ? i discovered solution, must use both in order statment work: select c.address customer c lower(trim(both c.name)) = :name

c# - TryParse: which value is set in case of error? -

the signature of tryparse method int (others same) following: public static bool tryparse(string s, out int result) where "out" means result must initialized in case parsing not successful. documented values tryparse(s) set variables in case of unsuccessful parsing? i need initialize values parsed values or default values in case of unsuccessful parsing, in case of guaranteed default values don't need check result. is documented values tryparse(s) set variables in case of unsuccessful parsing? yes, it's documented . result when method returns, contains 32-bit signed integer value equivalent number contained in s, if conversion succeeded, or 0 if conversion failed.

web scraping - PHP Simple HTML DOM Parser find elements with multiple attributes -

i'm using simple html dom parser can't figure out how following : imagine have : <td style"color:#e05206" width"22" height="58">ok</td> <td style"color:#e05206" width"22" height="58" align="center">not ok</td> <td style"color:#ffffff" width"22" height="58">not ok</td> i want ok. i tried : $results = $html->find('td[style*=color:#e05206], td[width*="22"], td[height*=58], td[!align]'); i thought right answer, not, because applies or , not and . i want ok , not elements. summarize td has v , x , y , not z. possible ? thanks answers ! update : not searching ok, else. searching td has attribute v=something , x=something , y=something , not z. var okelement = new array(); $("table tr").find("td").each(function(){ tdvalue = $(this).text(); if(tdvalue == "ok"){