Posts

Showing posts from February, 2014

How to create crystal reports using vb6 and mysql -

i want create crystal reports using vb6 , mysql providing connection string in code. able create reports using report expert wherein choose database , tables fields manually. application client-server based, database on server , client use database view crystal report on machine. using crystal reports 8.5. kindly me find solution this.

compatibility between astrological stars according to two dates of birth in c# -

i have question little project based on checking compatibility between 2 astrological stars checking 2 dates of birth (e.g: date of birth of first person(1-19(first digit represents month , 2nd digit represents date)) second person's dob entered accordingly.my code working when entering 2 dates of birth means telling month,date , astrological star according dates of birth entered. when trying find compatibility between 2 specific stars calculating first result in if else statement,if result in first if else control structure not found not jumping next else if statement, directly jumping last else statement.. first time posting question here please me..if can here code sample!!! datetime date = convert.todatetime(console.readline()); console.writeline("month:" + date.month); console.writeline("day:" + date.day); month = date.month; day = date.day; month1=date1.month; day1=date1.day; str...

c++ - Intellisense no longer highlighting type specifiers -

in visual studio 2012 type specifiers in cpp files no longer being highlighted. not cpp files affected, each day few more are. i have followed suggestions in this stackoverflow post. thing worked colinburke's suggestion. selecting end of last line of file, , saving file (ctrl-s) fixes problem. however, workaround. if not save way each time while working affected file type specifier highlights disappear. has had similar experience , have solution?

artificial intelligence - AIML Implementation for android application -

i developing android application using aiml. new aiml don't know how can implement aiml in application.i found program-ab useful still in trouble.if 1 know how can please give me guide line regarding this. feel free ask question. to , must use program o https://github.com/program-o/program-o , have create php mysql server , install program o interface android app consume rest api rest json / xml both options configurable

html5 - Rich Snippet works with no html 5 pages? -

this question has answer here: implement microdata non html5 page 1 answer i adding microdata in page of site. site standard html ,not html 5. can add without change heading of pages? <div itemscope itemtype="http://data-vocabulary.org/person"> <h1 itemprop="name">mark pilgrim</h1> </div> microdata, includes itemscope , itemtype attributes part of html5 work there's no standard doctype available using microdata earlier doctypes. i think have change heading of pages html5. best way forward. but think consumers of microdata unlikely care doctype using.

objective c - IOS system time is different when converting NSDateFormatter -

i setting datetime this nsdate* = [nsdate datewithtimeintervalsincenow:[[nstimezone systemtimezone] secondsfromgmt]]; and used value name 'now', trying convert nsstring this nsdate *date = [object valueforkey:@"datetime"];// valueforkey:@"datetime"=now nslog(@"%@",date); nsdateformatter *formatter = [[nsdateformatter alloc]init]; [formatter settimezone:[nstimezone systemtimezone]]; [formatter setdateformat:@"yyyy"]; nsstring *year = [formatter stringfromdate:date]; [formatter setlocale:[nslocale systemlocale]]; [formatter settimezone:[nstimezone systemtimezone]]; [formatter setdateformat:@"mm"]; nsstring *month = [formatter stringfromdate:date]; [formatter setlocale:[nslocale systemlocale]]; [formatter settimezone:[nstimezone systemtimezone]]; [formatter setdateformat:@"dd"]; nsstring *day = [formatter stringfromdate:date]; [formatter setlocale:[n...

c++ - Qt 4: How to insert QAction in menu of mainwindow -

my problem qaction of custom widget outside , insert in menu of mainwindow. there qactionwidget inserts custom widget in menu. class qdesigner_widget_export photo_list: public qwidget { q_object public: photo_list(qwidget* parent = 0); ~photo_list(); int count(); qstring returnimagepath(const int i); void sendsignalimageloaded(); public slots: void addimagepath(); void deleteimagepath(); signals: void imageloaded(int count); //private: public: ui::photo_list *m_photo_list_ui; qstringlist m_image_path_list; }; class ui_photo_list { public: qaction *addimageaction; qaction *deleteimageaction; qgridlayout *gridlayout; qlistwidget *listwidget; void setupui(qwidget *photo_list) { if (photo_list->objectname().isempty()) photo_list->setobjectname(qstring::fromutf8("photo_list")); photo_list->resize(274, 210); addimageaction = new qaction(photo_list); addimageaction-...

android - Conditional XML edittext format -

is possible conditionally format widget using xml layout files? for example: if value of edittext < 10, write in red, otherwise write green. here java code: // code if (integer.parseint(edtxt.gettext().tostring()) < 10){ edtxt.settextcolor(color.red); }else{ edtxt.setcolor(color.green); } //or edtxt.settextcolor (integer.parseint (edtxt.gettext().tostring()) < 10 ? color.red:color.green); and put "this code" inside xml? it can done if extend edittext custom view , there logic. can use attributes enter values comparison, , colors.

c++ - Change text color on button push WIN32 -

how change text color edit box on button push? (win32/c++). know how change text font (i.e. use in wm_command , sendmessage() wm_setfont ). on changing text color think need interaction between wm_command , wm_ctlcoloredit , , sendmessage() don't know kind of parameter . thank you. i've figured how on single button. 1 more question please. if use code above 3 different buttons, doesn't behave expected . there snippet : case idc_button3: textflagred = textflagred; textflagblue = !textflagblue; textflaggreen = !textflaggreen; invalidaterect(textarea2, null, true); break; case idc_button4: textflaggreen = textflaggreen; textflagblue = !textflagblue; textflagred = !textflagred; invalidaterect(textarea2, null, true); break; case idc_button5: textflag...

asp.net - How to check user is in administrator group or not -

how user's group or user in admin group or not ? i using .net framework 3.5 web application. i user name follows: dim struser string = system.web.httpcontext.current.user.identity.name.toupper now, need check whether user in admin group or not ? or else, user's group. please share me stuff helps me achieve this. thank you. var isadmin =((system.security.principal.windowsprincipal)this.httpcontext.user).isinrole(system.security.principal.windowsbuiltinrole.administrator)

position - check if input is within specified ranges in c++ -

i'm asking inputs , want have outputs depending on range within inputs fall. example : i accept inputs 0.3 0.55 etc. range 0.0 1. the "step" 0.1. meaning there 10 positions/checkpoints. if input 0.3, since 3 times "step" should return "position 3", if smaller 0.3 larger 0.2 should return "between positions 2 , 3" etc. question: can done without explicit if-statements, or switch cases, possible positions?? it's easy write such function, based on value of (input-range_min)/(range_max-range_min)*10. struct position { int positionlow; bool inbetween; }; position whereinrange(float input, float minscale, float maxscale, int numpositions) { position res; float fplace = (input-minscale)/(maxscale-minscale)*numpositions; res.positionlow = int(floor(fplace)); res.inbetween = res.positionlow != fplace; }

makefile - Can I define an install rule / install hook in configure.ac -

say there bunch of (e.g. 200) modules depend on core module. using autotools. the core module installs core.m4 file dependents use various things. all dependents have lines in install-data-local rule generate scripts , install them, e.g. core_stuffdir=$(prefix)/share/core/stuff/ install-data-local: generate-stuff stuff.xml test -d $(destdir)$(core_stuffdir) || mkdir $(destdir)$(core_stuffdir) stuff=`xmllint --xpath '//stuff[@install="yes"]/@name' stuff.xml`; \ $(install_data) $$stuff $(destdir)$(core_stuffdir); \ rm $$stuff … $(install_data) other-module-specific-stuff … … i remove 5 lines redundantly duplicated on ~200 files, , instead define lines in core.m4. dependents should able somevar: somevalue (or short, @ worst one-line thing in install-data-local) , have lines executed during make install. is there nice way define these lines in core.m4 , make them available makefile.am?...

java - JPanel paintComponent in a Thread -

i found nice code on web drawing binary tree. created binary search tree algorithm it, if pass root node function, draws out tree. want make draw step step, running in thread, , making sleep after inserting element. problem is, guess, jpanel won't returned until drawing complete, if runs on different thread, won't added split pane ( have many sorting algorithms implemented, , being painted, , can accessed same tabbed pane. every tabbed pane contains split pane , every split pane contains controlling buttons, , jpanel, draw algorithms, others not extend jpanel! ). please me find way run in totally different thread main program, , able see how draws tree? please not judge me on code, put fast, trying make work, not way code. public class binarytree extends jpanel implements runnable { private int radius = 20; private int vgap = 45, hgap = 150; private int x = 350, y = 25; private graphnode root; private binarysearchtreesort binarytreesort; private int latency = 270; priv...

java - GWT SuperDev Source Code not Showing -

i'm following instructions in blog post ( http://www.badlogicgames.com/wordpress/?p=3073 ) trying debug gwt version of libgdx project. i can compile gwt project fine, , start superdev code server using en eclipse "run as" profile. start jetty using mvn verify -phtml , browse localhost:8080/index.html , enable dev mode per blog post. of note don't see dialog box described in post ("gwt modile 'blah' may need recompiled"). when looking @ sources in chrome's developer tools, don't see of linked java source under localhost:9876 tree node; instead see this: localhost:9876 projectname gwt/chrome chrome.css {some long md5-lookign thing}.cache.js projectname.nocache.js it's ace if figure out how see code linked there , put breakpoints in, @ moment i'm getting gdxruntimeexception message of "not implemented" thrown somewhere, i've no idea where.

git - Stash Merge 2 Repositories with complete History -

i want merge 2 repositories in same project in stash. complete history should merged too. there way this? stash developer here. git question. depending on how want/need repository merged recommend first check out git subtree: http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ alternatively can run git pull ../other_git_dir in first repository, , fetch commits on default/current branch (eg. master) second repository. note works 1 branch @ at time. more reading: http://scottwb.com/blog/2012/07/14/merge-git-repositories-and-preseve-commit-history/ if you're talking creating pull request can't (currently) across 2 unrelated (eg. non forked) repositories in stash. pull history 1 repository (as above) , create pull request way.

flash - AS2 - buttons sometimes, cant be clickable, unless you move the pointer slightly -

i'm using as2(i know, know...) create simple games, however, buttons made, randomly stop working (randomly every time run game) what click button once, job, , can't click again, unless move pointer (it buttons). i have keyboard short-cuts same function buttons, , keyboard hot-keys working normaly and i'm using script.. on(release){ dosomething(); } like said, bug totally random, , have no idea how fix :( fix: can't answer because i'm newb user 8 hours: soo.. guess had focus, becaus manualy set focus on different items, , reason screws buttons... tried tho, select button, , in properties under tracking options, select option track menu item, , fixed (i think :d) its been while since have used actionscript2 buttons beleive if enter object has 3 options on timeline bar there , 1 button looks when hooverd, pressed , can select being pressed(put alpha rectangle on object , make big want hitarea be

ios - How to implement xcode storyboard with left side menu (without slide)? -

i tried search on website don't found want. i'm developing first ipad app xcode (ios 7) , i'd put list displayed @ left , when clicking on elements of list view controller has changed. should use masterdetail ? or else? how can represent in storyboard? thanks picture here yes, use master detail template. create uisplitview list on left , detail view on right. can adjust code needs.

Using a native C++ dll in a C# ASP.NET Website -

in order use native c++ dll in c# asp.net website have done following based upon numerous researches: (1) created c++ native dll: cmatrix.dll containing constructors cmatrix(); cmatrix(unsigned int m, unsigned int n); it has been tested. (2) created c++/cli wrapper dll: managedcmatrix.dll. example contains following class: public ref class managedcmatrix { public: managedcmatrix(); managedcmatrix(const unsigned int m, const unsigned int n); ~managedcmatrix(); ... private: cmatrix * m_mat; }; first constructor example: managedcmatrix:managedcmatrix() { m_mat = new cmatrix(); } again have tested dll referencing c# project - seems work (3) have added managedcmatrix reference c# asp.net website making sure , cmatrix.dll in bin directory of website. make sure path environment variable includes bin directory. when use managed wrapper class in: managedcmatrix = new managedcmatrix(m,n) an exception thrown. this exception th...

mysql - Convert SQL to ActiveRecord Query -

how can convert following sql query activerecord query in order mitigate sql injection? jacket_colors ||= [2,21,25,20] jacket_types = jackettype.find_by_sql(<<-sql) select j2.*, t1.no_count jeans j2 inner join ( select j1.jean_id jean_id, count(j1.id) no_count tracks t inner join jacket_types j1 on j1.track_id = t.id inner join jeans j2 on j2.id = j1.jean_id t.status = 0 , j1.status in (#{jacket_colors}) , t.type != 'trekkingtrack' group j1.jean_id having count(j1.id) > 0 ) t1 on t1.jean_id = j2.id sql jacket_types varies user input. i tried following doesn't work , produces incorrect sql. jacket_colors ||= [2,21,25,20] jean.joins(:jacket_types, :track) .select('jeans.jacket_types_id jacket_types_id, count(jeans.id) no_count'). where('jeans.status in (?) , tracks.status = ? , tracks.type != ?', jacket_colors, 0, 'trekkingtrack') .group('jeans.jacket_type...

sql server - Joining sql queries -

can these 2 queries? query one: declare @startdate datetime declare @enddate datetime set @datainicio='2014-03-01' set @datafim='2014-03-03' select right([location code],4) vehicle,min(cast(cast([date]as date) datetime) + cast([entry time]as time)) daeamin,min([veihicle kms]) kmsmin,max(cast(cast([date]as date) datetime) + cast([entry time]as time)) datemax,max([veihicle kms])as kmsmax quantity>=0 , [location code] 'v%' , [item no_]='601.0001' , ([date] between @startdate , @enddate) group [location code] query two: select vehicles.designation vehicle, sum(locations.distancefromlastlocation)/1000 kms,convert(varchar(10),locationdate,120) date locations inner join vehicles on locations.vehicleid = vehicles.vehicleid group vehicles.designation,locationdate i want join these 2 query vehicle , date in query 2 must between datemin , datemax query one. help please thanks. hope helps , little easier understand other an...

rest - Spring 3.1.1 and json getting error 406 -

i have written simple rest based controller using @responsebody expect return json. somehow not able work expected. when run url "http://localhost:8080/my-webapp/amazon/rips" ..it throws below error http status 406 -jbweb000126: resource identified request capable of generating responses characteristics not acceptable according request 'accept' headers. can please lend helping hand. mycontroller below: @controller @requestmapping("/amazon") public class jsoncontroller { @requestmapping(value="/{name}", method = requestmethod.get,produces = "application/json") public @responsebody book getshopinjson(@pathvariable string name) { book book = new book(); book.setname(name); book.setavailablity(false); return book; } book class below: public class book { public string getname() { return name; } public void setname(string name) { this.name = name; } public boolean isavailablity() { return avail...

PHP: define own server variable -

i've found own superglobal variable in php? here says there no way somehow define/use "server variable" same different users/sessions. but since few years has passed may has changed? , such possible? basically want run php script triggered user event, don't want run more e.g. once per 30mins. frst thought keep "server side var (that visibles sessions/clients)" , if user trigger event (e.g. open page) check if script been running last 30 mins open page, if no before opening page e.g. purge outdated/passed things. yes understand can workaround mysql etc... why workaroud if php support need. thank in advance! a regular php variable cannot persisted beyond current execution of script. once script ends, variables gone. that's basic nature of php; in fact it's basic nature of computer programs, it's php typically terminated quickly. persist data beyond single script invocation, have several options store data: a database a file...

java - How to create a package in an hierarchical view in eclipse -

Image
i using eclipse juno . have started learning java , facing issue in creating package within package. getting flat view of packages. want create package com.soft.entity com package contains soft package further contains entity package. pfa screenshot screenshot 2: screenshot 3 screenshot 4 any lead appreciated. thanks put package name as: com.soft.entity in option: file > new > package see screenshot: to see in hierarchical view see screenshot: you'll see hierarchical structure when added more packages, if have one, you'll see in single line. for instance, adding second package:

java - Is shared Memcache guarantees the order of a list? -

i putting list of objects in shared memcache below. list<terminology> terminologylist = companyservice.getterminologylist(); memcacheservice memcacheservice = memcacheservicefactory.getmemcacheservice(); memcacheservice.put("terminologylist", "terminologylist") list<terminology> oldterminologylist = (list<terminology>)memcacheservice.get("terminologylist"); will terminologylist , oldterminologylist come in same order? yes guarantee order. it's not memcache guarantees order, because memcache stores byte array. it's client side java api object-to-byte-array serialization, uses plain java serialization . guarantees object put in same object out. also, order of objects in list guaranteed specification : a list ordered collection (sometimes called sequence) . maintain order of elements put in.

c++ - C++17 resumable/await : Can it also be used with boost::future? -

in c++17, there's nice future c#'s await . std::future<int> get_answer() { return std::async(std::launch::async, [] { return 42; }); } std::future<void> do_something() resumable { // ... int = await get_answer(); // ... } but wonder whether boost::future can used or not: boost::future<int> get_answer() { return boost::async(boost::launch::async, [] { return 42; }); } boost::future<void> do_something() resumable { // ... int = await get_answer(); // ... } the paper linked ( n3722 ) explicitly says std::future<t> , std::shared_future<t> accepted return type resumable function: the return type of resumable function must future or shared_future . restrictions on t defined std::future, not proposal, t must copyable or movable type, or ‘void.’ must possible construct variable of t without argument; is, has have accessible (implicit or explic it) default constructor if of class ty...

jquery - How to call three function within one function in javascript each function should be called after finishing first -

how call 3 function within 1 function in javascript each function should called after finishing first function receive value user.. javascript code: function abc(){ var ans = ask(); /// contain html custom confirm button if(ans == true) { do_action(); } else { refuse_action() } } actually want create own javascript confirm dialog using designing in html. i have create 2 button in name yes or no i want call do_action function if click on yes or refuse_action if click on no button. thanks in advance. what looking $.deferred() in jquery. in order work, functions have return promise . without going detail, general structure you're looking for: function showdialog() { var ret = $.deferred(); // render confirm dialog, , show // 'ok'-button needs call ret.resolve(); // call ret.reject() when user clicks 'cancel'. return ret.promise(); } the calling function has following: ...

wordpress - Woocommerce Cart functionality based on case and normal price -

i have product $price = $10.27; $case price = $80.09 $case quantity = 12 have make working if user add 12 bottles cart price $80.09 if add 1 more bottle in cart 12+1 price changes $80.09 $133.51 want if there 13 bottles in cart value should $80.09+$10.27 = $90.36; can suggest on this. thanks follow these links. can idea custom function. add custom fee woocommerce cart add surcharge cart

ios - Animation of a view's subview hiding behind another view -

im trying animate uiimage subview of uiview in interface builder. problem is, animation goes "through" view table view , "goes behind" , doesn't show way. view hierarchy this: view view subviewtoanimate tableview i have tried [self.view bringviewtofront:subviewtoanimate] both in view itself, , in animation. code animation: -(void)startanimationwithimageview:(uiimageview*)imageview{ imageviewtomove = imageview; imageviewfirstalpha = imageviewtomove.alpha; firstcenterofview = imageviewtomove.center; double firstx =self.parabelwidth*self.startvalue; double firsty = self.parabelheight*pow(self.startvalue, 2); firstpointofparabel = cgpointmake(firstx, firsty); if (points) { points = nil; } points =[[nsmutablearray alloc]init]; (int counter = self.startvalue; counter < self.stopvalue; counter++) { double y = self.parabelheight*pow(counter, 2); double x = self.parabelwid...

neo4j - Possible Bug in the 2.0.0 webclient -

when downloading packed server version of neo4j community v2.0.0, provide web interface cypher, however, cannot make accept queries of form: match (a:person {name: {value1}}) return a; it calls syntax error on first curly bracket, , accept match (a:person) a.name ="value1" return a; am using wrong, or bug in parser? first form appears work fine when use embedded client, when using webclient interface there problem. update: clear, in 2.0.0 web interface, examples cypher 2.0 reference card throw syntax errors; e.g. line match (n {name:'alice'})-->(m) return n reference card: http://docs.neo4j.org/refcard/2.0/ gives following error: node properties cannot specified in context (line 1, column 10) "match (n {name:'alice'})-->(m)" even though works fine when passed cypher execution engine in embedded client. answer: turned out problem was using milestone release not complete/bug free. 2.0.1 stable release solves problem....

java - Reset primary key counter in JDBC -

i how can reset primary key counter in jdbc:derby code? want reset when delete database records, leave tables intact. when that, primary key counter not reset , continue ended. thinking this alter sequence <tabname>_<id>_seq restart 1 will work? , if yes work correctly? this explained in columnalteration section of alter table statement section in derby reference manual.

android - How to read draft message address , it always returns null value -

i implementing sms application, want store sms values internal xml file , restore sms values xml file sms application, far inbox messages , sent messages working fine problem draft messages. please me on , thank you. // create draft box uri uri drafturi = uri.parse("content://sms/draft"); // list required columns string[] reqcols = new string[] { "_id", "address", "body" }; // content resolver object, deal content provider contentresolver cr = getcontentresolver(); // fetch sent sms message built-in content provider cursor c = cr.query(drafturi, reqcols, null, null, null); <uses-permission android:name="android.permission.read_sms"></uses-permission> tutorial link

mysql - Checking database for duplicate values, no error -

hi hoping @ section of code see if can find mistakes can't seem figure out, section of code is; //check if "date" textbox has value if ((isset($_post['date'])) && (isset($_post['save']))) { //check if there entry date $query = "select date `".$username."weight` date= " . $_post['date']; $existingdate = mysql_query($query) or trigger_error(mysql_error().$query); $results = mysql_num_rows($existingdate); if($results > 0) { $exists = "there entry date. add entry please select date 'weight history' section , click 'edit'"; } else { $date = $date; } } the situation is; - user enters date, weight , have option of entering notes. - when log in user , enter information, enters database fine. - but, when user goes enter entry, want first check havent made entry day. therefore, above code checks if table contains entry specified d...

javascript - onmouseover in CodeIgniter -

i have view displayed titles checkboxes. when put cursor on title want display me text box contains little description of title. try put in title $row['description'] doesn't ok. want configure box have displayed title $row['pubdate'] , $row['description'] . i've tried onmouseover don't know how function. help? <?php foreach ($query $row){ echo '<tr><td> <label class="checkbox"> .form_checkbox('delete[]', $row['link']).anchor("site/see_art/".$row['feed_id'],$row['title'],'title='.$row['title'].''). "</td><td>".substr($row['pub_date'], 5, 12). "</label> </td></tr>"; } ?> put div position:absolute in label , show on mouseover: html: <label class="checkbox"> <input type="checkbox" name="nom...

c# - Adding an empty row to the datatable at the end when reading excel and fill to the datatable -

i have read excel file using oledb , fill datatable. fine when delete each cell of each column in excel file using delete button keyboard, empty row gets added data table after read. when delete entire row select, problem not reproduce. if knows solution please let me know. i used below connection string "provider=microsoft.ace.oledb.12.0;data source=" + path + ";extended properties=\"excel 12.0;imex=1\"";

Python - Sum with Start -

>>> sum([1,2,3]) 6 failed attempt declare start position: >>> sum([1,2,3],1) 7 docs sum(iterable[, start]) can supply me example of using sum declaring start position please. that start means sum starting value, not position on array: sum() : sums start , items of iterable left right , returns total. if want accomplish can use list slicing: >>>sum([1,2,3][1:]) 5 this slicing won't work iterator, in case can use enumerate() in generator expression. this: >>> i=iter([1,2,3]) >>> sum(v i,v in enumerate(i) if >= 1) 5 or better yet pointed out @lvc on comments, use itertools.islice() function slice iterator: >>>import itertools >>> i=iter([1,2,3]) >>> sum(itertools.islice(i,1,none)) 5

javascript - push to first free place in an Array -

what beautiful way of doing so? var arr = [1,2,3,undefined, null,,null]; pushing 4 output: [1,2,3,4,null,,null] var ind = arr.join().split(',').indexof(''); if (ind !== -1) arr[ind] = 4

c# - File Uploading to Server -

i working in asp.net , want upload file server shows me error the saveas method configured require rooted path, , path ~/192.zzz.zzz.z/caheadservices/imagesniinir.jpg' not rooted. here code protected void btnupload_click(object sender, eventargs e) { try { fup.saveas("~/192.zzz.zzz.z/caheadservices/images" + fup.filename); } catch (exception ex) { response.write(ex.message); } } please me out. protected void btnupload_click(object sender, eventargs e) { try { fup.saveas(server.mappath("~/192.zzz.zzz.z/caheadservices/images" + fup.filename)); } catch (exception ex) { response.write(ex.message); } }

c# - How to update database using addon entity framework model? -

i'm using tinymce give me html tags user desire, store them in database , call them later @ appropriate portion of pages. everything working fine until hit update button, tells me updated find send same old data. this updating syntax use int id1 = int.parse(request.querystring["titelid"]); webmarketingentities wme = new webmarketingentities(); articls ar = new articls(); articls query = (from art in wme.articls art.id==id1 select art).first(); ar.articalcontent = txtconteny.text; ar.pagedescription = txtdescription.text; ar.pagetitle = txttitle.text; wme.savechanges(); i figured solution: i should have written select statement following: if(!page.postback) { //your select syntax }

create this HTML markup with Javascript ( a complex DL entry of Dt and DD) -

dear friends of stackoverflow, need make following html markup entry definition list "dl" thru javascript can make entry dynamically. need edit css values. put css entry after html. in dd entry there class, anchor class, href, text, anchor class, , href. don't know proper syntax enter these thru javascript. many help. markandeya <dt class="book2"><span>book2</span></dt> <dd class="book2"><a class="amazonlink" href="http://www.amazon.co.uk/principles-beautiful-web-design/dp/0975841963%3fsubscriptionid%3dakiajcfyspa5v4zscm6q%26tag%3dstevwork-21%26linkcode%3dxm2%26camp%3d2025%26creative%3d165953%26creativeasin%3d0975841963"><img src="http://ecx.images-amazon.com/images/i/41fxc9u%2b%2bvl._sl160_.jpg" alt=""></a><br> <strong>beautiful web design</strong> jason beaird.<br> book teaches wide range of topics on how make great web sites, cove...

php - sharing cookie and session between subdomain -

i have m.xxxx.com , www.xxxx.com subdomains project in www.xxx.com , when need send ajax request login , on return value when call again session , cookie removed i testing application www.xxxx.com/mobile and request worked probebly should and sitting access-control-allow-origin:*; for cross origin problem session not sharing between 2 subdomains try this: the way can think of save session data cookie, open cookie when other domain accessed. can read how here: http://www.depiction.net/tutorials/php/cookies-session-variables.php why want this? or also can try you looking function: session_set_cookie_params() . have 2 domains: site1.example.com site2.example.com in order share session data across both domains, call following function before session_start() : session_set_cookie_params(0, '/', '.example.com');

objective c - Handling Cusom Key Board Types in ios -

this question has answer here: how add custom fonts iphone app? 3 answers here in ( http://iosfonts.com/ ) site, number of fonts listed ios devices supports. indian language, tamil, there font named sangam. understanding there no localization support languages tamil, telugu or devanagiri. ios supports ttf , opentype fonts both added xcode, possible create custom keyboard lay out, typing using these fonts. these languages has no similarities of language keyboard apple supports presently, there way type, store , share text contents using these custom type fonts. yes, embed font files (.ttf or .otf files) in app add them list of dedicated uiappfonts key in info.plist file (note: key called "fonts provided application" in human-readable description) . see the doc here . you can use [uifont fontwithname:size:] name of custom font manipulate font , ...

uilabel - How to use NSLineBreakByCharWrapping with setNumberOfLines:1 on iOS? -

for example, if text uilabel is: "questions may have answer" , want print "questions may alr" . don't want clip last character cut text @ point. i cannot use character limit fonts not monospaced. cannot use clipping may cut text @ point or may cut last letter "r" of it. the behaviour want similar nslinebreakbycharwrapping while numberoflines = 0 . so, want drop(wrap) non-fitting last character want drop/wrap hidden space = don't want second line. how can possible? to required output need know width of label, can known following method: cgsize size = [string sizewithattributes: @{nsfontattributename: [uifont systemfontofsize:17.0f]}]; // ios 7 , later cgsize size = [string sizewithfont: [uifont systemfontofsize:17.0f]]; // prior ios 7 set size of label above calculated size. set numberoflines property 1; set linebreakmode property nslinebreakbycharwrapping; uilabel *y...

javascript - Infinite scroll problems with get value -

i trying make infinite scrolling script. works fine on index.php page..but when try sort items on page,thats goes wrong.. code: $limit = 10; $page = (int) (!isset($_get['p'])) ? 1 : $_get['p']; $sql = "select * items"; $start = ($page * $limit) - $limit; if( mysql_num_rows(mysql_query($sql)) > ($page * $limit) ){ $next = ++$page; } $query = mysql_query("{$sql} sold = 0 order id desc limit {$start}, {$limit}"); if(isset($_get["price_lth"])){ $query = mysql_query("{$sql} sold = 0 order price asc limit {$start}, {$limit}"); } if(isset($_get["price_htl"])){ $query = mysql_query("{$sql} sold = 0 order price desc limit {$start}, {$limit} "); } if(isset($_get["sold"])){ $query = mysql_query("{$sql} sold = 1 order id desc limit {$start}, {$limit}"); } when trying sort items goes : www.sample.com/?sold , when scroll page down javascript adds www.sample.com/?sold...

Android KitKat Bluetooth connect -

am 1 having problems connecting bluetooth startbluetoothsco? works fine in versions of android except 4.4.2 (kitkat). suggestions? , yes, have verified connected bluetooth before call this. did changed in 4.4.2? here code: am = (audiomanager)getsystemservice(context.audio_service); am.setmode(audiomanager.mode_in_call); am.setbluetoothscoon(true); am.startbluetoothsco(); following suggestion did following, driving me nuts! doing wrong. have listener in mainactivity follows... private final bluetoothhandler.listener mbluetoothlistener = new bluetoothhandler.listener() { @override public void onconnectioncomplete() { final bluetoothhandler bluetoothhandler = mbluetoothhandler; if (bluetoothhandler != null) { am.setmode(audiomanager.mode_in_communication); } } }; then in oncreate initialize bluetoothhandler if(mbluetoothhandler == null){ mbluetoothhandler = new bluetoothhandler(5000, mbluetoothlistener); } ...

java - Probelm with Maven Install using WAS7 -

note: using maven 3+, see comments. update accepted answer able to. i trying compile project using maven coupled was7 unfortunately seem receiving following error: slf4j: failed load class "org.slf4j.impl.staticloggerbinder". slf4j: defaulting no-operation (nop) logger implementation slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details. [error] error executing maven. [error] com.google.inject.provisionexception: guice provision errors: 1) error in custom provider, java.lang.typenotpresentexception: type javax.enterprise.inject.typed not present @ classrealm[plexus.core, parent: null] @ classrealm[plexus.core, parent: null] while locating org.sonatype.plexus.components.cipher.plexuscipher while locating org.sonatype.plexus.components.sec.dispatcher.defaultsecdispatcher @ classrealm[plexus.core, parent: null] @ classrealm[plexus.core, parent: null] while locating org.sonatype.plexus.components.sec.dispatcher.secdispatcher annotate...

c# - I can't read data from the client -

Image
for educational purposes, writing program passes through sql queries. should work this: but receive not return data. private static byte[] readtoend(socket mysocket) { byte[] b = new byte[mysocket.receivebuffersize]; int len = 0; using (memorystream m = new memorystream()) { while (mysocket.poll(1000000, selectmode.selectread) && (len = mysocket.receive(b, mysocket.receivebuffersize, socketflags.none)) > 0) { m.write(b, 0, len); console.writeline("Я тут"); } console.writeline("и тут"); return m.toarray(); } } static void main(string[] args) { tcplistener mytcp = new tcplistener(new ipendpoint(ipaddress.parse("127.0.0.1"), 8888)); console.writeline("Прослушиваю порт"); while (true) { mytcp.start(); // Запускаю процесс прослушивания if (mytcp.pending()) // Если есть запрос { console.writeline(...

ruby - SSLv3 read server certificate B: certificate verify failed (Twitter::Error) -

i have received error message: twitter/rest/client.rb:96:in 'rescue in request' ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed (twitter::error) my code is: require 'twitter' client = twitter::rest::client.new |config| config.consumer_key = "xxxx" #removed posting config.consumer_secret = "xxxx" #removed posting config.access_token = "xxxx" #removed posting config.access_token_secret = "xxxx" #removed posting end client.status(27558893223) i working windows 7 , ruby 1.9.3. have installed latest certificates , updated ruby gems latest version. i have tried http://railsapps.github.io/openssl-certificate-verify-failed.html , https://gist.github.com/fnichol/867550 , have been able install mentioned there, error persists. this how fix problem windows download .perm file first, set ssl_cert_file in command prompt this: ssl_cert_file=c:\m...

restsharp - API call with name/value in url vs querystring? -

im trying convert call forvo api (forvo.com) hardcoded url string assigning request parameters 1 one forvorequestclass's properties created in c# via .addparameter method ...but when request made...it turns querystring format this: http://apifree.forvo.com/?key=[mykeygoeshere]&language=en&format=json&limit=1&order=rate-desc&sex=f&type=word&word=apple} instead of this: http://apifree.forvo.com/key/[mykeygoeshere]/language/en/format=json/limit/1/order/rate-desc/sex/f/type/word/word/apple i have tried various ways call using restsharp...to no avail...any ideas...?? ok...i believe found answer. on github repo restsharp ( [1]: https://github.com/restsharp/restsharp/wiki/parametertypes-for-restrequest ) found following helpful section: urlsegment unlike getorpost, parametertype replaces placeholder values in requesturl: var rq = new restrequest("health/{entity}/status"); rq.addparameter("entity", "s2...

entity relationship - Can anybody tell me whether I have drawn UML class diagram & er diagram accurately? -

Image
this more help, grateful if can go through below scenario , provide me advice. have drawn uml class diagram , er diagram scenario , need know errors, missing classes/entities in diagrams. i have mentioned scenario in nut shell. highly appreciated. scenario there society (let’s abc). abc society provides financial , cooperative services members . going develop loan management system abc society. abc society has 15 mini banks under control , through loans granted members. loans granted non-members , need have fixed deposit in order loan. instant, housing , pawning 3 different loan types available. customer (could member or non-member) submits loan application relevant documents mini bank. each loan request needs have 2 3 guarantors (depending on loan amount). guarantee person or property . once loan application submitted assigned responsible user user. (both bank staff , abc society staff considered users in system). once loan application assigned user, user gets not...

visual studio 2010 - C# Possible Memory Leak? -

so, have app, written in c# (vs2010), performing ocr using tesseract 3.02 dll , charles weld's terreract .net wrapper. i think have memory leak , seems in area of code pix object allocated. taking pdf, converting grayscale png, loading pix object ocr. when works, works well. image large in size (5100 or pixels in each dim) not large in size (only 500k or so). my code: init engine @ app startup: private tesseractengine engine = new tesseractengine(@"./tessdata/", "eng+fra", enginemode.default); method convert pdf png, calls: // load image file created earlier pix object. pix piximage = pix.loadfromfile(path.combine(textboxsourcefolder.text, sourcefile)); and calls following: // perform ocr on image referenced in pix object. private string performimageocr(pix piximage) { int safety = 0; { try { // deskew image. piximage = piximage.deskew(); //piximage.save(@"c:\temp\img_d...

r - bigz variable type from package gmp with ifelse() -

why following return error? > x <- as.bigz(5) > y <- ifelse(1,x,0) error in ifelse(1, x, 0) : incompatible types (from raw logical) in subassignment type fix i can around doing > x <- as.bigz(5) > y <- as.bigz(ifelse(1,as.character(x),0)) it seems have fact that > as.raw(5) [1] 05 but > as.raw(as.bigz(5)) [1] 01 00 00 00 01 00 00 00 01 00 00 00 05 00 00 00 which suggests ifelse() doing "as.raw" automatically. still though, if > y <- as.raw(as.bigz(5)) > y [1] 01 00 00 00 01 00 00 00 01 00 00 00 05 00 00 00 is possible, difference? basically means there no ifelse.bigz method defined. base::ifelse doesn't understand bigz objects. instead, use if ... else , since if(bigz_x [relationship operator] bigz_y) work because relationship operators have bigz methods, returning logical value if can work with. rgames> if(1) x else 0 big integer ('bigz') : [1] 5

mysql - create single or multiple index name -

i'm trying put indexes on mysql table. questions is, putting multiple columns under 1 index name better having different index names different columns? here's i'm trying say: index name: testindex columns: username, agegroup or index name: username column: username index name: agegroup column: agegroup any difference in terms of performance above approaches?

Rails, ActiveRecord, Squeel: Check if value exists in array -

i have 2 tables: 'actor' & 'role'. each table has column named 'ethnicity'. actor can have 1 ethnicity, role can have 1 or more ethnicities. so example, let's want find roles match actor1's ethnicity below: actor1 - ethnicity: 'asian' role1 - ethnicity: 'asian' role2 - ethnicity: ['asian','caucasian'] this query: role.where{(ethnicity.eq my{actor.ethnicity})} will pull role1, not role2. question how construct query pull role1 role2 in example? i've tried doing: role.where{(ethnicity.in my{actor.ethnicity})} but doesn't seem work. how this? the first question ask how storing ethnicity array on role model? serialized column? if may better of going has_many relationship if going asking ethnicity. it seems problem querying string against value potentially array or string. depending on answer question above solution may different. one option invert your role.where{(ethnicity....

php - sendmail seems to be send mail but never receive -

i trying send e-mails sendmail on command line , php home server. problem facing mail never received mailbox. tried different accounts never received. port 25 open, below post mail.log output: mar 24 15:40:00 freshserver sendmail[16579]: s2oee0pq016579: from=www-data, size=111, class=0, nrcpts=1, msgid=<201403241440.s2oee0pq016579@freshserver.lan>, relay=www-data@localhost mar 24 15:40:00 freshserver sm-mta[16580]: s2oee0bo016580: from=<www-data@freshserver.lan>, size=380, class=0, nrcpts=1, msgid=<201403241440.s2oee0pq016579@freshserver.lan>, proto=esmtp, daemon=mta-v4, relay=localhost [127.0.0.1] mar 24 15:40:00 freshserver sendmail[16579]: s2oee0pq016579: to=n.xxxxx@xxxxx.nl, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30111, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=sent (s2oee0bo016580 message accepted delivery) mar 24 15:40:13 freshserver sm-mta[16576]: s2oeduat016574: to=<n.xxxxxx@xxxxx.nl>, ctladdr=<www-da...