Posts

Showing posts from May, 2015

asp.net - How to convert a dll written in vb.net to c# -

i sorry if asking wrong question. developing website in asp.net. got dll internet needed work. problem is, when debug project, reference code classes in dll runs in vb.net. don't want refer in vb.net in project. how can execute dll codes in c#. the .net framework language-independent, uses clr interprete common intermediate language , .net-assemblies result in. can reference dll , call classes within in c# code. if doesn't suffice needs, you'll need rewrite library using c#, bad idea, because doing work has been done , don't make use of advantage of clr.

c# - DateTimePicker value from Excel -

i wondering if possible set value of datetimepicker queried row in excel. have tried different ways of doing have never came close , help? also displayed on windows form public void readandwritetoexcel() { string mypath = @"c:\excel.xls"; fileinfo fi = new fileinfo(mypath); if (!fi.exists) { console.out.writeline("file doesn't exists!"); } else { var excelapp = new microsoft.office.interop.excel.application(); var workbook = excelapp.workbooks.open(mypath); worksheet worksheet = workbook.activesheet worksheet; // write excel microsoft.office.interop.excel.range range = worksheet.cells[1, 1] range; datetime dt = datetimepicker1.value; range.numberformat = "dd/mmm/yyyy"; range.value2 = dt; // read, var date = worksheet.cells[1, 1].value;

linux - How to make sure php has write permissions on wp dedicated server -

i have been struggling time. moved wordpress site on prq domain dedicated server. script used picture uploads. didn't folder structure of wordpress date , instead have file structure in uploads places picture in subfolder post id name. worked fine on prq domain, fails work on new server. not super knowledgeable being server admin, here have tried. chown-ing uploads username:apache, apache:apache, nobody:apache, nobody:nobody. tried these combinations wp-content , public_html. recursively of course. chmod-ing folders 777, 775, 755, 766. safe-mode not running tried using mkdir , wp_mkdir_p actions. restarts on apache throughout make sure changes saved , made. none of has affect. i have seen few places people have suggested getting ahold of server host give php writing capabilites. have though dedicated server installed on? if not, there config or setting missing. see no reason why can't make new directory. wp 3.5.1 php 5.3.3 apache/2.2.15 (centos) linux os

c++ - dynamic library don't generate lib file using visual studio 2012 -

i using visual studio 2012 , creared dll without using mfc, generating dll. when specify generate lib file in specific directory using following option:- go proeperties page->advanced->import library ../../../lib/myapp.lib it not genearting lib file in specified folder. please me . thanks & regards vikas see following: may need declare /exports ( http://msdn.microsoft.com/en-us/library/7k30y2k5.aspx ) http://msdn.microsoft.com/en-us/library/67wc07b9.aspx see "remarks"

xcode - pausing timer,uiview animation and audio iOS -

i have viewcontroller playing sound using avaudioplayer , timer running 2 minutes using nstimer , sequence of animation being played using [uiview animatewithduration:2.0 delay:0.0 options:uiviewanimationoptioncurvelinear animations:^{ //rolling man's tongue out _cooling2manimage.alpha = 1.0; _cooling3manimage.alpha = 0.0; } completion:^(bool boolvalue){ [uiview animatewithduration:2.0 delay:0.0 options:uiviewanimationoptioncurvelinear animations:^{ //showing arrow image , translating arrow mouth _cooling1arrowimage.alpha = 1.0;

c# - ASP.NET IDENTITIES Turn On when i publish -

when publish mvc4 c# website on server, iis authentication "take identity of asp.net" turning on automatically. how can let authentication "off" ? it's working code in webconfig : <authentication mode="windows" /> <identity impersonate="false" /> <authorization> <deny users="?" /> </authorization>

ms project - Reverse dependency in MSProject (Start-Finish) in 3-task-scenario not understood -

i'm kind of experienced msproject. nevertheless ran pretty simple problem can't solve. please help. direct solutions or vba solutions welcome. the case: 3 tasks need aligned. brother , sister visited me , leave individually (driving home task bro , task sis). have tea 2 of them (task tea) in time before first of 2 leaving. ----- tea (predecessor: sf sis) ---------- bro -------------- sis here tasks ordered , scheduled well. but: in case sister leaving later brother, task tea going shifted, too. not good, brother might miss family tea. solution, thought, second sf dependency on tea task (btw: i'm not using forward deps, because in real world scenario bro , sis having more complicated dependencies , must not governed family having tea). surprise, tea shifed after adding bro-dep shown here (and sister missing tea): ----- tea (predecessor: sf sis, sf bro) ---------- bro -------------- sis there easy

apache - php file operations permission denied -

i have 2 virtual hosts on redhat enterprise server, 1 of functions desired. second have problems when using php kind of file operations. far can tell both virtual hosts have been set in same. have checked file permissions have been set correctly on folders/files in question. have gone far set permissions 777. can suggest might have gone wrong? virtual hosts set follows: <virtualhost *:80> servername intranet serveralias intranet *.intranet documentroot /home/burnside/public_html <directory "/home/burnside/public_html"> allow options +indexes </directory> </virtualhost> <virtualhost *:80> servername tracker serveralias tracker *.tracker documentroot /home/tracker/public_html <directory "/home/tracker/public_html"> allow options +indexes </directory> </virtualhost>

local - run Javascript locally rather than connecting to JQuery -

is possible run script locally website rather connecting jquery.com hosted library/query? currently, connected online page performing query, functions in code , need run locally without need online librbary or library in background thanks code: <script type="text/javascript" src="http://www.freshessays.com/jquery.min.js"></script>!-- start calculator block -- table class="fe_calc fe_block_templ" <tr> <td>academic level:</td> <td> <select id="calform_academic_level1" name="academic_level" onchange="calcountprice1();" style="width:140px;"> <option value="0">please select</option> <option value="1">high school</option> <option value="2">bachelor</option> <option value="3">master</option> <option value=&q

android - Hiding Edittext in spinner onItemSelected -

in 1 of layouts have edittext show when 1 spinner option selected. in rest of options hide. this action doesn't work, when select 1 option edittext not hide or show, if select same option again work ok. i manage edittext visibility in spinner onitemselected. any idea or solution? i don't post code because have many leves of hierarchies in code , includes in layout. oh, that's easy, have move thing other thing, has after third thing, okay?

php - Filtering <iframe> src attribute -

i have website allows user embed videos using <iframe> tags such . <iframe width="560" height="315" src="http://www.youtube.com/embed/se2p7hjpane" frameborder="0" allowfullscreen></iframe> however, not idea since can input website on src attribute , not video. such <iframe src="http://www.google.com"/> is there anyway handle this? parse urls submitted , filter them through whitelist. aren't on list either discarded or put in queue administrator approval.

sql - A little help to better understand JOINS -

i have 3 tables substract data, , of data have query works pretty good, can't specific row , that's need help. table 1: equipmentid | equipmentname | equipmenttypeid 15 | tesla | 68 16 | colombus | 93 table 2: equipmenttypeid | displayname | 68 | electrical device| 93 | gps device | table 3: equipmentid | ipaddress | 15 | 192.168.1.1| 16 | 192.168.0.1| so far data following using folowing sql syntax: select distinct t1.ipaddress, t2.equipmentid table3 t1 join table1 t2 on t1.equipmentid = t2.equipmentid ipaddress '%192%' the result looks like ipaddress | equipmentid | 192.168.1.1| 15 | 192.168.0.1| 16 | however when join followiing result messed up select distinct t1.ipaddress, t2.equipmentid, t3.equipmenttypeid, t4.displayname table3 t1 join table1 t2 on t2.equipmentid = t1.equipmentid join table2 t3 on t3.equipmenttypeid = t1.e

tsql - Rollback trans and unlock tables on SQL Server -

hy , had problems sql server because of unknown transactions left opened or lock table, , read many suggestion avoid restarting server until found , , seems work have others suggestion release locks , rollback trans ? because reserved on running on production server use master; go alter database [db_dev] set single_user rollback immediate; alter database [db_dev] set multi_user; go you can check blocking process using sp_who2 then kill spid setting single_user reverting drop connections database. can dangerous on production servers.

java - Android Creating a Grid -

is there android library creating grid views similar 1 in this app i have done few google searches can't seem able find anything. what looking not grid graph views. graph views let create nodes, linked lines / arrows. a while used java graph library called jgraph, it's not compatible android views. most answers on type of question use custom views.

c# - Hiding panels with different names in one repeater using jQuery? -

can 1 me hiding panels different names in repeater using jquery? the main logic have documents sorted year in tabs, , tab name year. when client clicks on 1 specific tab, should provide him see documents have year property. documents per year nested in panel(div),and panel's name related tab name, year. should somehow hit panel name, , if it's same name tab,to show documents per year... thanks in advance! if add css class each element want hide in repeater, this: $(document).ready(function () { $('.hideme').hide(); }); to show elements again, can call: $('.hideme').show(); here's reference jquery's hide , show functions.

Jquery toggle show and hide text change -

i've been hunting awhile , can't find answer or work want. right have content hidden, expands down when clicked on "read more" when been clicked, text changed "less" or "hide" or something. here code. $(document).ready(function () { $('.moreinfo').hide(); $('.more').click(function () { $('#info'+$(this).attr('target')).toggle(500); return false; }); }); then goes html <p class="moreinfo" id="info1">content here</p> <a class="more" target="1">read more</a> any appreciated! thank you. you can use callbacks here jsfiddle $('.moreinfo').hide(); $('.more').click(function (ev) { var t = ev.target $('#info' + $(this).attr('target')).toggle(500, function(){ $(t).html($(this).is(':visible')? 'i\'m done readin

UML Class Diagram for Strategy Pattern -

Image
i have exam in couple of hours , trying solve sample questions it. couldn't find solution following question. draw class diagram corresponding following situation: a grocery store (e.g., supermarket) sells items. there 2 types of items: edible (i.e., item can used food) , non-edible. items sold weight, , sold per unit. items taxable, while others not. items have special prices when sold in groups (e.g., 2 $3). purchase may contain many items. in class diagram, show classes/abstract classes/interfaces, associations, , multiplicities associations. not include operations! indicate interfaces , abstract classes (if any) in design. furthermore, design should flexible possible. in particular, need pay attention following points: 1) item either edible or not , fact not change during lifetime of item, whereas pricing strategies may change during lifetime of item. 2) each pricing strategy a

c# - How to get the intermediate portion of string? -

i have string under var input= "dbo.xyx.v1.userdefinedfunction"; the desired output "xyx.v1"; my attempt var input = "dbo.xyx.v1.userdefinedfunction"; var intermediate = input.split('.').skip(1); var res = intermediate.reverse().skip(1).aggregate((a, b) => b + "." + a); works fine..but other proper , elegant method? kindly note can part(in example showed 4 parts) e.g. input : "dbo.part1.part2.part3.part4.userdefinedfunction" output : "part1.part2.part3.part4" string output= input.substring(input.indexof('.') + 1, input.lastindexof('.') - input.indexof('.') - 1);

javascript - Force safari to always display the top bar on smartphones -

i'm developing website smartphone , i'm having issues top safari bar. display in portrait , landscape. on page, have link animation. when i'm clicking on it, browser removing top bar. there way let top bar during animation? thanks safari automatically slides browser top bar on iphones , ipod touches asoon page scrolled, single pixel. the way around have div fills screen css property overflow:hidden have control movement of content.

c# - Convert List< Guid > to List< Guid? > -

what best practice convert list< guid > list< guid? > the following not compile: public list<guid?> foo() { list<guid> guids = getguidslist(); return guids; } something this return guids.select(e => new guid?(e)).tolist();

ios - BLE characteristic is nil when the service is not nil running in iPhone -

in project ,i use ble peripheral connected iphone. when beyond maximum connected distance , communication disconnected, , come back,the communication become connected. after re-connected, characteristic can not write data ! seem characteristic nil service not nil. must run app again characteristic can write data normally. dose have same situation,or idea ? wait help. -(void) writecharacteristicvalue:(int )value forcharacteristic:(cbcharacteristic *)charateristic type:(cbcharacteristicwritetype ) type { nslog(@"writecharacteristicvalue"); nsdata *data = nil; u8 val = value; if (nil == serviceperipheral) { nslog(@"not connected peripheral"); return ; } if (nil == charateristic) { nslog(@"no valid characteristic"); return; } data = [nsdata datawithbytes:&val length:sizeof (val)]; [serviceperipheral writevalue:data forcharacteristic: charateristic type:type];

events - Detect screen shutdown in vb.net -

i'm building application using vb.net should record specific user actions, 1 of these actions screen shutdown, there way that? maybe system event or can check periodically know if screen active or not. i've found code check if screensaver running want know if there's way detect if screen phisically turned off.

javascript - Check if selected text on page has some word in it -

with below code can find text on page , highlight document.designmode = "on"; if(window.find(textline, true)){ document.execcommand("backcolor", false, "rgb(250, 250, 0)"); textselection.collapsetoend(); } document.designmode = "off"; but requirement find text in selected text. i.e want highlight text if word existing in selected text. surroundcountents() method can wrap initial text div element , try searching html, looking solution code above. suggestions please? it's not supported use window.find find text selected previous window.find window.find method (from see) not support searching in ranges or selections. api here: http://help.dottoro.com/ljkjvqqo.php i suspect use window.find again keyword , check caret position, etc verify result in original result seems inefficient on first glace. have @ selection api , ranges... https://developer.mozilla.org/en/docs/dom/selection run 2 window.find , compare ran

php - Check if a generated license is valid -

i have php script generates strings used license keys: function keygen(){ $key = md5(microtime()); $new_key = ''; for($i=1; $i <= 25; $i ++ ){ $new_key .= $key[$i]; if ( $i%5==0 && $i != 25) $new_key.='-'; } return strtoupper($new_key); } $x = 0; while($x <= 10) { echo keygen(); echo "<br />"; $x++; } after running script once, got these: 8b041-ec7d2-0b9e3-09846-e8c71 c8d82-514b9-068bc-8bf80-05061 a18a3-e05e5-7ded7-d09ed-298c4 fb1ec-c9844-b9b20-ade2f-0858f e9aed-945c8-4baaa-6938d-713ed 4d284-c5a3b-734df-09bd6-6a34c ef534-3bae4-860b5-d3260-1cef8 d84db-b8c72-5bdee-1b4fe-24e90 93af2-80813-cd66e-e7a5e-bf0ae c3397-93aa3-6239c-28d9f-7a582 d83b8-697c6-58cd1-56f1f-58180 what trying change have function check if key has been generated using script. currently, thinking setting $key md5 of 1 specific string (for example, test ) but, of course, returns strings same. can help?

php - Syntax error with a sql query -

below code, getting error you have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 3 any appreciated. <?php include("../includes/conn.php"); $sql = "select * `t_maincontent` uid_page =". $_get['page'] ; $results = mysql_query($sql, $conn) or die(mysql_error()); $content = mysql_fetch_assoc($results); //print $content['nv_content']."¬".$content['nv_title']."¬".$content['nv_meta']; ?> please read basics on doing database queries php. you should check whether $_get['page'] exists via isset( $_get['page'] ); send query if exists. include( '../includes/conn.php' ); if( isset( $_get['page'] ) ) { /* cast int enough cancel sql injection attacks */ $sql = 'select * t_maincontent uid_page = ' . (int) $_get['page'] ; $results = mysql_query($sql, $conn) or die(my

Should Java enum constants be retrieved through "get" methods or public final fields or both? -

see below code example: public enum employees { bob("bob barker", "bb", 100); private string fullname; //are these better accessed through public or getfullname() below? private string initials; private string age; employees(string fullname, string initials, int age) { this.fullname = fullname; this.initials = initials; this.age = age; } public string getfullname() { return fullname; } //etc ... } which method of accessing more correct or more memory efficient? you cannot access fullname through static method. instance fields. your code correct. may wish mark string fields final , rid of setxxx methods (since enum values traditionally immutable).

java - Syntax Error in insert upto? MSAccess -

i trying insert data user enters jtextfield msaccess database. when try execute sql statement error stating syntax error in insert statement. checked sql statement , tried few different things cannot seem find kind of syntax error. conn = connect.connectdb(); string sql = "insert team (" +"teamid," +"teamcity," +"teammascot," + "values("+txtid.gettext()+ ",'"+txtname.gettext()+"','"+txtaddress.gettext()+"')" ; try{ pst = conn.preparestatement(sql); pst.execute(); joptionpane.showmessagedialog(null, "entry " + txtid.gettext() + " saved"); updatejtable(); //conn.close(); } catch(exception e){ joptionpane.showmessagedialog(null, e); } the error extra comma , no closing parenthesis before keyword values string sql = "insert team ("

Django template - hide content based on time of day -

i want hide block in template (base.html) if time not weekday between 09:00 , 17:00. i thinking (very simplified): {% if 09:00 , 17:00 on weekdays %} #show callback form {% else %} #we not answer phone before 09:00 , after 17:00 {% endif %} is possible? i suggest creating flag in view.py import datetime # in view = datetime.datetime.now() call_us_now = false if 9 < now.hour < 17: call_us_now = true # send 'call_us_now' context . {# in template #} {% if call_us_now %} {# show callback form #} {% else %} {# not answer phone before 09:00 , after 17:00 #} {% endif %]

xcode - track the movement of eyeballs of the user in iphone -

i developing application need track movement of eyeballs of user i.e. whether user looking @ top or bottom of iphone. have used facedetection in earlier projects in eyes detected not movement of eyes. is there api or framework detect motion of eyeballs?? great.

sql server - Group by does not work - SQL 2008 R2 -

i have 3 rows need outputted 1 row, script below should do, can't seem have expected result, shows 3 rows, there i'm missing? should sum fields since in "group" clause? btw, working before made changes following result fields; tsl_day_a tsl_net_a tsl_tx_sal tsl_chg these fields assigned 0.00 default values. i have eyes tired staring @ it,... select br_code ,n_check ,clas_c ,clas_trd_c ,stor_no ,sum(tsl_new_a) tsl_new_a ,sum(tsl_old_a) tsl_old_a ,salestype ,sum(tsl_day_a) tsl_day_a ,sum(tsl_dis_a) tsl_dis_a ,tsl_dis_b ,sum(tsl_dis_c) tsl_dis_c ,tsl_dis_d ,sum(tsl_dis_e) tsl_dis_e ,tsl_dis_f ,tsl_dis_g ,tsl_dis_h ,tsl_dis_i ,tsl_dis_j ,tsl_dis_k ,tsl_dis_l ,sum(tsl_tax_a) tsl_tax_a ,tsl_tax_b ,tsl_adj_a ,tsl_adj_pos ,ts_adj_neg ,tsl_adj_nt_pos ,tsl_adj_nt_neg ,sum(tsl_net_a) tsl_net_a ,sum(tsl_void) tsl_void ,sum(tsl_rfnd) tsl_rfnd ,s

javascript - Jquery 1.9 - declare variable after load -

<div class="main_content grid_9 clearfix omega"> <div class="basic_info"> <p>you have <?php $msg = count($messages); $msg_tekst = ($msg == 1) ? 'message.' : 'messages.'; echo $msg . ' ' . $msg_tekst; ?> </p> <p>show <a role=show_msg href="<?php echo base_url('admin/contact_messages/unread') ?>">unread </a> | <a role=show_msg href="<?php echo base_url('admin/contact_messages/read') ?>">read </a> messages. </p> </div> <!-- start contact messages --> <div class="contact_messages"> <?php foreach ($messages $msg) : ?> <article class="box contact_message clearfix"> <h2><?php echo $msg['na

cygwin - Android NDK - Linking issue -

that's first time using android ndk , cygwin, i'm working on windows xp 32bits if thats of help. i trying port visual studio 8 project used on windows , linux use on android platform. project quite big , has files in several folders… when trying build ndk-build, lot of error of these kind : d:/android-ndk-r8d-windows/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi-v7a/objs/ndkmain/.o: in function version:jni/.cpp:75: error: undefined reference 'get_version(long*, long*, long*, long*)' for example, here myfile.cpp #include "../kernel/include/get_version.h" long version (long *a, long *b, long *c, long *d) { if(get_version(a, b, c, d) == -1) return(idp_err_pointer); return (idp_correct); } get_version(long*, long*, long*, long*) defined in get_version.h head

php - PHPMailer Feedback Email -

i've made form potential clients fill in estimated quote via email. receive emails fine , works way want to. i have jquery validation, won't bother posting code snippet unless wants see well. echoes possible errors in slidedown div box. my main concern is, secure? when got form work correctly wanted make sure had done right, did find out header injections etc. i'm quite paranoid right now. not want spam being sent stupid mistakes. my question is, missing important security features , there way shorten code (listing variables, i'm sure need checked, can checked when they're given variable name?) the code follows: <?php error_reporting(0); $emailaddress = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $csite = $_get['csite']; $locate = $_get['locate']; $describe = $_get['describe']; $competition = $_get['competition']; $ideas = $_get['ideas']; $require